contentdb/app/templates/packages/release_edit.html

99 lines
3.3 KiB
HTML
Raw Normal View History

2021-05-04 04:15:26 +02:00
{% extends "packages/package_base.html" %}
{% block title %}
2022-01-08 00:27:00 +01:00
{{ _("Edit release") }} - {{ package.title }}
{% endblock %}
{% block content %}
2021-07-24 04:56:43 +02:00
<h1>{{ self.title() }}</h1>
2018-12-22 23:29:30 +01:00
{% from "macros/forms.html" import render_field, render_submit_field, render_checkbox_field %}
<form method="POST" action="">
{{ form.hidden_tag() }}
{% if package.check_perm(current_user, "MAKE_RELEASE") %}
{{ render_field(form.title) }}
2018-03-21 20:36:53 +01:00
{% else %}
2022-01-08 00:27:00 +01:00
{{ _("Title") }}: {{ release.title }}
{% endif %}
{% if package.check_perm(current_user, "CHANGE_RELEASE_URL") %}
{{ render_field(form.url) }}
2018-03-21 20:36:53 +01:00
{% else %}
2022-01-08 00:27:00 +01:00
{{ _("URL") }}: <a href="{{ release.url }}">{{ release.url }}</a><br />
{% endif %}
2018-07-28 15:48:03 +02:00
{% if release.commit_hash %}
2022-01-08 00:27:00 +01:00
{{ _("Commit Hash") }}: {{ release.commit_hash }}<br />
2018-07-28 15:48:03 +02:00
{% endif %}
2018-05-23 20:17:44 +02:00
{% if release.task_id %}
2022-01-08 00:27:00 +01:00
{{ _("Importing...") }}
<a href="{{ url_for('tasks.check', id=release.task_id, r=release.get_edit_url()) }}">{{ _("view task") }}</a><br />
{% if package.check_perm(current_user, "CHANGE_RELEASE_URL") %}
2018-05-23 20:17:44 +02:00
{{ render_field(form.task_id) }}
{% endif %}
<br />
2018-03-21 20:36:53 +01:00
{% else %}
{% if release.check_perm(current_user, "APPROVE_RELEASE") %}
2018-12-22 23:29:30 +01:00
{{ render_checkbox_field(form.approved, class_="my-3") }}
{% else %}
2022-01-08 00:27:00 +01:00
{{ _("Approved") }}: {{ release.approved }}
{% endif %}
{% endif %}
2022-01-08 00:27:00 +01:00
<h3 class="mt-5">{{ _("Supported Minetest versions") }}</h3>
<div class="row">
{{ render_field(form.min_rel, class_="col-sm-6") }}
{{ render_field(form.max_rel, class_="col-sm-6") }}
</div>
<p id="minmax_warning" class="text-danger d-none">
2022-01-08 00:27:00 +01:00
{{ _("Maximum must be greater than or equal to the minimum!") }}
</p>
<p id="latest_release" class="text-warning d-none">
{% set last = form.max_rel | last_it %}
<strong>
{{ _("Are you sure your package doesn't work on versions after %(version)s?", version=last.label) }}
</strong>
{{ _("Only set the maximum version if you know that it doesn't work on newer Minetest versions.") }}
{{ _("Don't set the maximum version just because you haven't tested it on newer versions.") }}
<p>
<p>
2022-01-08 00:27:00 +01:00
{{ _("Set the minimum and maximum Minetest versions supported.
This release will be hidden to clients outside of that range. ") }}
<br />
{{ _("Leave both as None if in doubt.") }}
{{ _("You can <a href='/help/package_config/'>set this automatically</a> in the .conf of your package.") }}
</p>
<p class="mt-5">
{{ render_submit_field(form.submit) }}
</p>
</form>
2020-01-19 01:02:33 +01:00
<h2 class="mt-5">{{ _("Delete Release") }}</h2>
{% if release.check_perm(current_user, "DELETE_RELEASE") %}
<form method="POST" action="{{ release.get_delete_url() }}" class="alert alert-secondary mb-5">
2020-01-19 01:02:33 +01:00
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
2023-08-22 20:58:43 +02:00
<input class="btn btn-sm btn-danger float-end" type="submit" value="{{ _('Delete') }}">
<b>{{ _("This is permanent.") }}</b>
{{ _("Any associated uploads will not be deleted immediately, but the release will no longer be listed.") }}
<div style="clear:both;"></div>
2020-01-19 01:02:33 +01:00
</form>
{% else %}
<div class="alert alert-secondary mb-5">
{{ _("You cannot delete the latest release; please create a newer one first.") }}
</div>
{% endif %}
{% endblock %}
{% block scriptextra %}
<script src="/static/js/release_minmax.js?v=2"></script>
{% endblock %}