diff --git a/bookwyrm/models/report.py b/bookwyrm/models/report.py index 3a8fdd13a..8893f42fc 100644 --- a/bookwyrm/models/report.py +++ b/bookwyrm/models/report.py @@ -21,6 +21,7 @@ class Report(BookWyrmModel): constraints = [ models.CheckConstraint(check=~Q(reporter=F("user")), name="self_report") ] + ordering = ("-created_date",) class ReportComment(BookWyrmModel): diff --git a/bookwyrm/templates/moderation/report.html b/bookwyrm/templates/moderation/report.html index ca68d51d8..ce0a0b3a5 100644 --- a/bookwyrm/templates/moderation/report.html +++ b/bookwyrm/templates/moderation/report.html @@ -32,11 +32,13 @@ -
-

{% trans "Reported statuses" %}

+
+

{% trans "Reported statuses" %}

diff --git a/bookwyrm/templates/moderation/report_modal.html b/bookwyrm/templates/moderation/report_modal.html new file mode 100644 index 000000000..286131301 --- /dev/null +++ b/bookwyrm/templates/moderation/report_modal.html @@ -0,0 +1,37 @@ +{% extends 'components/modal.html' %} +{% load i18n %} +{% load humanize %} + +{% block modal-title %} +{% blocktrans with username=user.username %}Report @{{ username }}{% endblocktrans %} +{% endblock %} + +{% block modal-form-open %} +
+{% endblock %} + +{% block modal-body %} + +{% csrf_token %} + + + + +
+

{% blocktrans with site_name=site.name %}This report will be sent to {{ site_name }}'s moderators for review.{% endblocktrans %}

+ + +
+ +{% endblock %} + + +{% block modal-footer %} + + +{% trans "Cancel" as button_text %} +{% include 'snippets/toggle/toggle_button.html' with text=button_text controls_text="report" controls_uid=report_uuid class="" %} + +{% endblock %} +{% block modal-form-close %}
{% endblock %} + diff --git a/bookwyrm/templates/moderation/report_preview.html b/bookwyrm/templates/moderation/report_preview.html index 25cb8a2fb..9acc4f771 100644 --- a/bookwyrm/templates/moderation/report_preview.html +++ b/bookwyrm/templates/moderation/report_preview.html @@ -9,7 +9,7 @@ {% block card-content %}
- {% if report.notes %}{{ report.notes }}{% else %}{% trans "No notes provided" %}{% endif %} + {% if report.note %}{{ report.note }}{% else %}{% trans "No notes provided" %}{% endif %}
{% endblock %} diff --git a/bookwyrm/templates/notifications.html b/bookwyrm/templates/notifications.html index 80ee22508..3f0300bd8 100644 --- a/bookwyrm/templates/notifications.html +++ b/bookwyrm/templates/notifications.html @@ -115,15 +115,7 @@
- {% if related_status.content %} - - {{ related_status.content | safe | truncatewords_html:10 }}{% if related_status.mention_books %} {{ related_status.mention_books.first.title }}{% endif %} - - {% elif related_status.quote %} - {{ related_status.quote | safe | truncatewords_html:10 }} - {% elif related_status.rating %} - {% include 'snippets/stars.html' with rating=related_status.rating %} - {% endif %} + {% include 'snippets/status_preview.html' with status=related_status %}
{{ related_status.published_date | post_date }} diff --git a/bookwyrm/templates/snippets/report_button.html b/bookwyrm/templates/snippets/report_button.html index 9d32d5fb9..2fa0a3f30 100644 --- a/bookwyrm/templates/snippets/report_button.html +++ b/bookwyrm/templates/snippets/report_button.html @@ -1,8 +1,10 @@ {% load i18n %} -
- {% csrf_token %} - - - - -
+{% load bookwyrm_tags %} +{% with 0|uuid as report_uuid %} + +{% trans "Report" as button_text %} +{% include 'snippets/toggle/toggle_button.html' with class="is-danger is-light is-small is-fullwidth" text=button_text controls_text="report" controls_uid=report_uuid focus="modal-title-report" disabled=is_current %} + +{% include 'moderation/report_modal.html' with user=user reporter=request.user controls_text="report" controls_uid=report_uuid %} + +{% endwith %} diff --git a/bookwyrm/templates/snippets/status/status_body.html b/bookwyrm/templates/snippets/status/status_body.html index 8d6c21ed9..f3732d1a3 100644 --- a/bookwyrm/templates/snippets/status/status_body.html +++ b/bookwyrm/templates/snippets/status/status_body.html @@ -18,7 +18,10 @@ {% block card-footer %}