Make release_notes markdown

This commit is contained in:
rubenwardy 2024-06-22 15:48:54 +01:00
parent 44e6f42b51
commit 23335f4d30
3 changed files with 10 additions and 6 deletions

@ -226,7 +226,7 @@ Format query parameters:
* `id`: release ID * `id`: release ID
* `name`: short release name * `name`: short release name
* `title`: human-readable title * `title`: human-readable title
* `release_notes`: string or null, what's new in this release * `release_notes`: string or null, what's new in this release. Markdown.
* `release_date`: Date released * `release_date`: Date released
* `url`: download URL * `url`: download URL
* `commit`: commit hash or null * `commit`: commit hash or null

@ -14,15 +14,15 @@
{% if package.check_perm(current_user, "MAKE_RELEASE") %} {% if package.check_perm(current_user, "MAKE_RELEASE") %}
{{ render_field(form.name, hint=_("Release short name. Eg: 1.0.0 or 2018-05-28")) }} {{ render_field(form.name, hint=_("Release short name. Eg: 1.0.0 or 2018-05-28")) }}
{{ render_field(form.title, hint=_("Human-readable name. Eg: 1.0.0 - The Trains Update")) }} {{ render_field(form.title, hint=_("Human-readable name. Eg: 1.0.0 - The Trains Update")) }}
{{ render_field(form.release_notes) }} {{ render_field(form.release_notes, fieldclass="form-control markdown") }}
{% else %} {% else %}
<p> <p>
{{ _("Name") }}: {{ release.name }}<br> {{ _("Name") }}: {{ release.name }}<br>
{{ _("Title") }}: {{ release.title }} {{ _("Title") }}: {{ release.title }}
</p> </p>
<p> <div class="markdown">
{{ release.release_notes }} {{ release.release_notes | markdown }}
</p> </div>
{% endif %} {% endif %}
{% if package.check_perm(current_user, "CHANGE_RELEASE_URL") %} {% if package.check_perm(current_user, "CHANGE_RELEASE_URL") %}
@ -101,6 +101,8 @@
{% endif %} {% endif %}
{% endblock %} {% endblock %}
{% from "macros/forms.html" import easymde_scripts %}
{% block scriptextra %} {% block scriptextra %}
{{ easymde_scripts() }}
<script src="/static/js/release_minmax.js?v=2"></script> <script src="/static/js/release_minmax.js?v=2"></script>
{% endblock %} {% endblock %}

@ -41,7 +41,7 @@
{{ render_field(form.name, hint=_("Release short name. Eg: 1.0.0 or 2018-05-28")) }} {{ render_field(form.name, hint=_("Release short name. Eg: 1.0.0 or 2018-05-28")) }}
{{ render_field(form.title, placeholder=_("Same as name"), hint=_("Human-readable name. Eg: 1.0.0 - The Trains Update")) }} {{ render_field(form.title, placeholder=_("Same as name"), hint=_("Human-readable name. Eg: 1.0.0 - The Trains Update")) }}
{{ render_field(form.release_notes) }} {{ render_field(form.release_notes, fieldclass="form-control markdown") }}
<h3 class="mt-5">{{ _("2. Set the content") }}</h3> <h3 class="mt-5">{{ _("2. Set the content") }}</h3>
@ -98,7 +98,9 @@
</form> </form>
{% endblock %} {% endblock %}
{% from "macros/forms.html" import easymde_scripts %}
{% block scriptextra %} {% block scriptextra %}
{{ easymde_scripts() }}
<script src="/static/js/release_minmax.js?v=2"></script> <script src="/static/js/release_minmax.js?v=2"></script>
<script src="/static/js/release_new.js?v=2"></script> <script src="/static/js/release_new.js?v=2"></script>
{% endblock %} {% endblock %}