]>
Commit | Line | Data |
---|---|---|
531846f7 | 1 | {% extends "../page.html" %} |
8cb0bea4 MT |
2 | |
3 | {% block title %}{{ file.filename }}{% end block %} | |
4 | ||
d11dbd2e MT |
5 | {% block head %}{% end block %} |
6 | ||
8cb0bea4 MT |
7 | {% block main %} |
8 | <div class="card mb-4"> | |
9 | <div class="card-body"> | |
10 | {% if file.is_image() %} | |
acc2b3b6 | 11 | <p class="text-center"> |
ff14dea3 | 12 | <img class="img-fluid img-thumbnail" src="{{ file.url }}?revision={{ file.created_at.isoformat() }}&s=768" alt="{{ file.filename }}"> |
acc2b3b6 | 13 | </p> |
8cb0bea4 | 14 | {% elif file.is_pdf() %} |
ff14dea3 | 15 | <object class="pdf-viewer" data="{{ file.url }}?revision={{ file.created_at.isoformat() }}" |
8cb0bea4 MT |
16 | title="{{ file.filename }}" type="{{ file.mimetype }}"> |
17 | <p> | |
18 | {{ _("This PDF attachment could not be displayed.") }} | |
ff14dea3 | 19 | <a href="{{ file.url }}?revision={{ file.created_at.isoformat() }}">{{ _("Click here to download") }}</a> |
8cb0bea4 MT |
20 | </p> |
21 | </object> | |
22 | {% end %} | |
23 | ||
e6b114b8 MT |
24 | <div class="d-grid"> |
25 | <a class="btn btn-primary btn-lg my-3" href="{{ file.url }}?revision={{ file.created_at.isoformat() }}"> | |
26 | <span class="fas fa-file-download"></span> | |
27 | {{ _("Download") }} ({{ format_size(file.size) }}) | |
28 | </a> | |
29 | </div> | |
8cb0bea4 | 30 | |
ade035e5 MT |
31 | {% if file.is_image() %} |
32 | <h6>{{ _("Usage") }}</h6> | |
33 | ||
34 | <pre><code>![](./{{ file.filename }})</code></pre> | |
35 | ||
36 | <p>{{ _("Or with an optional caption") }}</p> | |
37 | ||
38 | <pre><code>![](./{{ file.filename }} "{{ _("Caption") }}")</code></pre> | |
39 | {% end %} | |
40 | ||
41 | <h6 class="my-3">{{ _("Details") }}</h6> | |
42 | ||
75271a43 | 43 | <dl class="row"> |
8cb0bea4 MT |
44 | <dt class="col-sm-3">{{ _("Filename") }}</dt> |
45 | <dd class="col-sm-9">{{ file.filename }}</dd> | |
46 | ||
47 | {% if file.author %} | |
48 | <dt class="col-sm-3">{{ _("Author") }}</dt> | |
49 | <dd class="col-sm-9"> | |
50 | <a href="/users/{{ file.author.uid }}">{{ file.author }}</a> | |
51 | </dd> | |
52 | {% end %} | |
53 | ||
54 | <dt class="col-sm-3">{{ _("Uploaded at") }}</dt> | |
55 | <dd class="col-sm-9">{{ locale.format_date(file.created_at) }}</dd> | |
ff14dea3 MT |
56 | |
57 | {% if file.deleted_at %} | |
58 | <dt class="col-sm-3">{{ _("Deleted at") }}</dt> | |
59 | <dd class="col-sm-9">{{ locale.format_date(file.deleted_at) }}</dd> | |
60 | {% end %} | |
75271a43 | 61 | |
ade035e5 MT |
62 | {% set revisions = file.get_revisions() %} |
63 | {% if len(revisions) > 1 %} | |
64 | <dt class="col-sm-3">{{ _("Other Revisions") }}</dt> | |
65 | <dd class="col-sm-9"> | |
66 | <ul class="list-inline"> | |
67 | {% for r in revisions %} | |
68 | <li> | |
69 | <a href="{{ r.url }}?action=detail&revision={{ r.created_at.isoformat() }}"> | |
70 | {{ _("Uploaded %(time)s by %(author)s") % { "time" : locale.format_date(r.created_at), "author" : r.author } }} | |
71 | </a> | |
72 | </li> | |
73 | {% end %} | |
74 | </ul> | |
75 | </dd> | |
76 | {% end %} | |
77 | </dl> | |
ff14dea3 | 78 | |
b26c705a MT |
79 | <h6>{{ _("Delete") }}</h6> |
80 | ||
e6b114b8 MT |
81 | <div class="d-grid"> |
82 | <a class="btn btn-danger mb-5" href="{{ file.url }}/_delete"> | |
83 | {{ _("Delete") }} | |
84 | </a> | |
85 | </div> | |
b26c705a | 86 | |
ade035e5 | 87 | <h6>{{ _("Upload Newer Revision") }}</h6> |
ff14dea3 MT |
88 | |
89 | <form method="POST" action="/actions/upload" enctype="multipart/form-data"> | |
90 | {% raw xsrf_form_html() %} | |
91 | ||
92 | <input type="hidden" name="path" value="{{ file.path }}"> | |
93 | <input type="hidden" name="filename" value="{{ file.filename }}"> | |
94 | ||
d7a9cbd3 MT |
95 | <div class="mb-3"> |
96 | <input class="form-control" type="file" name="file" required> | |
97 | <label class="form-label" for="customFile">{{ _("Choose a file to upload") }}</label> | |
ade035e5 MT |
98 | |
99 | <small class="form-text text-muted"> | |
100 | {{ _("Uploading a new file to replaces this one to fix any errata in the current version") }} | |
101 | </small> | |
ff14dea3 MT |
102 | </div> |
103 | ||
e6b114b8 MT |
104 | <div class="d-grid"> |
105 | <input class="btn btn-primary" type="submit" value="{{ _("Upload") }}"> | |
106 | </div> | |
ff14dea3 | 107 | </form> |
8cb0bea4 MT |
108 | </div> |
109 | </div> | |
110 | {% end block %} |