From 0dd8b339910708eaf82d342fc13ff39dd096705f Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Mon, 19 Apr 2021 15:19:55 -0700 Subject: [PATCH] Moves user admin templates into snippets --- bookwyrm/templates/moderation/report.html | 71 +------------------ bookwyrm/templates/user_admin/user.html | 19 +++++ bookwyrm/templates/user_admin/user_info.html | 56 +++++++++++++++ .../user_admin/user_moderation_actions.html | 17 +++++ 4 files changed, 94 insertions(+), 69 deletions(-) create mode 100644 bookwyrm/templates/user_admin/user.html create mode 100644 bookwyrm/templates/user_admin/user_info.html create mode 100644 bookwyrm/templates/user_admin/user_moderation_actions.html diff --git a/bookwyrm/templates/moderation/report.html b/bookwyrm/templates/moderation/report.html index 1cadd28d..a078fe45 100644 --- a/bookwyrm/templates/moderation/report.html +++ b/bookwyrm/templates/moderation/report.html @@ -15,76 +15,9 @@ {% include 'moderation/report_preview.html' with report=report %} -
-
-

{% trans "User details" %}

-
- {% include 'user/user_preview.html' with user=report.user %} - {% if report.user.summary %} -
- {{ report.user.summary | to_markdown | safe }} -
- {% endif %} +{% include 'user_admin/user_info.html' with user=report.user %} -

{% trans "View user profile" %}

-
-
- {% if not report.user.local %} - {% with server=report.user.federated_server %} -
-

{% trans "Instance details" %}

-
- {% if server %} -
{{ server.server_name }}
-
-
-
{% trans "Software:" %}
-
{{ server.application_type }}
-
-
-
{% trans "Version:" %}
-
{{ server.application_version }}
-
-
-
{% trans "Status:" %}
-
{{ server.status }}
-
-
- {% if server.notes %} -
{% trans "Notes" %}
-
- {{ server.notes }} -
- {% endif %} - -

- {% trans "View instance" %} -

- {% else %} - {% trans "Not set" %} - {% endif %} -
-
- {% endwith %} - {% endif %} -
- -
-

{% trans "Actions" %}

-
-

- {% trans "Send direct message" %} -

-
- {% csrf_token %} - {% if report.user.is_active %} - - {% else %} - - {% endif %} -
-
-
+{% include 'user_admin/user_moderation_actions.html' with user=report.user %}

{% trans "Moderator Comments" %}

diff --git a/bookwyrm/templates/user_admin/user.html b/bookwyrm/templates/user_admin/user.html new file mode 100644 index 00000000..7bb6abfa --- /dev/null +++ b/bookwyrm/templates/user_admin/user.html @@ -0,0 +1,19 @@ +{% extends 'settings/admin_layout.html' %} +{% load i18n %} +{% load bookwyrm_tags %} +{% load humanize %} + +{% block title %}{{ username }}{% endblock %} +{% block header %}{{ username }}{% endblock %} + +{% block panel %} + + +{% include 'user_admin/user_info.html' with user=user %} + +{% include 'user_admin/user_moderation_actions.html' with user=user %} + +{% endblock %} + diff --git a/bookwyrm/templates/user_admin/user_info.html b/bookwyrm/templates/user_admin/user_info.html new file mode 100644 index 00000000..e5f5d580 --- /dev/null +++ b/bookwyrm/templates/user_admin/user_info.html @@ -0,0 +1,56 @@ +{% load i18n %} +{% load bookwyrm_tags %} +
+
+

{% trans "User details" %}

+
+ {% include 'user/user_preview.html' with user=user %} + {% if user.summary %} +
+ {{ user.summary | to_markdown | safe }} +
+ {% endif %} + +

{% trans "View user profile" %}

+
+
+ {% if not user.local %} + {% with server=user.federated_server %} +
+

{% trans "Instance details" %}

+
+ {% if server %} +
{{ server.server_name }}
+
+
+
{% trans "Software:" %}
+
{{ server.application_type }}
+
+
+
{% trans "Version:" %}
+
{{ server.application_version }}
+
+
+
{% trans "Status:" %}
+
{{ server.status }}
+
+
+ {% if server.notes %} +
{% trans "Notes" %}
+
+ {{ server.notes }} +
+ {% endif %} + +

+ {% trans "View instance" %} +

+ {% else %} + {% trans "Not set" %} + {% endif %} +
+
+ {% endwith %} + {% endif %} +
+ diff --git a/bookwyrm/templates/user_admin/user_moderation_actions.html b/bookwyrm/templates/user_admin/user_moderation_actions.html new file mode 100644 index 00000000..41010994 --- /dev/null +++ b/bookwyrm/templates/user_admin/user_moderation_actions.html @@ -0,0 +1,17 @@ +{% load i18n %} +
+

{% trans "Actions" %}

+
+

+ {% trans "Send direct message" %} +

+
+ {% csrf_token %} + {% if user.is_active %} + + {% else %} + + {% endif %} +
+
+