From f7830f299fc9009ff944b3aea656b44d83c91420 Mon Sep 17 00:00:00 2001 From: Gareth Coles Date: Wed, 17 Apr 2019 11:38:04 +0100 Subject: Accessibility and images sidebar --- pydis_site/apps/home/templatetags/wiki_extra.py | 1 - pydis_site/settings.py | 4 +- pydis_site/templates/wiki/forms/fields/image.html | 4 +- .../templates/wiki/plugins/images/sidebar.html | 75 ++++++++++++---------- 4 files changed, 46 insertions(+), 38 deletions(-) diff --git a/pydis_site/apps/home/templatetags/wiki_extra.py b/pydis_site/apps/home/templatetags/wiki_extra.py index ca368e2c..e0a27973 100644 --- a/pydis_site/apps/home/templatetags/wiki_extra.py +++ b/pydis_site/apps/home/templatetags/wiki_extra.py @@ -99,4 +99,3 @@ def get_field_options(context, field: BoundField): @register.filter def render_urlpath(value: URLPath): return value.path or "/" - diff --git a/pydis_site/settings.py b/pydis_site/settings.py index 58bf5abe..40954566 100644 --- a/pydis_site/settings.py +++ b/pydis_site/settings.py @@ -276,6 +276,8 @@ BULMA_SETTINGS = { "variables": { "primary": "#7289DA", "link": "$primary", + + "green": "#21c65c", # Better contrast with the light text } } @@ -313,7 +315,7 @@ WIKI_MARKDOWN_KWARGS = { } WIKI_MESSAGE_TAG_CSS_CLASS = { - messages.DEBUG: "is-info", + messages.DEBUG: "", # is-info isn't distinctive enough from blurple messages.ERROR: "is-danger", messages.INFO: "is-primary", messages.SUCCESS: "is-success", diff --git a/pydis_site/templates/wiki/forms/fields/image.html b/pydis_site/templates/wiki/forms/fields/image.html index afef6889..ce5402be 100644 --- a/pydis_site/templates/wiki/forms/fields/image.html +++ b/pydis_site/templates/wiki/forms/fields/image.html @@ -3,7 +3,7 @@
{% if field.label %} {% endif %} @@ -33,7 +33,7 @@ - Upload + Choose diff --git a/pydis_site/templates/wiki/plugins/images/sidebar.html b/pydis_site/templates/wiki/plugins/images/sidebar.html index d206cbaf..3089cc85 100644 --- a/pydis_site/templates/wiki/plugins/images/sidebar.html +++ b/pydis_site/templates/wiki/plugins/images/sidebar.html @@ -55,48 +55,55 @@ function add_image(form) { {% endif %}
-
- - {% for image in images %} - {% with image.current_revision.imagerevision as revision %} - {% thumbnail revision.image "50x50" crop="center" as thumb %} - - - - - {% endthumbnail %} - {% endwith %} - {% empty %} - - - - {% endfor %} -
-

{% trans "Image id" %}: {{ image.id }}

-

- {% trans "Insert" %}
- {% if image|can_write:user %} - {% trans "Replace" %} - {% endif %} -

-
-
- {{ revision.get_filename }} -
-
{% trans "No images found for this article" %}
-
+{% for image in images %} + {% with image.current_revision.imagerevision as revision %} + {% thumbnail revision.image "100x100" crop="center" as thumb %} +
+
+ {{ revision.get_filename }} +
+
+
+ Image ID: {{ image.id }} +
+ +

+ + + + + + + {% if image|can_write:user %} + + + + + + {% endif %} +

+
+
+ {% endthumbnail %} + {% endwith %} +{% empty %} + No images found for this article +{% endfor %}

- - {% trans "Manage images" %} » + + Manage Images + + +


-- cgit v1.2.3