]> git.ipfire.org Git - ipfire.org.git/blob - src/templates/wiki/files/detail.html
wiki: Add detail page for files
[ipfire.org.git] / src / templates / wiki / files / detail.html
1 {% extends "../base.html" %}
2
3 {% block title %}{{ file.filename }}{% end block %}
4
5 {% block main %}
6 <div class="card mb-4">
7 <div class="card-body">
8 {% if file.is_image() %}
9 <img class="img-fluid img-thumbnail" src="{{ file.url }}?s=768" alt="{{ file.filename }}">
10 {% elif file.is_pdf() %}
11 <object class="pdf-viewer" data="{{ file.url }}"
12 title="{{ file.filename }}" type="{{ file.mimetype }}">
13 <p>
14 {{ _("This PDF attachment could not be displayed.") }}
15 <a href="{{ file.url }}">{{ _("Click here to download") }}</a>
16 </p>
17 </object>
18 {% end %}
19
20 <a class="btn btn-primary btn-lg btn-block my-3" href="{{ file.url }}">
21 <span class="fas fa-file-download"></span>
22 {{ _("Download") }} ({{ format_size(file.size) }})
23 </a>
24
25 <dl class="row mb-0">
26 <dt class="col-sm-3">{{ _("Filename") }}</dt>
27 <dd class="col-sm-9">{{ file.filename }}</dd>
28
29 {% if file.author %}
30 <dt class="col-sm-3">{{ _("Author") }}</dt>
31 <dd class="col-sm-9">
32 <a href="/users/{{ file.author.uid }}">{{ file.author }}</a>
33 </dd>
34 {% end %}
35
36 <dt class="col-sm-3">{{ _("Uploaded at") }}</dt>
37 <dd class="col-sm-9">{{ locale.format_date(file.created_at) }}</dd>
38 </dl>
39 </div>
40 </div>
41 {% end block %}