contentdb/app/templates/collections/package_add_to.html

50 lines
1.6 KiB
HTML
Raw Normal View History

2023-08-14 22:48:50 +02:00
{% extends "base.html" %}
{% block title %}
{{ _("Add %(package_title)s to a collection", package_title=package.title)}}
{% endblock %}
{% block content %}
2023-08-22 20:58:43 +02:00
<a href="{{ url_for('collections.create_edit', package=package.get_id()) }}" class="btn btn-primary float-end">
2023-08-14 22:48:50 +02:00
{{ _("Create Collection") }}
</a>
<h1>{{ self.title() }}</h1>
{% from "macros/forms.html" import render_field, render_submit_field, render_checkbox_field %}
<div class="list-group my-4">
{% for collection in collections %}
{% set active = package in collection.packages %}
<form method="POST" action="">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
<input type="hidden" name="collection" value="{{ collection.id }}" />
<button type="submit"
class="list-group-item list-group-item-action {% if active %}active{% endif %}">
{% if active %}
2023-08-22 20:58:43 +02:00
<i class="fas fa-check me-3 text-success"></i>
2023-08-14 22:48:50 +02:00
{% else %}
2023-08-22 20:58:43 +02:00
<i class="fas fa-square me-3 text-muted"></i>
2023-08-14 22:48:50 +02:00
{% endif -%}
{% if collection.author != current_user %}{{ collection.author.display_name }}: {% endif -%}
{% if collection.name == 'favorites' %}
2023-08-22 20:58:43 +02:00
<i class="fas fa-star me-1 text-info"></i>
2023-08-14 22:48:50 +02:00
{% endif %}
{% if collection.private %}
2023-08-22 20:58:43 +02:00
<i class="fas fa-lock me-1" style="color:#ffac33;"></i>
2023-08-14 22:48:50 +02:00
{% endif %}
{{ collection.title }}
</button>
</form>
{% else %}
<div class="list-group-item text-muted">
<i>{{ _("You don't have any collections") }}</i>
</div>
{% endfor %}
</div>
<p>
<a href="{{ package.get_url('packages.view') }}" class="btn btn-secondary">
{{ _("Done") }}
</a>
</p>
{% endblock %}