Fix easymde assets being included on every page

This commit is contained in:
rubenwardy 2023-12-16 00:57:13 +00:00
parent 8606f596f3
commit 4358882105
10 changed files with 33 additions and 6 deletions

@ -12,7 +12,7 @@
This will email all users with email addresses.
</p>
{% from "macros/forms.html" import render_field, render_submit_field %}
{% from "macros/forms.html" import render_field, render_submit_field, easymde_scripts %}
<form action="" method="POST" class="form" role="form">
{{ form.hidden_tag() }}
{{ render_field(form.subject) }}
@ -20,4 +20,6 @@
{{ render_submit_field(form.submit) }}
</form>
{{ easymde_scripts() }}
{% endblock %}

@ -7,7 +7,7 @@
{% block content %}
<h1>{{ self.title() }}</h1>
{% from "macros/forms.html" import render_field, render_submit_field %}
{% from "macros/forms.html" import render_field, render_submit_field, easymde_scripts %}
<form action="" method="POST" class="form" role="form">
{{ form.hidden_tag() }}
{{ render_field(form.subject) }}
@ -15,4 +15,6 @@
{{ render_submit_field(form.submit) }}
</form>
{{ easymde_scripts() }}
{% endblock %}

@ -284,10 +284,7 @@
</footer>
<link href="/static/fa/css/all.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="/static/libs/easymde.min.css">
<script src="/static/libs/bootstrap.min.js?v=2"></script>
<script src="/static/libs/easymde.min.js"></script>
<script src="/static/js/markdowntextarea.js?v=2"></script>
{% block scriptextra %}{% endblock %}
</body>

@ -12,6 +12,8 @@
<script src="/static/libs/jquery.min.js?v=2"></script>
<script src="/static/libs/jquery-ui.min.js?v=2"></script>
<script src="/static/js/collection_editor.js"></script>
{% from "macros/forms.html" import easymde_scripts %}
{{ easymde_scripts() }}
{% endblock %}
{% block content %}

@ -75,6 +75,12 @@
<script src="/static/js/tagselector.js"></script>
{% endmacro %}
{% macro easymde_scripts() %}
<link rel="stylesheet" type="text/css" href="/static/libs/easymde.min.css">
<script src="/static/libs/easymde.min.js"></script>
<script src="/static/js/markdowntextarea.js?v=2"></script>
{% endmacro %}
{% macro package_lists() -%}
<script>
meta_packages = [

@ -12,10 +12,11 @@
{% endblock %}
{% from "macros/forms.html" import render_field, render_field_prefix_button, render_submit_field, form_scripts,
render_multiselect_field, package_lists %}
render_multiselect_field, package_lists, easymde_scripts %}
{% block scriptextra %}
{{ form_scripts() }}
{{ easymde_scripts() }}
{% if enable_wizard %}
<script src="/static/js/polltask.js"></script>
<script src="/static/js/package_create.js"></script>

@ -8,6 +8,11 @@
<a href="{{ package.get_url('packages.view') }}">{{ package.title }}</a>
{% endblock %}
{% block scriptextra %}
{% from "macros/forms.html" import easymde_scripts %}
{{ easymde_scripts() }}
{% endblock %}
{% block content %}
<h1>{{ _("Post a review for %(title)s by %(author)s", title=self.link(), author=package.author.display_name) }}</h1>

@ -4,6 +4,11 @@
{{ _("Edit reply") }} - {{ thread.title }}
{% endblock %}
{% block scriptextra %}
{% from "macros/forms.html" import easymde_scripts %}
{{ easymde_scripts() }}
{% endblock %}
{% block content %}
<h1>{{ _("Edit reply") }}</h1>

@ -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 %}

@ -29,6 +29,8 @@
{% if current_user.is_authenticated %}
<script src="/static/js/quick_review_voting.js?v=2"></script>
{% endif %}
{% from "macros/forms.html" import easymde_scripts %}
{{ easymde_scripts() }}
{% endblock %}
{% block content %}