2016-10-26 17:21:19 +00:00
|
|
|
{% extends "core/base.jinja" %}
|
|
|
|
|
|
|
|
{% block title %}
|
|
|
|
{% trans %}SAS{% endtrans %}
|
|
|
|
{% endblock %}
|
|
|
|
|
2017-01-10 22:32:17 +00:00
|
|
|
{% macro display_album(a) %}
|
|
|
|
{% if a.is_moderated %}
|
|
|
|
<a href="{{ url("sas:album", album_id=a.id) }}">
|
|
|
|
<div class="album">
|
|
|
|
<div>
|
|
|
|
{% if a.file %}
|
2017-09-25 10:34:05 +00:00
|
|
|
<img src="{{ a.get_download_url() }}" alt="{% trans %}preview{% endtrans %}">
|
2017-01-10 22:32:17 +00:00
|
|
|
{% elif a.children.filter(is_folder=False, is_moderated=True).exists() %}
|
|
|
|
<img src="{{ a.children.filter(is_folder=False).first().as_picture.get_download_thumb_url() }}" alt="{% trans %}preview{% endtrans %}">
|
|
|
|
{% else %}
|
|
|
|
<img src="{{ static('core/img/sas.jpg') }}" alt="{% trans %}preview{% endtrans %}">
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
{{ a.name }}
|
|
|
|
</div>
|
|
|
|
</a>
|
|
|
|
{% elif user.is_in_group(settings.SITH_GROUP_SAS_ADMIN_ID) %}
|
|
|
|
<div style="display: inline-block; border: solid 1px red; text-align: center">
|
|
|
|
<p><a href="{{ url('core:file_moderate', file_id=a.id) }}?next={{ url('sas:moderation') }}">Moderate</a> or <a href="">Delete</a></p>
|
|
|
|
<a href="{{ url("sas:album", album_id=a.id) }}">{{ a.name }}</a>
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
{% endmacro %}
|
|
|
|
|
2016-10-26 17:21:19 +00:00
|
|
|
{% block content %}
|
|
|
|
<h3>{% trans %}SAS{% endtrans %}</h3>
|
2016-11-20 22:53:41 +00:00
|
|
|
<hr>
|
2017-01-10 22:32:17 +00:00
|
|
|
<h4>{% trans %}Latest albums{% endtrans %}</h4>
|
|
|
|
<div>
|
|
|
|
{% for a in latest %}
|
|
|
|
{{ display_album(a) }}
|
|
|
|
{% endfor %}
|
|
|
|
</div>
|
|
|
|
<hr>
|
|
|
|
<h4>{% trans %}All categories{% endtrans %}</h4>
|
2016-10-26 17:21:19 +00:00
|
|
|
<div>
|
2017-10-06 15:57:35 +00:00
|
|
|
{% for a in categories %}
|
2017-01-10 22:32:17 +00:00
|
|
|
{{ display_album(a) }}
|
2016-10-26 17:21:19 +00:00
|
|
|
{% endfor %}
|
|
|
|
</div>
|
2016-12-10 00:29:56 +00:00
|
|
|
{% if user.is_in_group(settings.SITH_GROUP_SAS_ADMIN_ID) %}
|
2016-11-20 22:53:41 +00:00
|
|
|
<form action="" method="post" enctype="multipart/form-data">
|
|
|
|
{% csrf_token %}
|
|
|
|
{{ form.non_field_errors() }}
|
|
|
|
<p>{{ form.album_name.errors }}<label for="{{ form.album_name.name }}">{{ form.album_name.label }}</label>
|
|
|
|
{{ form.album_name }}</p>
|
|
|
|
<p><input type="submit" value="{% trans %}Create{% endtrans %}" /></p>
|
|
|
|
</form>
|
|
|
|
{% endif %}
|
2016-10-26 17:21:19 +00:00
|
|
|
{% endblock %}
|