]> git.lizzy.rs Git - cheatdb.git/blobdiff - app/templates/packages/create_edit.html
Add package inclusion policy and guidance
[cheatdb.git] / app / templates / packages / create_edit.html
index ee05940d0779e4d20b848670cf87a059168b4233..6cf23244b61ff0db4717f6021bd9bae46d7178a4 100644 (file)
 {% block content %}
        <h1>Create Package</h1>
 
-       <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, "&amp;")
-                               .replace(/</g, "&lt;")
-                               .replace(/>/g, "&gt;")
-                               .replace(/"/g, "&quot;")
-                               .replace(/'/g, "&#039;");
-               }
-
-               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 %}
+       <div class="box box_grey alert alert-info">
+               Have you read the Package Inclusion Policy and Guidance yet?
+
+               <a class="alert_right button" href="{{ url_for('flatpage', path='policy_and_guidance') }}">View</a>
+       </div>
+
+
+       {% from "macros/forms.html" import render_field, render_submit_field, form_includes, render_multiselect_field, render_mpackage_field, render_deps_field, package_lists %}
        {{ form_includes() }}
+       {{ package_lists() }}
 
        <form method="POST" action="" class="tableform">
                {{ form.hidden_tag() }}
@@ -56,7 +32,9 @@
                {{ render_field(form.shortDesc, class_="pkg_meta") }}
                {{ render_field(form.desc, class_="pkg_meta") }}
                {{ render_multiselect_field(form.tags, class_="pkg_meta") }}
-               {{ render_field(form.license, class_="pkg_meta") }}
+               <div class="pkg_meta">
+                       {{ render_field(form.license, class_="not_txp") }}
+               </div>
                {{ render_field(form.media_license, class_="pkg_meta") }}
 
                <div class="pkg_meta">