From 8da376b0ebff72db9f72b7026b6f2fef4dff4f13 Mon Sep 17 00:00:00 2001 From: Sebastiaan Zeeff <33516116+SebastiaanZ@users.noreply.github.com> Date: Thu, 22 Aug 2019 15:44:06 +0200 Subject: Making the deleted-messages-frontend functional with changes, including: - Adding support for embeds to both the template and the css; - Adding Discord fonts to create a Discord-realistic rendering; - Adding Discord color int to html hex filter for use in templates; - Removing unnecessary int -> hex property from role model (see previous point); - Adding support to compute timestamp from snowflake int in the message model; - Forcing the order of deleted messages list view to snowflake `id` to guarantee chronological order. --- pydis_site/templates/staff/logs.html | 76 +++++++++++++++++++++++++++++++++++- 1 file changed, 75 insertions(+), 1 deletion(-) (limited to 'pydis_site/templates') diff --git a/pydis_site/templates/staff/logs.html b/pydis_site/templates/staff/logs.html index 66b42f6a..49d9c368 100644 --- a/pydis_site/templates/staff/logs.html +++ b/pydis_site/templates/staff/logs.html @@ -1,5 +1,6 @@ {% extends 'base/base.html' %} {% load static %} +{% load deletedmessage_filters %} {% block title %}Logs for Deleted Message Context {{ message_context.id }}{% endblock %} @@ -8,15 +9,88 @@ {% endblock %} {% block content %} + +
{% for message in messages %}
- {{ message.author.name }}#{{ message.author.discriminator }} + {{ message.author }}
{{ message.content|linebreaks }}
+ + {% for embed in message.embeds %} +
+
+
+
+
+
+ + {% if embed.author %} +
+ {% if embed.author.icon_url %}Author Icon{% endif %} + {% if embed.author.url %}{% endif %} + {{ embed.author.name }} + {% if embed.author.url %}{% endif %} +
+ {% endif %} + + {% if embed.title %} +
+ {% if embed.url %}{% endif %} + {{ embed.title }} + {% if embed.url %}{% endif %} +
+ {% endif %} + + {% if embed.description %} +
+ {{ embed.description | linebreaksbr }} +
+ {% endif %} + + {% if embed.fields %} +
+ {% for field in embed.fields %} +
+
{{ field.name }}
+
{{ field.value }}
+
+ {% endfor %} +
+ {% endif %} + {% if embed.image %} +
+ Discord Embed Image +
+ {% endif %} +
+ {% if embed.thumbnail %} +
+ Embed thumbnail +
+ {% endif %} +
+ {% if embed.footer or embed.timestamp %} + + {% endif %} +
+
+ {% endfor %}
{% endfor %} {% endblock %} \ No newline at end of file -- cgit v1.2.3