From 4358882105bed245b8f7263f10fa0434c0568a05 Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Sat, 16 Dec 2023 00:57:13 +0000 Subject: [PATCH] Fix easymde assets being included on every page --- app/templates/admin/send_bulk_email.html | 4 +++- app/templates/admin/send_email.html | 4 +++- app/templates/base.html | 3 --- app/templates/collections/create_edit.html | 2 ++ app/templates/macros/forms.html | 6 ++++++ app/templates/packages/create_edit.html | 3 ++- app/templates/packages/review_create_edit.html | 5 +++++ app/templates/threads/edit_reply.html | 5 +++++ app/templates/threads/new.html | 5 +++++ app/templates/threads/view.html | 2 ++ 10 files changed, 33 insertions(+), 6 deletions(-) diff --git a/app/templates/admin/send_bulk_email.html b/app/templates/admin/send_bulk_email.html index 20e98ae0..57dfbedc 100644 --- a/app/templates/admin/send_bulk_email.html +++ b/app/templates/admin/send_bulk_email.html @@ -12,7 +12,7 @@ This will email all users with email addresses.

-{% from "macros/forms.html" import render_field, render_submit_field %} +{% from "macros/forms.html" import render_field, render_submit_field, easymde_scripts %}
{{ form.hidden_tag() }} {{ render_field(form.subject) }} @@ -20,4 +20,6 @@ {{ render_submit_field(form.submit) }}
+{{ easymde_scripts() }} + {% endblock %} diff --git a/app/templates/admin/send_email.html b/app/templates/admin/send_email.html index 54dd7f94..e64120ac 100644 --- a/app/templates/admin/send_email.html +++ b/app/templates/admin/send_email.html @@ -7,7 +7,7 @@ {% block content %}

{{ self.title() }}

-{% from "macros/forms.html" import render_field, render_submit_field %} +{% from "macros/forms.html" import render_field, render_submit_field, easymde_scripts %}
{{ form.hidden_tag() }} {{ render_field(form.subject) }} @@ -15,4 +15,6 @@ {{ render_submit_field(form.submit) }}
+{{ easymde_scripts() }} + {% endblock %} diff --git a/app/templates/base.html b/app/templates/base.html index 17eee39d..19aa989c 100644 --- a/app/templates/base.html +++ b/app/templates/base.html @@ -284,10 +284,7 @@ - - - {% block scriptextra %}{% endblock %} diff --git a/app/templates/collections/create_edit.html b/app/templates/collections/create_edit.html index a7b24317..5f952947 100644 --- a/app/templates/collections/create_edit.html +++ b/app/templates/collections/create_edit.html @@ -12,6 +12,8 @@ + {% from "macros/forms.html" import easymde_scripts %} + {{ easymde_scripts() }} {% endblock %} {% block content %} diff --git a/app/templates/macros/forms.html b/app/templates/macros/forms.html index ce6dcbdf..dfbdb1c8 100644 --- a/app/templates/macros/forms.html +++ b/app/templates/macros/forms.html @@ -75,6 +75,12 @@ {% endmacro %} +{% macro easymde_scripts() %} + + + +{% endmacro %} + {% macro package_lists() -%} diff --git a/app/templates/packages/review_create_edit.html b/app/templates/packages/review_create_edit.html index 23536946..b284a910 100644 --- a/app/templates/packages/review_create_edit.html +++ b/app/templates/packages/review_create_edit.html @@ -8,6 +8,11 @@ {{ package.title }} {% endblock %} +{% block scriptextra %} + {% from "macros/forms.html" import easymde_scripts %} + {{ easymde_scripts() }} +{% endblock %} + {% block content %}

{{ _("Post a review for %(title)s by %(author)s", title=self.link(), author=package.author.display_name) }}

diff --git a/app/templates/threads/edit_reply.html b/app/templates/threads/edit_reply.html index 61dd06f7..83cab887 100644 --- a/app/templates/threads/edit_reply.html +++ b/app/templates/threads/edit_reply.html @@ -4,6 +4,11 @@ {{ _("Edit reply") }} - {{ thread.title }} {% endblock %} +{% block scriptextra %} + {% from "macros/forms.html" import easymde_scripts %} + {{ easymde_scripts() }} +{% endblock %} + {% block content %}

{{ _("Edit reply") }}

diff --git a/app/templates/threads/new.html b/app/templates/threads/new.html index 2673f7c8..397f94eb 100644 --- a/app/templates/threads/new.html +++ b/app/templates/threads/new.html @@ -4,6 +4,11 @@ {{ _("New Thread") }} {% endblock %} +{% block scriptextra %} + {% from "macros/forms.html" import easymde_scripts %} + {{ easymde_scripts() }} +{% endblock %} + {% block content %} {% if package and current_user != package.author and package.issueTracker %} diff --git a/app/templates/threads/view.html b/app/templates/threads/view.html index 391552a2..fa2c9666 100644 --- a/app/templates/threads/view.html +++ b/app/templates/threads/view.html @@ -29,6 +29,8 @@ {% if current_user.is_authenticated %} {% endif %} + {% from "macros/forms.html" import easymde_scripts %} + {{ easymde_scripts() }} {% endblock %} {% block content %}