contentdb/app/templates/packages/create_edit.html

126 lines
4.7 KiB
HTML
Raw Normal View History

2021-05-04 04:15:26 +02:00
{% extends "packages/package_base.html" %}
2018-03-20 03:58:31 +01:00
{% block title %}
2021-05-04 04:15:26 +02:00
{% if package %}
{{ _("Edit - %(title)s", title=package.title) }}
{% if not package and author != current_user %}
for {{ author.display_name }}
{% endif %}
{% else %}
{{ _("Create Package") }}
{% endif %}
2018-03-20 03:58:31 +01:00
{% endblock %}
2020-12-10 00:59:31 +01:00
{% from "macros/forms.html" import render_field, render_field_prefix_button, render_submit_field, form_scripts,
2021-02-05 17:19:34 +01:00
render_multiselect_field, package_lists %}
2018-12-22 12:23:58 +01:00
{% block scriptextra %}
{{ form_scripts() }}
{% if enable_wizard %}
2023-08-26 14:08:11 +02:00
<script src="/static/js/polltask.js"></script>
<script src="/static/js/package_create.js"></script>
2018-12-22 12:23:58 +01:00
{% endif %}
2023-08-26 14:08:11 +02:00
<script src="/static/js/package_edit.js"></script>
2018-12-22 12:23:58 +01:00
{% endblock %}
2018-03-20 03:58:31 +01:00
{% block content %}
2021-05-04 22:52:43 +02:00
{% if package %}
<h2 class="mt-0">{{ _("Edit Details") }}</h2>
{% else %}
<h2 class="mt-0">
{{ _("Create Package") }}
{% if author != current_user %}
for {{ author.display_name }}
{% endif %}
</h2>
{% endif %}
2021-05-04 04:15:26 +02:00
{% if not package %}
<div class="alert alert-info">
2023-08-22 20:58:43 +02:00
<a class="float-end btn btn-sm btn-default" href="{{ url_for('flatpage', path='policy_and_guidance') }}">{{ _("View") }}</a>
2021-05-04 04:15:26 +02:00
{{ _("Have you read the Package Inclusion Policy and Guidance yet?") }}
</div>
{% else %}
2021-02-05 16:29:44 +01:00
<div class="alert alert-secondary">
2023-08-22 20:58:43 +02:00
<a class="float-end btn btn-sm btn-default" href="/help/package_config/#cdbjson">{{ _("Read more") }}</a>
2021-02-05 16:29:44 +01:00
2022-01-14 19:25:28 +01:00
{{ _("You can include a .cdb.json file in your %(type)s to update these details automatically.", type=package.type.text.lower()) }}
2021-02-05 16:29:44 +01:00
</div>
{% endif %}
2018-12-29 19:41:09 +01:00
<noscript>
<div class="alert alert-warning">
{{ _("JavaScript is needed to improve the user interface, and is needed for features
such as finding metadata from git, and autocompletion.") }}
2018-12-29 19:41:09 +01:00
</div>
</noscript>
2018-05-27 22:31:11 +02:00
2018-05-29 21:51:42 +02:00
{{ package_lists() }}
2018-05-18 05:06:27 +02:00
<form method="POST" action="" class="tableform">
2018-03-20 03:58:31 +01:00
{{ form.hidden_tag() }}
<fieldset class="pkg_meta">
2019-07-29 22:44:39 +02:00
<legend>{{ _("Package") }}</legend>
2018-12-22 12:23:58 +01:00
2018-12-29 20:06:17 +01:00
<div class="row">
{{ render_field(form.type, class_="pkg_meta col-sm-3") }}
{{ render_field(form.title, class_="pkg_meta col-sm-5") }}
{% if package and package.approved and not package.check_perm(current_user, "CHANGE_NAME") %}
{{ render_field(form.name, class_="pkg_meta col-sm-4",
2023-10-15 23:13:35 +02:00
readonly=True, hint=_("You need to unpublish the package to change the name.")) }}
2019-07-29 22:03:04 +02:00
{% else %}
{{ render_field(form.name, class_="pkg_meta col-sm-4", pattern="[a-z0-9_]+", title=_("Lower case letters (a-z), digits (0-9), and underscores (_) only")) }}
2019-07-29 22:03:04 +02:00
{% endif %}
2018-12-29 20:06:17 +01:00
</div>
2019-01-29 04:00:01 +01:00
{{ render_field(form.short_desc, class_="pkg_meta") }}
2021-12-20 22:07:12 +01:00
{{ render_field(form.dev_state, class_="pkg_meta", hint=_("Please choose 'Work in Progress' if your package is unstable, and shouldn't be recommended to all players")) }}
2018-12-22 12:23:58 +01:00
{{ render_multiselect_field(form.tags, class_="pkg_meta") }}
2020-07-17 21:48:51 +02:00
{{ render_multiselect_field(form.content_warnings, class_="pkg_meta") }}
2018-12-29 20:06:17 +01:00
<div class="pkg_meta row">
{{ render_field(form.license, class_="not_txp col-sm-6") }}
{{ render_field(form.media_license, class_="col-sm-6", hint=_("If there is no media, set the Media License to the same as the License.")) }}
</div>
2018-12-29 20:06:17 +01:00
{{ render_field(form.desc, class_="pkg_meta", fieldclass="form-control markdown") }}
2018-12-22 12:23:58 +01:00
</fieldset>
<fieldset class="mt-4">
2019-07-29 22:44:39 +02:00
<legend class="pkg_meta">{{ _("Repository and Links") }}</legend>
<div class="pkg_wiz_1 d-none">
<h3>{{ _("Do you have a Git repository?") }}</h3>
<p>
<strong>{{ _("Having a repository is optional") }}.</strong>
</p>
<p>
{{ _("If you do have a repository, enter the URL below. Otherwise, leave blank and click skip.") }}
</p>
2018-12-22 12:23:58 +01:00
</div>
{{ render_field(form.website, class_="pkg_meta") }}
{{ render_field(form.repo, class_="pkg_repo", hint=_("HTTP URL to a Git, Mercurial, or other repository")) }}
<div class="pkg_wiz_1 d-none">
2019-07-29 22:44:39 +02:00
<a id="pkg_wiz_1_next" class="btn btn-primary">{{ _("Next (Autoimport)") }}</a>
2023-10-31 19:46:49 +01:00
<a id="pkg_wiz_1_skip" class="btn btn-secondary ms-2">{{ _("Skip") }}</a>
2018-12-22 12:23:58 +01:00
</div>
<div class="pkg_wiz_2 d-none">
2019-07-29 22:44:39 +02:00
{{ _("Importing... (This may take a while)") }}
2018-12-22 12:23:58 +01:00
</div>
{{ render_field(form.issueTracker, class_="pkg_meta", hint=_("Where should users report issues?")) }}
2020-12-10 00:59:31 +01:00
{{ render_field_prefix_button(form.forums, class_="pkg_meta",
pattern="[0-9]+",
prefix="forum.minetest.net/viewtopic.php?t=",
placeholder=_("Paste a forum topic URL"),
2023-08-16 01:52:10 +02:00
has_view=True) }}
{{ render_field(form.video_url, class_="pkg_meta", hint=_("YouTube videos will be shown in an embed.")) }}
2023-03-05 19:13:07 +01:00
{{ render_field(form.donate_url, class_="pkg_meta", hint=_("If blank, the author's donation URL will be used instead.")) }}
2018-12-22 12:23:58 +01:00
</fieldset>
2018-09-15 00:10:30 +02:00
2020-12-10 00:59:31 +01:00
<div class="pkg_meta mt-5">{{ render_submit_field(form.submit) }}</div>
2018-12-22 12:23:58 +01:00
</form>
2018-03-20 03:58:31 +01:00
{% endblock %}