{% extends "base.html" %} {% block title %} {% if collection %} {{ _("Edit") }} - {{ collection.title }} {% else %} {{ _("New Collection") }} {% endif %} {% endblock %} {% block content %} {% from "macros/forms.html" import render_field, render_submit_field, render_checkbox_field %}
{{ render_submit_field(form.submit, class_="btn btn-primary float-right") }}

{{ self.title() }}

{{ form.hidden_tag() }} {{ render_field(form.title) }} {{ render_field(form.short_description) }} {{ render_checkbox_field(form.private, class_="my-3") }} {% if collection and collection.items %}

{{ _("Packages") }}

{{ _("To add or remove a package, go to the package's page and click 'Add to collection'") }}

{% for item in collection.items %} {% set package = item.package %}
{{ _("%(title)s by %(author)s", title=package.title, author=package.author.display_name) }}
{{ render_field(form.descriptions[loop.index - 1]) }} {{ form.package_ids[loop.index - 1]() }}
{% endfor %} {% endif %}
{{ render_submit_field(form.submit) }}
{% endblock %}