diff options
Diffstat (limited to 'templates')
| -rw-r--r-- | templates/activities/_post.html | 3 | ||||
| -rw-r--r-- | templates/admin/report_view.html | 84 | ||||
| -rw-r--r-- | templates/admin/reports.html | 43 | ||||
| -rw-r--r-- | templates/settings/_menu.html | 4 | ||||
| -rw-r--r-- | templates/users/report.html | 27 | ||||
| -rw-r--r-- | templates/users/report_sent.html | 13 | 
6 files changed, 172 insertions, 2 deletions
diff --git a/templates/activities/_post.html b/templates/activities/_post.html index 5d75b78..990e457 100644 --- a/templates/activities/_post.html +++ b/templates/activities/_post.html @@ -37,6 +37,9 @@              <a href="{{ post.urls.view }}" role="menuitem">                  <i class="fa-solid fa-comment"></i> View Post & Replies              </a> +            <a href="{{ post.urls.action_report }}" role="menuitem"> +                <i class="fa-solid fa-flag"></i> Report +            </a>              {% if post.author == request.identity %}              <a href="{{ post.urls.action_edit }}" role="menuitem">                  <i class="fa-solid fa-pen-to-square"></i> Edit diff --git a/templates/admin/report_view.html b/templates/admin/report_view.html new file mode 100644 index 0000000..c9819b4 --- /dev/null +++ b/templates/admin/report_view.html @@ -0,0 +1,84 @@ +{% extends "settings/base.html" %} + +{% block subtitle %}Report {{ report.pk }}{% endblock %} + +{% block content %} +    <form action="." method="POST"> +        {% csrf_token %} +        <fieldset> +            <legend>Report</legend> +            <label>Report about</label> +            {% if report.subject_post %} +                {% include "activities/_mini_post.html" with post=report.subject_post %} +            {% else %} +                {% include "activities/_identity.html" with identity=report.subject_identity %} +            {% endif %} +            <label>Reported by</label> +            {% if report.source_identity %} +                {% include "activities/_identity.html" with identity=report.source_identity %} +            {% else %} +                <p>Remote server {{ report.source_domain.domain }}</p> +            {% endif %} +            <label>Complaint</label> +            <p>{{ report.complaint|linebreaks }}</p> +            {% if report.resolved %} +                <label>Resolved</label> +                <p> +                    {{ report.resolved|timesince }} ago by +                    <a href="{{ report.moderator.urls.view }}">{{ report.moderator.name_or_handle }}</a> +                </p> +            {% endif %} +        </fieldset> +        <fieldset> +            <legend>Moderator Notes</legend> +            {% include "forms/_field.html" with field=form.notes %} +        </fieldset> +        <fieldset> +            <legend>Resolution Options</legend> +            <table class="buttons"> +                <tr> +                    {% if report.resolved and report.valid %} +                        <th><button disabled="true">Resolve Valid</button></th> +                        <td>Report is already resolved as valid</td> +                    {% else %} +                        <th><button name="valid">Resolve Valid</button></th> +                        <td>Mark report against the identity but take no further action</td> +                    {% endif %} +                </tr> +                <tr> +                    {% if report.resolved and not report.valid %} +                        <th><button disabled="true">Resolve Invalid</button></th> +                        <td>Report is already resolved as invalid</td> +                    {% else %} +                        <th><button name="invalid">Resolve Invalid</button></th> +                        <td>Mark report as invalid and take no action</td> +                    {% endif %} +                </tr> +                <tr> +                    {% if report.subject_identity.limited %} +                        <th><button class="danger" disabled="true">Limit</button></th> +                        <td>User is already limited</td> +                    {% else %} +                        <th><button class="danger" name="limit">Limit</button></th> +                        <td>Make them less visible on this server</td> +                    {% endif %} +                </tr> +                <tr> +                    {% if report.subject_identity.blocked %} +                        <th><button class="danger" disabled="true">Block</button></th> +                        <td>User is already blocked</td> +                    {% else %} +                        <th><button class="danger" name="block">Block</button></th> +                        <td>Remove their existence entirely from this server</td> +                    {% endif %} +                </tr> +            </table> +        </fieldset> +        <div class="buttons"> +            <a href="{{ report.urls.admin }}" class="button secondary left">Back</a> +            <a href="{{ report.subject_identity.urls.view }}" class="button secondary">View Profile</a> +            <a href="{{ report.subject_identity.urls.admin_edit }}" class="button secondary">Identity Admin</a> +            <button>Save Notes</button> +        </div> +    </form> +{% endblock %} diff --git a/templates/admin/reports.html b/templates/admin/reports.html new file mode 100644 index 0000000..1634443 --- /dev/null +++ b/templates/admin/reports.html @@ -0,0 +1,43 @@ +{% extends "settings/base.html" %} +{% load activity_tags %} + +{% block subtitle %}Reports{% endblock %} + +{% block content %} +    <div class="view-options"> +        {% if all %} +            <a href="." class="selected"><i class="fa-solid fa-check"></i> Show Resolved</a> +        {% else %} +            <a href=".?all=true"><i class="fa-solid fa-xmark"></i> Show Resolved</a> +        {% endif %} +    </div> +    <section class="icon-menu"> +        {% for report in page_obj %} +            <a class="option" href="{{ report.urls.admin_view }}"> +                <img src="{{ report.subject_identity.local_icon_url.relative }}" class="icon" alt="Avatar for {{ report.subject_identity.name_or_handle }}"> +                <span class="handle"> +                    {{ report.subject_identity.html_name_or_handle }} +                    {% if report.subject_post %} +                        (post {{ report.subject_post.pk }}) +                    {% endif %} +                    <small> +                        {{ report.type|title }} +                    </small> +                </span> +                <time>{{ report.created|timedeltashort }} ago</time> +            </a> +        {% empty %} +            <p class="option empty"> +                There are no {% if all %}reports yet{% else %}unresolved reports{% endif %}. +            </p> +        {% endfor %} +        <div class="load-more"> +            {% if page_obj.has_previous %} +                <a class="button" href=".?page={{ page_obj.previous_page_number }}{% if all %}&all=true{% endif %}">Previous Page</a> +            {% endif %} +            {% if page_obj.has_next %} +                <a class="button" href=".?page={{ page_obj.next_page_number }}{% if all %}&all=true{% endif %}">Next Page</a> +            {% endif %} +        </div> +    </section> +{% endblock %} diff --git a/templates/settings/_menu.html b/templates/settings/_menu.html index 0a6062d..45b7ee3 100644 --- a/templates/settings/_menu.html +++ b/templates/settings/_menu.html @@ -39,8 +39,8 @@      <a href="{% url "admin_hashtags" %}" {% if section == "hashtags" %}class="selected"{% endif %} title="Hashtags">          <i class="fa-solid fa-hashtag"></i> Hashtags      </a> -    <a href="{% url "admin_tuning" %}" {% if section == "tuning" %}class="selected"{% endif %} title="Tuning"> -        <i class="fa-solid fa-wrench"></i> Tuning +    <a href="{% url "admin_reports" %}" {% if section == "reports" %}class="selected"{% endif %} title="Reports"> +        <i class="fa-solid fa-flag"></i> Reports      </a>      <a href="{% url "admin_stator" %}" {% if section == "stator" %}class="selected"{% endif %} title="Stator">          <i class="fa-solid fa-clock-rotate-left"></i> Stator diff --git a/templates/users/report.html b/templates/users/report.html new file mode 100644 index 0000000..557b35e --- /dev/null +++ b/templates/users/report.html @@ -0,0 +1,27 @@ +{% extends "base.html" %} + +{% block title %}Report{% endblock %} + +{% block content %} +    <form action="." method="POST"> +        {% csrf_token %} +        <fieldset> +            <legend>Report</legend> +            <label>Reporting</label> +            {% if post %} +                {% include "activities/_mini_post.html" %} +            {% else %} +                {% include "activities/_identity.html" %} +            {% endif %} +            {% include "forms/_field.html" with field=form.type %} +            {% include "forms/_field.html" with field=form.complaint %} +            {% if not identity.local %} +                {% include "forms/_field.html" with field=form.forward %} +            {% endif %} +        </fieldset> + +        <div class="buttons"> +            <button>Send Report</button> +        </div> +    </form> +{% endblock %} diff --git a/templates/users/report_sent.html b/templates/users/report_sent.html new file mode 100644 index 0000000..4e8c78c --- /dev/null +++ b/templates/users/report_sent.html @@ -0,0 +1,13 @@ +{% extends "base.html" %} + +{% block title %}Report Sent{% endblock %} + +{% block content %} +    <form action="." method="POST"> +        {% csrf_token %} +        <fieldset> +            <legend>Report</legend> +            <p>Your report has been sent.</p> +        </fieldset> +    </form> +{% endblock %}  | 
