]> git.lizzy.rs Git - cheatdb.git/blob - app/templates/packages/create_edit.html
3e9277eba18a75f5776eb9639df5428f66dcfa47
[cheatdb.git] / app / templates / packages / create_edit.html
1 {% extends "base.html" %}
2
3 {% block title %}
4         {{ package.title or "Create Package" }}
5         {% if not package and author != current_user %}
6                 for {{ author.display_name }}
7         {% endif %}
8 {% endblock %}
9
10 {% from "macros/forms.html" import render_field, render_submit_field, form_scripts, render_multiselect_field, render_mpackage_field, render_deps_field, package_lists %}
11
12 {% block scriptextra %}
13         {{ form_scripts() }}
14         {% if enable_wizard %}
15                 <script src="/static/url.min.js"></script>
16                 <script src="/static/polltask.js"></script>
17                 <script src="/static/package_create.js?v=3"></script>
18         {% endif %}
19         <script src="/static/package_edit.js?v=3"></script>
20 {% endblock %}
21
22 {% block content %}
23         <h1>{{ _("Create Package") }}</h1>
24
25         <div class="alert alert-info">
26                 <a class="float-right btn btn-sm btn-default" href="{{ url_for('flatpage', path='policy_and_guidance') }}">{{ _("View") }}</a>
27
28                 {{ _("Have you read the Package Inclusion Policy and Guidance yet?") }}
29         </div>
30
31         {% if package and package.checkPerm(current_user, "REIMPORT_META") and package.releases.first() %}
32                 <form class="alert alert-secondary mb-5" method="post" action="{{ package.getUpdateFromReleaseURL() }}">
33                         <input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
34                         <input class="btn btn-sm btn-warning float-right" type="submit" value="{{ _('Import') }}" />
35
36                         <b>{{ _("Reimport meta from latest release.") }}</b>
37                         {{ _("This will override 'provides', 'dependencies', and 'optional_dependencies'.") }}
38                         <div style="clear:both;"></div>
39                 </form>
40         {% endif %}
41
42         <noscript>
43                 <div class="alert alert-warning">
44                         {{ _("Javascript is needed to improve the user interface, and is needed for features
45                         such as finding metadata from git, and autocompletion.") }}<br />
46                         {{ _("Whilst disabled Javascript may work, it is not officially supported.") }}
47                 </div>
48         </noscript>
49
50         {{ package_lists() }}
51
52         <form method="POST" action="" class="tableform">
53                 {{ form.hidden_tag() }}
54
55                 <fieldset>
56                         <legend>{{ _("Package") }}</legend>
57
58                         <div class="row">
59                         {{ render_field(form.type, class_="pkg_meta col-sm-2") }}
60                         {{ render_field(form.title, class_="pkg_meta col-sm-7") }}
61                         {% if package and package.approved and not package.checkPerm(current_user, "CHANGE_NAME") %}
62                                 {{ render_field(form.name, class_="pkg_meta col-sm-3", readonly=True) }}
63                         {% else %}
64                                 {{ render_field(form.name, class_="pkg_meta col-sm-3", pattern="[a-z0-9_]+", title=_("Lower case letters (a-z), digits (0-9), and underscores (_) only")) }}
65                         {% endif %}
66                         </div>
67                         {{ render_field(form.short_desc, class_="pkg_meta") }}
68                         {{ render_multiselect_field(form.tags, class_="pkg_meta") }}
69                         <div class="pkg_meta row">
70                                 {{ render_field(form.license, class_="not_txp col-sm-6") }}
71                                 {{ render_field(form.media_license, class_="col-sm-6") }}
72                         </div>
73                         <div class="pkg_meta row">
74                                 <div class="not_txp col-sm-6"></div>
75                                 <div class="not_txp col-sm-6">{{ _("If there is no media, set the Media License to the same as the License.") }}</div>
76                         </div>
77                         {{ render_field(form.desc, class_="pkg_meta", fieldclass="form-control markdown") }}
78                 </fieldset>
79
80                 <fieldset class="pkg_meta">
81                         <legend class="not_txp">{{ _("Dependencies") }}</legend>
82
83                         {{ render_mpackage_field(form.provides_str, class_="not_txp", placeholder="Comma separated list") }}
84                         {{ render_deps_field(form.harddep_str, class_="not_txp not_game", placeholder="Comma separated list") }}
85                         {{ render_deps_field(form.softdep_str, class_="not_txp not_game", placeholder="Comma separated list") }}
86                 </fieldset>
87
88                 <fieldset>
89                         <legend class="pkg_meta">{{ _("Repository and Links") }}</legend>
90
91                         <div class="pkg_wiz_1">
92                                 <p>{{ _("Enter the repo URL for the package.
93                                 If the repo uses git then the metadata will be automatically imported.") }}</p>
94
95                                 <p>{{ _("Leave blank if you don't have a repo. Click skip if the import fails.") }}</p>
96                         </div>
97
98                         {{ render_field(form.repo, class_="pkg_repo") }}
99
100                         <div class="pkg_wiz_1">
101                                 <a id="pkg_wiz_1_next" class="btn btn-primary">{{ _("Next (Autoimport)") }}</a>
102                                 <a id="pkg_wiz_1_skip" class="btn btn-default">{{ _("Skip Autoimport") }}</a>
103                         </div>
104
105                         <div class="pkg_wiz_2">
106                                         {{ _("Importing... (This may take a while)") }}
107                         </div>
108
109                         {{ render_field(form.website, class_="pkg_meta") }}
110                         {{ render_field(form.issueTracker, class_="pkg_meta") }}
111                         {{ render_field(form.forums, class_="pkg_meta", placeholder=_("Tip: paste in a forum topic URL")) }}
112                 </fieldset>
113
114                 <div class="pkg_meta">{{ render_submit_field(form.submit) }}</div>
115         </form>
116 {% endblock %}