aboutsummaryrefslogtreecommitdiffstats
path: root/pydis_site/templates/staff/logs.html
blob: a0bfa2a781ea044e522ab277cf6184b6c69d9557 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
{% extends 'base/base.html' %}
{% load static %}
{% load deletedmessage_filters %}

{% block title %}Logs for Deleted Message Context {{ message_context.id }}{% endblock %}

{% block head %}
    <link rel="stylesheet" href="{% static "css/staff/logs.css" %}">
{% endblock %}

{% block content %}
    <ul class="is-size-7">
        <li>Deleted by: <span style="color: {{ deletion_context.actor.top_role.colour | hex_colour }}">{{ deletion_context.actor }}</span></li>
        <li>Date: {{ deletion_context.creation }}</li>
    </ul>
    <div class="is-divider has-small-margin"></div>
    {% for message in deletion_context.deletedmessage_set.all %}
        <div class="discord-message">
            <div class="discord-message-header">
                <span class="discord-username"
                      style="color: {{ message.author.top_role.colour | hex_colour }}">{{ message.author }}</span><span
                    class="discord-message-metadata">{{ message.timestamp }} | User ID: {{ message.author.id }}</span>
            </div>
            <div class="discord-message-content">
                {{ message.content|linebreaks }}
            </div>
            <div class="discord-message-attachments">
                {% for attachment in message.attachments %}
                    <img alt="Attachment" class="discord-attachment" src="{{ attachment }}">
                {% endfor %}
            </div>
            {% for embed in message.embeds %}
                <div class="discord-embed is-size-7">
                    <div class="discord-embed-color" style="background-color: {% if embed.color %}{{ embed.color | hex_colour }}{% else %}#cacbce{% endif %}"></div>
                    <div class="discord-embed-inner">
                        <div class="discord-embed-content">
                            <div class="discord-embed-main">
                                {% if embed.author %}
                                    <div class="discord-embed-author">
                                        {% if embed.author.icon_url %}
                                            <img alt="Author Icon" class="discord-embed-author-icon"
                                                 src="{{ embed.author.icon_url }}">{% endif %}
                                        {% if embed.author.url %}<a class="discord-embed-author-url"
                                                                    href="{{ embed.author.url }}">{% endif %}
                                        <span class="discord-embed-author-name">{{ embed.author.name }}</span>
                                        {% if embed.author.url %}</a>{% endif %}
                                    </div>
                                {% endif %}
                                {% if embed.title %}
                                    <div class="discord-embed-title">
                                        {% if embed.url %}<a href="{{ embed.url }}">{% endif %}
                                        {{ embed.title }}
                                        {% if embed.url %}</a>{% endif %}
                                    </div>
                                {% endif %}
                                {% if embed.description %}
                                    <div class="discord-embed-description">
                                        {{ embed.description | linebreaksbr }}
                                    </div>
                                {% endif %}
                                {% if embed.fields %}
                                    <div class="discord-embed-fields">
                                        {% for field in embed.fields %}
                                            <div class="discord-embed-field{% if field.inline %} discord-embed-field-inline{% endif %}">
                                                <div class="discord-embed-field-name">{{ field.name }}</div>
                                                <div class="discord-embed-field-value">{{ field.value }}</div>
                                            </div>
                                        {% endfor %}
                                    </div>
                                {% endif %}
                                {% if embed.image %}
                                    <div class="discord-embed-image">
                                        <img alt="Discord Embed Image" src="{{ embed.image.url }}">
                                    </div>
                                {% endif %}
                            </div>
                            {% if embed.thumbnail %}
                                <div class="discord-embed-thumbnail">
                                    <img alt="Embed thumbnail" src="{{ embed.thumbnail.url }}">
                                </div>
                            {% endif %}
                        </div>
                        {% if embed.footer or embed.timestamp %}
                            <div class="discord-embed-footer">
                                {% if embed.footer.icon_url %}
                                    <img class="discord-embed-footer-icon" alt="Footer Icon"
                                         src="{{ embed.footer.icon_url }}">
                                {% endif %}
                                {% if embed.footer.text or embed.timestamp %}
                                    <span class="discord-embed-footer-text">{% endif %}
                                {% if embed.footer.text %}{{ embed.footer.text }}{% endif %}
                                {% if embed.footer.text and embed.timestamp %}{% endif %}
                                {% if embed.timestamp %}{{ embed.timestamp | footer_datetime }}{% endif %}
                                {% if embed.footer.text or embed.timestamp %}</span>{% endif %}
                            </div>
                        {% endif %}
                    </div>
                </div>
            {% endfor %}
        </div>
    {% endfor %}
{% endblock %}