mirror of
https://github.com/minetest/contentdb.git
synced 2024-11-11 01:53:47 +01:00
48 lines
1.4 KiB
HTML
48 lines
1.4 KiB
HTML
|
{% 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 %}
|
||
|
<form method="POST" action="" enctype="multipart/form-data">
|
||
|
{{ render_submit_field(form.submit, class_="btn btn-primary float-right") }}
|
||
|
<h1>{{ self.title() }}</h1>
|
||
|
|
||
|
{{ 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 %}
|
||
|
<h2>{{ _("Packages") }}</h2>
|
||
|
<p class="text-muted">
|
||
|
{{ _("To add or remove a package, go to the package's page and click 'Add to collection'") }}
|
||
|
</p>
|
||
|
{% for item in collection.items %}
|
||
|
{% set package = item.package %}
|
||
|
<article class="card my-3">
|
||
|
<div class="card-body">
|
||
|
<h5>
|
||
|
<a href="{{ package.get_url('packages.view') }}" target="_blank">
|
||
|
{{ _("%(title)s by %(author)s", title=package.title, author=package.author.display_name) }}
|
||
|
</a>
|
||
|
</h5>
|
||
|
{{ render_field(form.descriptions[loop.index - 1]) }}
|
||
|
{{ form.package_ids[loop.index - 1]() }}
|
||
|
</div>
|
||
|
</article>
|
||
|
{% endfor %}
|
||
|
{% endif %}
|
||
|
|
||
|
<div class="mt-5">
|
||
|
{{ render_submit_field(form.submit) }}
|
||
|
</div>
|
||
|
</form>
|
||
|
{% endblock %}
|