From: Michael Tremer Date: Fri, 15 Dec 2023 12:58:59 +0000 (+0000) Subject: docs: Refactor showing image details/uploads X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=99d40bec9bca95158e3bc19d523212d30b048386;p=ipfire.org.git docs: Refactor showing image details/uploads Signed-off-by: Michael Tremer --- diff --git a/src/templates/docs/files/detail.html b/src/templates/docs/files/detail.html index cd822a45..368f697e 100644 --- a/src/templates/docs/files/detail.html +++ b/src/templates/docs/files/detail.html @@ -5,86 +5,131 @@ {% block head %}{% end block %} {% block main %} -
-
+
+
{% if file.is_image() %} -

- {{ file.filename }} -

+
+
+
+ {{ file.filename }} +
+
+
{% elif file.is_pdf() %} - -

- {{ _("This PDF attachment could not be displayed.") }} - {{ _("Click here to download") }} -

-
+
+ +

+ {{ _("This PDF attachment could not be displayed.") }} + {{ _("Click here to download") }} +

+
+
{% end %} - +
+
+
{% if file.is_image() %} -
{{ _("Usage") }}
+
{{ _("Usage") }}
-
![](./{{ file.filename }})
+
+
![](./{{ file.filename }})
+
-

{{ _("Or with an optional caption") }}

+
{{ _("Or with an optional caption") }}
-
![](./{{ file.filename }} "{{ _("Caption") }}")
+
+
![](./{{ file.filename }} "{{ _("Caption") }}")
+
{% end %} -
{{ _("Details") }}
+
{{ _("Details") }}
-
-
{{ _("Filename") }}
-
{{ file.filename }}
+ + + + + {% if file.author %} -
{{ _("Author") }}
-
- {{ file.author }} -
+ + + + {% end %} -
{{ _("Uploaded at") }}
-
{{ locale.format_date(file.created_at) }}
+ + + + {% if file.deleted_at %} -
{{ _("Deleted at") }}
-
{{ locale.format_date(file.deleted_at) }}
+ + + + {% end %} {% set revisions = file.get_revisions() %} {% if len(revisions) > 1 %} -
{{ _("Other Revisions") }}
-
-
+ {% if i == 0 %} + + {% else %} + {% end %} - - + + + + {% end %} {% end %} - +
+ {{ _("Filename") }} + + {{ file.filename }} +
+ {{ _("Author") }} + + {{ file.author }} +
+ {{ _("Uploaded at") }} + + {{ locale.format_date(file.created_at) }} +
+ {{ _("Deleted at") }} + + {{ locale.format_date(file.deleted_at) }} +
{{ _("Other Revisions") }} + + {{ _("Uploaded %(time)s by %(author)s") % { "time" : locale.format_date(r.created_at), "author" : r.author } }} + +
+
+
-
{{ _("Delete") }}
+
+
+
{{ _("Delete") }}
-
- + -
{{ _("Upload Newer Revision") }}
+
{{ _("Upload Newer Revision") }}
{% raw xsrf_form_html() %} @@ -92,17 +137,32 @@ -
- - - - +
+
+
+ +
+
+ +

{{ _("Uploading a new file to replaces this one to fix any errata in the current version") }} - +

-
- +
+
+ +
diff --git a/src/web/docs.py b/src/web/docs.py index 41fc6332..e0ee6733 100644 --- a/src/web/docs.py +++ b/src/web/docs.py @@ -283,7 +283,7 @@ class UploadHandler(base.BaseHandler): except TypeError as e: raise e - self.redirect("%s/_files" % path) + self.redirect("/docs%s/_files" % path) class WatchHandler(base.BaseHandler):