mirror of
https://github.com/ae-utbm/sith.git
synced 2024-12-22 15:51:19 +00:00
Sli
655d72a2b1
* Migrate alpine * Migrate jquery and jquery-ui * Migrate shorten * Add babel for javascript * Introduce staticfiles django app * Only bundle -index.js files in static/webpack * Unify scss and webpack generated files * Convert scss calls to static * Add --clear-generated option to collectstatic * Fix docs warnings
85 lines
2.2 KiB
Django/Jinja
85 lines
2.2 KiB
Django/Jinja
{% extends "core/base.jinja" %}
|
|
|
|
{%- block additional_css -%}
|
|
<link rel="stylesheet" href="{{ static('sas/css/album.scss') }}">
|
|
{%- endblock -%}
|
|
|
|
{% block title %}
|
|
{% trans %}SAS{% endtrans %}
|
|
{% endblock %}
|
|
|
|
{% set is_sas_admin = user.is_root or user.is_in_group(pk=settings.SITH_GROUP_SAS_ADMIN_ID) %}
|
|
|
|
{% from "sas/macros.jinja" import display_album %}
|
|
|
|
{% 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 %}
|
|
{{ display_album(a, edit_mode=False) }}
|
|
{% endfor %}
|
|
</div>
|
|
|
|
<br>
|
|
|
|
{% 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 %}
|
|
{{ display_album(a, edit_mode=False) }}
|
|
{% endfor %}
|
|
</div>
|
|
|
|
{% 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>
|
|
{% endblock %}
|