From 02a10bfe32c20c837c03c900ccaec06b394ccce1 Mon Sep 17 00:00:00 2001 From: Gareth Coles Date: Wed, 17 Apr 2019 15:59:25 +0100 Subject: Lots of work on the images management page --- pydis_site/settings.py | 2 + .../templates/wiki/plugins/images/index.html | 221 ++++++++++++--------- 2 files changed, 134 insertions(+), 89 deletions(-) (limited to 'pydis_site') diff --git a/pydis_site/settings.py b/pydis_site/settings.py index 40954566..15718485 100644 --- a/pydis_site/settings.py +++ b/pydis_site/settings.py @@ -278,6 +278,8 @@ BULMA_SETTINGS = { "link": "$primary", "green": "#21c65c", # Better contrast with the light text + + "dimensions": "16 24 32 48 64 96 128 256 512" # Image dimensions } } diff --git a/pydis_site/templates/wiki/plugins/images/index.html b/pydis_site/templates/wiki/plugins/images/index.html index 191d5533..a3474273 100644 --- a/pydis_site/templates/wiki/plugins/images/index.html +++ b/pydis_site/templates/wiki/plugins/images/index.html @@ -12,97 +12,140 @@ {% trans "Back to edit page" %}

- - {% for image in images %} - {% with image.current_revision.imagerevision as revision %} - - - - - - - - - - - - - - - - -
{{ revision.get_filename|default:_("No file") }}{% trans "Markdown tag" %}{% trans "Uploaded by" %}{% trans "Size" %}
-

- {% thumbnail revision.image "250x250" as thumb %} - {{ revision.get_filename }} - {% endthumbnail %} -

- {% if image|can_write:user %} -

- {% if revision.deleted %} - - - {% trans "Upload and publish new image" %} -
- - - {% trans "Restore image" %} - - {% else %} - - - {% trans "Upload replacement" %} -
- - - {% trans "Remove image" %} - - {% endif %} - {% if article|can_moderate:user %} -
- - - {% trans "Completely delete" %} - - {% endif %} -

- {% endif %} -
[image:{{ image.id }}] -

{% include "wiki/includes/revision_info.html" %}

-
{{ revision.get_size|filesizeformat }}
{{ revision.width }}x{{ revision.height }} pixels -
{% trans "History" %}
- - {% for old_revision in image.revision_set.all %} - - - - - - - - {% endwith %} - {% empty %} - - - {% endfor %} + {% endthumbnail %} + + {% if image|can_write:user %} + {% if revision.deleted %} + + + + + Upload + + + + + + Restore + + {% else %} + + + + + Upload + + + + + + Remove + + {% endif %} + {% if article|can_moderate:user %} + + + + + Delete + + {% endif %} + {% endif %} + + + + + + + + + + + + + {% endwith %} + {% endfor %}
- {% thumbnail old_revision.imagerevision.image "50x50" crop="center" as thumb %} - {{ revision.imagerevision.get_filename }} - {% endthumbnail %} - {% include "wiki/includes/revision_info.html" with current_revision=image.current_revision revision=old_revision %}{{ old_revision.imagerevision.get_size|filesizeformat }}{{ old_revision.imagerevision.width }}x{{ old_revision.imagerevision.height }} - {% if image|can_write:user and old_revision != image.current_revision %} - - - {% trans "Revert to this version" %} + + {% for image in images %} + {% with image.current_revision.imagerevision as revision %} + + + + + + + + + + + - - {% endfor %} -
{{ revision.get_filename|default:_("No filename") }}TagUpdatedSize
+
+ {% thumbnail revision.image "128x128" as thumb %} + + {{ revision.get_filename }} - {% endif %} -
-
-

{% trans "There are no images for this article." %}

-
+ [image:{{ image.id }}] + + {% include "wiki/includes/revision_info.html" %} + + {{ revision.get_size|filesizeformat }}
{{ revision.width }}x{{ revision.height }} pixels +
+ History +
+ + + + + + + + + + + + {% for old_revision in image.revision_set.all %} + + + + + + + + {% endfor %} + +
UpdatedSizeDimensions
+
+ {% thumbnail old_revision.imagerevision.image "50x50" crop="center" as thumb %} + + {{ revision.imagerevision.get_filename }} + + {% endthumbnail %} +
+
+ {% include "wiki/includes/revision_info.html" with current_revision=image.current_revision revision=old_revision %} + + {{ old_revision.imagerevision.get_size|filesizeformat }} + + {{ old_revision.imagerevision.width }}x{{ old_revision.imagerevision.height }} pixels + + {% if image|can_write:user and old_revision != image.current_revision %} + + + + + Restore + + {% else %} + + + + + Current + + {% endif %} +
+
{% include "wiki/includes/pagination.html" %} -- cgit v1.2.3