contentdb/app/templates/collections/list.html

54 lines
1.6 KiB
HTML
Raw Normal View History

2023-08-14 22:48:50 +02:00
{% extends "base.html" %}
{% block title %}
{% if user %}
{{ _("%(author)s's collections", author=user.display_name) }}
{% else %}
{{ _("Collections") }}
{% endif %}
{% endblock %}
{% block author_link -%}
<a href="{{ url_for('users.profile', username=user.username) }}">
{{- user.display_name -}}
</a>
{%- endblock %}
{% block content %}
{% if user %}
{% if current_user == user or (current_user.is_authenticated and current_user.rank.at_least(current_user.rank.EDITOR)) %}
2023-08-22 20:58:43 +02:00
<a class="btn btn-primary float-end" href="{{ url_for('collections.create_edit', author=user.username) }}">
2023-08-14 22:48:50 +02:00
{{ _("Create") }}
</a>
{% endif %}
<h1>{{ _("%(author)s's collections", author=self.author_link()) }}</h1>
{% else %}
<h1>{{ _("Collections") }}</h1>
{% endif %}
<div class="list-group">
{% for collection in collections -%}
<a class="list-group-item list-group-item-action" href="{{ collection.get_url('collections.view') }}">
{% 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 %}
{% 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 user != collection.author %}
{{ _("%(title)s by %(author)s", title=collection.title, author=collection.author.display_name) }}
{% else %}
{{ collection.title }}
{% endif %}
2023-08-22 20:58:43 +02:00
<span class="text-muted ms-4">
2023-08-14 22:48:50 +02:00
{{ collection.short_description }}
</span>
</a>
{% else %}
<div class="list-group-item text-muted">
<i>{{ _("No collections") }}</i>
</div>
{% endfor %}
</div>
{% endblock %}