contentdb/app/templates/packages/release_new.html
2021-01-29 16:36:23 +00:00

101 lines
3.1 KiB
HTML

{% extends "base.html" %}
{% block title %}
{{ _("Create a release") }} - {{ package.title }}
{% endblock %}
{% block content %}
<h1>{{ _("Create a release") }}</h1>
{% if package.update_config %}
<p class="alert alert-secondary mb-4">
<a class="float-right btn btn-sm btn-secondary" href="{{ package.getUpdateConfigURL() }}">{{ _("Settings") }}</a>
{{ _("You have automatic releases enabled") }}
</p>
{% else %}
<p class="alert alert-info mb-4">
{% if package.repo %}
<a class="float-right btn btn-sm btn-info" href="{{ package.getSetupReleasesURL() }}">{{ _("Set up") }}</a>
<i class="fas fa-info mr-2"></i>
{{ _("You can create releases automatically when you push commits or tags to your repository.") }}
{% else %}
<a class="float-right btn btn-sm btn-info" href="{{ package.getEditURL() }}">{{ _("Add Git repo") }}</a>
<i class="fas fa-info mr-2"></i>
{{ _("Using Git would allow you to create releases automatically when you push code or tags.") }}
{% endif %}
</p>
{% endif %}
{% from "macros/forms.html" import render_field, render_submit_field, render_radio_field %}
<form method="POST" action="" enctype="multipart/form-data">
{{ form.hidden_tag() }}
<h3>1. Name release</h3>
{{ render_field(form.title, placeholder="Human readable. Eg: 1.0.0 or 2018-05-28") }}
<h3 class="mt-5">2. Set the content</h3>
<p class="mb-0">Method</p>
{{ render_radio_field(form.uploadOpt) }}
{% if package.repo %}
{{ render_field(form.vcsLabel, placeholder="Leave blank to use default branch", class_="mt-3",
pattern="[A-Za-z0-9/._-]+") }}
{% endif %}
{{ render_field(form.fileUpload, fieldclass="form-control-file", class_="mt-3", accept=".zip") }}
<p>
Take a look at the <a href="/help/package_config/">Package Configuration and Releases Guide</a> for
tips on customising releases.
</p>
<h3 class="mt-5">3. 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" style="color:#f00; display: none;">
Maximum must be greater than or equal to the minimum!
</p>
<p>
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>
You cannot select the oldest version for min or the newest version
for max as this does not make sense - you can't predict the future.
</p>
<p class="mt-5">
{{ render_submit_field(form.submit) }}
</p>
</form>
{% endblock %}
{% block scriptextra %}
<script src="/static/release_minmax.js?v=1"></script>
<script>
function check_opt() {
if ($("input[name=uploadOpt]:checked").val() == "vcs") {
$("#fileUpload").parent().hide();
$("#vcsLabel").parent().show();
} else {
$("#fileUpload").parent().show();
$("#vcsLabel").parent().hide();
}
}
$("input[name=uploadOpt]").change(check_opt);
check_opt();
</script>
{% endblock %}