Sith/sas/templates/sas/main.jinja

85 lines
2.2 KiB
Django/Jinja
Raw Normal View History

2016-10-26 17:21:19 +00:00
{% extends "core/base.jinja" %}
{%- block additional_css -%}
<link rel="stylesheet" href="{{ static('sas/css/album.scss') }}">
{%- endblock -%}
2016-10-26 17:21:19 +00:00
{% block title %}
{% trans %}SAS{% endtrans %}
2016-10-26 17:21:19 +00:00
{% endblock %}
2024-08-08 15:51:33 +00:00
{% set is_sas_admin = user.is_root or user.is_in_group(pk=settings.SITH_GROUP_SAS_ADMIN_ID) %}
2024-08-08 15:51:33 +00:00
{% from "sas/macros.jinja" import display_album %}
2016-10-26 17:21:19 +00:00
{% block content %}
<main>
<h3>{% trans %}SAS{% endtrans %}</h3>
{% if not user.is_authenticated %}
<p>{% trans %}You must be logged in to see the SAS.{% endtrans %}</p>
{% else %}
<br>
<h4>{% trans %}Latest albums{% endtrans %}</h4>
<div class="albums">
{% for a in latest %}
2024-08-08 15:51:33 +00:00
{{ display_album(a, edit_mode=False) }}
{% endfor %}
</div>
<br>
2024-08-08 15:51:33 +00:00
{% if is_sas_admin %}
<form action="" method="post" enctype="multipart/form-data">
{% csrf_token %}
<div class="navbar">
<h4>{% trans %}All categories{% endtrans %}</h4>
</div>
{% if clipboard %}
<div class="clipboard">
{% trans %}Clipboard: {% endtrans %}
<ul>
{% for f in clipboard %}
<li>{{ f.get_full_path() }}</li>
{% endfor %}
</ul>
<input name="clear" type="submit" value="{% trans %}Clear clipboard{% endtrans %}">
</div>
{% endif %}
{% else %}
<h4>{% trans %}All categories{% endtrans %}</h4>
{% endif %}
<div class="albums">
{% for a in categories %}
2024-08-08 15:51:33 +00:00
{{ display_album(a, edit_mode=False) }}
{% endfor %}
</div>
2024-08-08 15:51:33 +00:00
{% if is_sas_admin %}
</form>
<br>
<form class="add-files" action="" method="post" enctype="multipart/form-data">
{% csrf_token %}
<div class="inputs">
<div>
<label for="{{ form.album_name.name }}">{{ form.album_name.label }}</label>
{{ form.album_name }}
</div>
<input type="submit" value="{% trans %}Create{% endtrans %}" />
</div>
{{ form.non_field_errors() }}
{{ form.album_name.errors }}
</form>
{% endif %}
{% endif %}
</main>
2016-10-26 17:21:19 +00:00
{% endblock %}