mirror of
https://github.com/minetest/contentdb.git
synced 2024-12-23 22:42:25 +01:00
97 lines
3.0 KiB
HTML
97 lines
3.0 KiB
HTML
{% extends "base.html" %}
|
|
|
|
{% block title %}
|
|
{{ package.title or "Create Package" }}
|
|
{% if not package and author != current_user %}
|
|
for {{ author.display_name }}
|
|
{% endif %}
|
|
{% endblock %}
|
|
|
|
{% block content %}
|
|
<h2>Create Package</h2>
|
|
|
|
<script>
|
|
meta_packages = [
|
|
{% for m in mpackages %}
|
|
{# This is safe as name can only contain `[a-z0-9_]` #}
|
|
{
|
|
id: "{{ m.name }}",
|
|
value: "{{ m.name }}",
|
|
toString: function() { return "{{ m.name }}"; },
|
|
},
|
|
{% endfor %}
|
|
]
|
|
|
|
function escape(unsafe) {
|
|
return unsafe
|
|
.replace(/&/g, "&")
|
|
.replace(/</g, "<")
|
|
.replace(/>/g, ">")
|
|
.replace(/"/g, """)
|
|
.replace(/'/g, "'");
|
|
}
|
|
|
|
all_packages = meta_packages.slice();
|
|
|
|
{% for p in packages %}
|
|
all_packages.push({
|
|
id: "{{ p.author.username }}/{{ p.name }}",
|
|
value: escape({{ p.title | tojson }} + " by " + {{ p.author.display_name | tojson }}),
|
|
toString: function() { return escape({{ p.title | tojson }} + " by " + {{ p.author.display_name | tojson }} + " only"); },
|
|
});
|
|
{% endfor %}
|
|
</script>
|
|
|
|
{% from "macros/forms.html" import render_field, render_submit_field, form_includes, render_multiselect_field, render_mpackage_field, render_deps_field %}
|
|
{{ form_includes() }}
|
|
|
|
<form method="POST" action="" class="tableform">
|
|
{{ form.hidden_tag() }}
|
|
|
|
{{ render_field(form.name, class_="pkg_meta") }}
|
|
{{ render_field(form.title, class_="pkg_meta") }}
|
|
{{ render_field(form.shortDesc, class_="pkg_meta") }}
|
|
{{ render_field(form.desc, class_="pkg_meta") }}
|
|
{{ render_field(form.type, class_="pkg_meta") }}
|
|
{{ render_field(form.license, class_="pkg_meta") }}
|
|
{{ render_mpackage_field(form.provides_str, class_="pkg_meta", placeholder="Comma separated list") }}
|
|
{{ render_deps_field(form.harddep_str, class_="pkg_meta", placeholder="Comma separated list") }}
|
|
{{ render_deps_field(form.softdep_str, class_="pkg_meta", placeholder="Comma separated list") }}
|
|
{{ render_multiselect_field(form.tags, class_="pkg_meta") }}
|
|
|
|
<div class="pkg_wiz_1">
|
|
<p>Enter the repo URL for the package.
|
|
If it's hosted on Github then metadata will automatically be imported.</p>
|
|
|
|
<p>Leave blank if you don't have a repo.</p>
|
|
</div>
|
|
|
|
{{ render_field(form.repo, class_="pkg_repo") }}
|
|
|
|
<div class="pkg_wiz_1">
|
|
<a id="pkg_wiz_1_next" class="button button-primary">Next</a>
|
|
</div>
|
|
|
|
<div class="pkg_wiz_2">
|
|
Importing...
|
|
</div>
|
|
|
|
{{ render_field(form.website, class_="pkg_meta") }}
|
|
{{ render_field(form.issueTracker, class_="pkg_meta") }}
|
|
{{ render_field(form.forums, class_="pkg_meta") }}
|
|
<div class="pkg_meta">{{ render_submit_field(form.submit) }}</div>
|
|
</form>
|
|
|
|
{% if enable_wizard %}
|
|
<script src="/static/url.min.js"></script>
|
|
<script src="/static/polltask.js"></script>
|
|
<script src="/static/package_create.js"></script>
|
|
<noscript>
|
|
<div class="box box_grey alert alert-warning">
|
|
<span class="icon_message"></span>
|
|
Javascript is needed to automatically import metadata from VCS.
|
|
</div>
|
|
</noscript>
|
|
{% endif %}
|
|
{% endblock %}
|