2018-03-20 03:58:31 +01:00
|
|
|
{% extends "base.html" %}
|
|
|
|
|
|
|
|
{% block title %}
|
2018-03-21 18:03:14 +01:00
|
|
|
{{ package.title or "Create Package" }}
|
2018-04-03 15:56:43 +02:00
|
|
|
{% if not package and author != current_user %}
|
|
|
|
for {{ author.display_name }}
|
|
|
|
{% endif %}
|
2018-03-20 03:58:31 +01:00
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
{% block content %}
|
2018-05-27 23:48:53 +02:00
|
|
|
<h1>Create Package</h1>
|
2018-05-18 05:06:27 +02:00
|
|
|
|
2018-05-27 21:15:35 +02:00
|
|
|
<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 %}
|
|
|
|
]
|
2018-05-27 22:31:11 +02:00
|
|
|
|
2018-05-27 22:33:50 +02:00
|
|
|
function escape(unsafe) {
|
|
|
|
return unsafe
|
|
|
|
.replace(/&/g, "&")
|
|
|
|
.replace(/</g, "<")
|
|
|
|
.replace(/>/g, ">")
|
|
|
|
.replace(/"/g, """)
|
|
|
|
.replace(/'/g, "'");
|
|
|
|
}
|
|
|
|
|
2018-05-27 22:31:11 +02:00
|
|
|
all_packages = meta_packages.slice();
|
|
|
|
|
|
|
|
{% for p in packages %}
|
|
|
|
all_packages.push({
|
|
|
|
id: "{{ p.author.username }}/{{ p.name }}",
|
2018-05-27 22:33:50 +02:00
|
|
|
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"); },
|
2018-05-27 22:31:11 +02:00
|
|
|
});
|
|
|
|
{% endfor %}
|
2018-05-27 21:15:35 +02:00
|
|
|
</script>
|
|
|
|
|
2018-05-27 22:31:11 +02:00
|
|
|
{% from "macros/forms.html" import render_field, render_submit_field, form_includes, render_multiselect_field, render_mpackage_field, render_deps_field %}
|
2018-05-25 17:53:25 +02:00
|
|
|
{{ form_includes() }}
|
|
|
|
|
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() }}
|
|
|
|
|
2018-05-27 23:48:53 +02:00
|
|
|
<h2 class="pkg_meta">Package</h2>
|
|
|
|
|
2018-05-27 23:51:50 +02:00
|
|
|
{{ render_field(form.type, class_="pkg_meta") }}
|
2018-05-18 05:06:27 +02:00
|
|
|
{{ 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") }}
|
2018-05-25 17:53:25 +02:00
|
|
|
{{ render_multiselect_field(form.tags, class_="pkg_meta") }}
|
2018-05-27 23:51:50 +02:00
|
|
|
{{ render_field(form.license, class_="pkg_meta") }}
|
2018-05-29 21:17:18 +02:00
|
|
|
{{ render_field(form.media_license, class_="pkg_meta") }}
|
2018-05-09 18:44:58 +02:00
|
|
|
|
2018-05-27 23:48:53 +02:00
|
|
|
<div class="pkg_meta">
|
|
|
|
<h2 class="not_txp">Dependency Info</h2>
|
|
|
|
|
2018-05-27 23:51:50 +02:00
|
|
|
{{ render_mpackage_field(form.provides_str, class_="not_txp", placeholder="Comma separated list") }}
|
|
|
|
{{ render_deps_field(form.harddep_str, class_="not_txp not_game", placeholder="Comma separated list") }}
|
|
|
|
{{ render_deps_field(form.softdep_str, class_="not_txp not_game", placeholder="Comma separated list") }}
|
|
|
|
</div>
|
2018-05-27 23:48:53 +02:00
|
|
|
|
|
|
|
<h2 class="pkg_meta">Repository and Links</h2>
|
|
|
|
|
2018-05-09 18:44:58 +02:00
|
|
|
<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>
|
|
|
|
|
2018-05-18 05:06:27 +02:00
|
|
|
{{ render_field(form.repo, class_="pkg_repo") }}
|
2018-05-09 18:44:58 +02:00
|
|
|
|
|
|
|
<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>
|
|
|
|
|
2018-05-18 05:06:27 +02:00
|
|
|
{{ 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>
|
2018-03-20 03:58:31 +01:00
|
|
|
</form>
|
2018-05-09 18:44:58 +02:00
|
|
|
|
2018-05-24 02:04:25 +02:00
|
|
|
{% if enable_wizard %}
|
2018-05-09 18:44:58 +02:00
|
|
|
<script src="/static/url.min.js"></script>
|
2018-05-11 16:29:26 +02:00
|
|
|
<script src="/static/polltask.js"></script>
|
2018-05-09 18:44:58 +02:00
|
|
|
<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 %}
|
2018-05-27 23:48:53 +02:00
|
|
|
<script src="/static/package_edit.js"></script>
|
2018-03-20 03:58:31 +01:00
|
|
|
{% endblock %}
|