From 3679448cdf89120c9d0ab689d2125a8b46f5cdd0 Mon Sep 17 00:00:00 2001 From: TAKAHASHI Shuuji Date: Sun, 15 Jan 2023 02:32:48 +0900 Subject: [PATCH] FIx HTML issues found by djLint (#409) --- takahe/urls.py | 2 +- templates/activities/_event.html | 2 +- templates/activities/_menu.html | 2 +- templates/activities/_type_question.html | 14 +++++---- templates/admin/_pagination.html | 2 +- templates/admin/announcement_delete.html | 5 ++-- templates/admin/announcements.html | 2 +- templates/admin/domain_delete.html | 2 +- templates/admin/domains.html | 2 +- templates/admin/hashtag_edit.html | 2 +- templates/admin/identity_edit.html | 36 +++++++++++------------ templates/admin/invites.html | 4 +-- templates/admin/stator.html | 6 ++-- templates/admin/users.html | 2 +- templates/auth/perform_reset_success.html | 4 +-- templates/auth/signup_success.html | 2 +- templates/auth/trigger_reset_success.html | 2 +- templates/base.html | 8 ++--- templates/base_plain.html | 4 +-- templates/emails/account_new.html | 10 +++---- templates/emails/password_reset.html | 10 +++---- templates/emails/report_new.html | 20 ++++++------- templates/flatpage.html | 2 +- templates/identity/_identity_banner.html | 4 +-- templates/identity/_menu.html | 6 ++-- templates/identity/select.html | 2 +- templates/settings/_menu.html | 2 +- users/models/announcement.py | 4 +-- 28 files changed, 83 insertions(+), 80 deletions(-) diff --git a/takahe/urls.py b/takahe/urls.py index aeb8443..d6046b1 100644 --- a/takahe/urls.py +++ b/takahe/urls.py @@ -238,7 +238,7 @@ urlpatterns = [ # Identity selection path("@/activate/", identity.ActivateIdentity.as_view()), path("identity/select/", identity.SelectIdentity.as_view(), name="identity_select"), - path("identity/create/", identity.CreateIdentity.as_view()), + path("identity/create/", identity.CreateIdentity.as_view(), name="identity_create"), # Flat pages path("about/", core.About.as_view(), name="about"), path( diff --git a/templates/activities/_event.html b/templates/activities/_event.html index b18f682..365d336 100644 --- a/templates/activities/_event.html +++ b/templates/activities/_event.html @@ -35,5 +35,5 @@ {% include "activities/_post.html" with post=event.subject_post event=event %} {% endif %} {% else %} - Unknown event type {{event.type}} + Unknown event type {{ event.type }} {% endif %} diff --git a/templates/activities/_menu.html b/templates/activities/_menu.html index 517ae0d..1e849ef 100644 --- a/templates/activities/_menu.html +++ b/templates/activities/_menu.html @@ -57,7 +57,7 @@ {% if current_page == "home" %}

Compose

-
+ {% csrf_token %} {{ form.text }} {{ form.content_warning }} diff --git a/templates/activities/_type_question.html b/templates/activities/_type_question.html index 5754e76..ef456b6 100644 --- a/templates/activities/_type_question.html +++ b/templates/activities/_type_question.html @@ -6,12 +6,14 @@

Options: {% if post.type_data.mode == "oneOf" %}(choose one){% endif %}

{% for item in post.type_data.options %} {% if forloop.first %}
    {% endif %}{% widthratio item.votes post.type_data.voter_count 100 as item_percent %} -
  • - {% if forloop.last %}
{% endif %} +
  • + +
  • + {% if forloop.last %}{% endif %} {% endfor %} - +
    + {% endblock %} diff --git a/templates/admin/announcements.html b/templates/admin/announcements.html index b93ffab..5ac1778 100644 --- a/templates/admin/announcements.html +++ b/templates/admin/announcements.html @@ -19,7 +19,7 @@ {% if announcement.service_announcement %}{{ domain.service_domain }}{% endif %} - + {% if not announcement.published %} Draft diff --git a/templates/admin/domain_delete.html b/templates/admin/domain_delete.html index 01941b7..c660090 100644 --- a/templates/admin/domain_delete.html +++ b/templates/admin/domain_delete.html @@ -24,5 +24,5 @@ {% endif %} - + {% endblock %} diff --git a/templates/admin/domains.html b/templates/admin/domains.html index 028c344..a99e76e 100644 --- a/templates/admin/domains.html +++ b/templates/admin/domains.html @@ -20,7 +20,7 @@ {% if domain.service_domain %}{{ domain.service_domain }}{% endif %} - + {% if domain.public %}Public{% else %}Private{% endif %} {% if domain.default %}(Default){% endif %} diff --git a/templates/admin/hashtag_edit.html b/templates/admin/hashtag_edit.html index 08d17e9..0bc345d 100644 --- a/templates/admin/hashtag_edit.html +++ b/templates/admin/hashtag_edit.html @@ -33,7 +33,7 @@ {% endif %} {% empty %} -

    Hashtag is either not used or stats have not been computed yet.

    +

    Hashtag is either not used or stats have not been computed yet.

    {% endfor %} diff --git a/templates/admin/identity_edit.html b/templates/admin/identity_edit.html index 9ad2a37..d7de0ca 100644 --- a/templates/admin/identity_edit.html +++ b/templates/admin/identity_edit.html @@ -10,7 +10,7 @@ Stats - {% if identity.local %} - - - {% else %} - - - {% endif %} - - @@ -73,23 +73,23 @@ {% if not identity.local %} - {% if identity.state == "outdated" %} - {% endif %} {% endif %} - {% if not identity.local %} - {% endif %} @@ -101,17 +101,17 @@
    {% if not identity.local %} - {% endif %} {% if identity.limited %} - {% else %} - {% endif %} {% if identity.blocked %} - {% else %} - {% endif %}
    diff --git a/templates/admin/invites.html b/templates/admin/invites.html index a94661f..42c0667 100644 --- a/templates/admin/invites.html +++ b/templates/admin/invites.html @@ -33,7 +33,7 @@ Expired {% endif %} {% endif %} - +
    {% empty %} diff --git a/templates/admin/stator.html b/templates/admin/stator.html index 1f64eda..a80d4ae 100644 --- a/templates/admin/stator.html +++ b/templates/admin/stator.html @@ -8,15 +8,15 @@ {{ model }} - - - diff --git a/templates/admin/users.html b/templates/admin/users.html index d49c5a7..f5fe0fb 100644 --- a/templates/admin/users.html +++ b/templates/admin/users.html @@ -25,7 +25,7 @@ identit{{ user.num_identities|pluralize:"y,ies" }} - + {% if user.banned %} Banned diff --git a/templates/auth/perform_reset_success.html b/templates/auth/perform_reset_success.html index 3f5125a..5b55406 100644 --- a/templates/auth/perform_reset_success.html +++ b/templates/auth/perform_reset_success.html @@ -7,8 +7,8 @@
    Password Set

    - Your password for {{ email }} has been set. You can - now login. + Your password for {{ email }} has been set. You can + now login.

    diff --git a/templates/auth/signup_success.html b/templates/auth/signup_success.html index 20fc7c2..bc2b501 100644 --- a/templates/auth/signup_success.html +++ b/templates/auth/signup_success.html @@ -7,7 +7,7 @@
    Email Sent

    - An email has been sent to {{ email }} - please follow + An email has been sent to {{ email }} - please follow the link inside to finish creating your account.

    diff --git a/templates/auth/trigger_reset_success.html b/templates/auth/trigger_reset_success.html index c0c1a0d..b156dd4 100644 --- a/templates/auth/trigger_reset_success.html +++ b/templates/auth/trigger_reset_success.html @@ -7,7 +7,7 @@
    Password Reset Sent

    - Please check your email at {{ email }} for the reset link. + Please check your email at {{ email }} for the reset link.

    diff --git a/templates/base.html b/templates/base.html index 7924b38..ec51ca8 100644 --- a/templates/base.html +++ b/templates/base.html @@ -33,8 +33,8 @@ {% block custom_head %}{% if config.custom_head %}{{ config.custom_head|safe }}{% endif %}{% endblock %} - Skip to Content - Skip to Navigation + Skip to Content + Skip to Navigation
    {% block body_main %}
    @@ -67,13 +67,13 @@ {% else %}
    - Login + Login {% endif %}
    {% block full_content %} - {% include 'activities/_image_viewer.html' %} + {% include "activities/_image_viewer.html" %} {% block pre_content %} {% endblock %}
    diff --git a/templates/base_plain.html b/templates/base_plain.html index 861a377..a046826 100644 --- a/templates/base_plain.html +++ b/templates/base_plain.html @@ -10,7 +10,7 @@
    {% if not request.user.is_authenticated and current_page == "about" and config.signup_allowed %} - Sign Up + Sign Up {% else %} Home {% endif %} @@ -21,7 +21,7 @@ {% if request.user.is_authenticated %} Back {% else %} - Login + Login {% endif %}
    diff --git a/templates/emails/account_new.html b/templates/emails/account_new.html index 3eda077..7e67858 100644 --- a/templates/emails/account_new.html +++ b/templates/emails/account_new.html @@ -1,24 +1,24 @@ {% extends "emails/base.html" %} {% load mail_tags %} {% autoescape off %} - {% block title %}{{settings.MAIN_DOMAIN}} - New Account Created{% endblock title %} - {% block subtitle %}{{settings.MAIN_DOMAIN}} - New Account Created{% endblock subtitle %} + {% block title %}{{ settings.MAIN_DOMAIN }} - New Account Created{% endblock title %} + {% block subtitle %}{{ settings.MAIN_DOMAIN }} - New Account Created{% endblock subtitle %} {% block body_greeting %} {% email_body_content "Hi there," %} {% endblock body_greeting %} {% block body_content %} - {% email_body_content "Your email address was used to create a new account at {{config.site_name}} (https://{{settings.MAIN_DOMAIN}})." %} + {% email_body_content "Your email address was used to create a new account at {{ config.site_name }} (https://{{ settings.MAIN_DOMAIN }})." %} {% email_body_content "To confirm your new account, go to this link:" %} {% endblock body_content %} {% block body_button %} - {% email_button button_text="Confirm New Account" button_link="https://{{settings.MAIN_DOMAIN}}/auth/reset/{{reset.token}}/" %} + {% email_button button_text="Confirm New Account" button_link="https://{{ settings.MAIN_DOMAIN }}/auth/reset/{{ reset.token }}/" %} {% endblock body_button %} {% block body_signature %} - {% email_body_content "Thanks, Admins @{{settings.MAIN_DOMAIN}}" %} + {% email_body_content "Thanks, Admins @{{ settings.MAIN_DOMAIN }}" %} {% endblock body_signature %} {% block extra_footer %} diff --git a/templates/emails/password_reset.html b/templates/emails/password_reset.html index 31a4de1..812babf 100644 --- a/templates/emails/password_reset.html +++ b/templates/emails/password_reset.html @@ -1,24 +1,24 @@ {% extends "emails/base.html" %} {% load mail_tags %} {% autoescape off %} - {% block title %}{{settings.MAIN_DOMAIN}} - Password Reset Requested{% endblock title %} - {% block subtitle %}{{settings.MAIN_DOMAIN}} - Password Reset Requested{% endblock subtitle %} + {% block title %}{{ settings.MAIN_DOMAIN }} - Password Reset Requested{% endblock title %} + {% block subtitle %}{{ settings.MAIN_DOMAIN }} - Password Reset Requested{% endblock subtitle %} {% block body_greeting %} {% email_body_content "Hi there," %} {% endblock body_greeting %} {% block body_content %} - {% email_body_content "A password reset was requested for your account ({{reset.user.email}}) at {{Config.system.site_name}} (https://{{settings.MAIN_DOMAIN}})." %} + {% email_body_content "A password reset was requested for your account ({{ reset.user.email }}) at {{ Config.system.site_name }} (https://{{ settings.MAIN_DOMAIN }})." %} {% email_body_content "To reset your password, go to this link:" %} {% endblock body_content %} {% block body_button %} - {% email_button button_text="Reset Password" button_link="https://{{settings.MAIN_DOMAIN}}/auth/reset/{{reset.token}}/" %} + {% email_button button_text="Reset Password" button_link="https://{{ settings.MAIN_DOMAIN }}/auth/reset/{{ reset.token }}/" %} {% endblock body_button %} {% block body_signature %} - {% email_body_content "Thanks, Admins @{{settings.MAIN_DOMAIN}}" %} + {% email_body_content "Thanks, Admins @{{ settings.MAIN_DOMAIN }}" %} {% endblock body_signature %} {% block extra_footer %} diff --git a/templates/emails/report_new.html b/templates/emails/report_new.html index b0b239a..5ac4e5c 100644 --- a/templates/emails/report_new.html +++ b/templates/emails/report_new.html @@ -1,33 +1,33 @@ {% extends "emails/base.html" %} {% load mail_tags %} {% autoescape off %} - {% block title %}{{config.site_name}} - New Moderation Report{% endblock title %} - {% block subtitle %}{{config.site_name}} - New Moderation Report{% endblock subtitle %} + {% block title %}{{ config.site_name }} - New Moderation Report{% endblock title %} + {% block subtitle %}{{ config.site_name }} - New Moderation Report{% endblock subtitle %} {% block body_greeting %} {% email_body_content "Moderation Team," %} - {% email_body_content "A new report has been recieved for {{config.site_name}}." %} + {% email_body_content "A new report has been recieved for {{ config.site_name }}." %} {% endblock body_greeting %} {% block body_content %} {% email_body_content "=============== Report Summary ===============" %} {% if report.source_identity %} - {% email_body_content "Reporter Identity: {{report.source_identity}} @ {{report.source_domain}}" %} + {% email_body_content "Reporter Identity: {{ report.source_identity }} @ {{ report.source_domain }}" %} {% else %} - {% email_body_content "Reporter Identity: Anonymous Report from {{report.source_domain}}" %} + {% email_body_content "Reporter Identity: Anonymous Report from {{ report.source_domain }}" %} {% endif %} - {% email_body_content "Reported Identity: {{report.subject_identity}}" %} - {% email_body_content "Complaint Type: {{report.type}}" %} - {% email_body_content "Complaint Notes: {{report.complaint}}" %} + {% email_body_content "Reported Identity: {{ report.subject_identity }}" %} + {% email_body_content "Complaint Type: {{ report.type }}" %} + {% email_body_content "Complaint Notes: {{ report.complaint }}" %} {% endblock body_content %} {% block body_button %} - {% email_button button_text="View Report" button_link="https://{{settings.MAIN_DOMAIN}}/admin/reports/{{report.id}}/" %} + {% email_button button_text="View Report" button_link="https://{{ settings.MAIN_DOMAIN }}/admin/reports/{{ report.id }}/" %} {% endblock body_button %} {% block extra_footer %} - {% email_footer "You are recieving this email because you are a moderator on the Takahe instance https://{{settings.MAIN_DOMAIN}}" %} + {% email_footer "You are recieving this email because you are a moderator on the Takahe instance https://{{ settings.MAIN_DOMAIN }}" %} {% endblock extra_footer %} {% endautoescape %} diff --git a/templates/flatpage.html b/templates/flatpage.html index 8cbafe7..93ab3fe 100644 --- a/templates/flatpage.html +++ b/templates/flatpage.html @@ -1,6 +1,6 @@ {% extends "base_plain.html" %} -{% block title%}{{ title }}{% endblock %} +{% block title %}{{ title }}{% endblock %} {% block content %}

    {{ title }}

    diff --git a/templates/identity/_identity_banner.html b/templates/identity/_identity_banner.html index 71a69a4..4be7f31 100644 --- a/templates/identity/_identity_banner.html +++ b/templates/identity/_identity_banner.html @@ -12,13 +12,13 @@ data-handle="{{ identity.name_or_handle }}" _="on error set my.src to generate_avatar(@data-handle)" > - {% if link_avatar is False%} + {% if link_avatar is False %}
    {% else %} {% endif %} - {% if link_handle is False%} + {% if link_handle is False %}
    {% else %} diff --git a/templates/identity/_menu.html b/templates/identity/_menu.html index 4821b2f..058897b 100644 --- a/templates/identity/_menu.html +++ b/templates/identity/_menu.html @@ -1,11 +1,11 @@