Sith/sas/templates/sas/album.jinja

35 lines
1.2 KiB
Plaintext
Raw Normal View History

2016-10-26 17:21:19 +00:00
{% extends "core/base.jinja" %}
{% block title %}
{% trans %}SAS{% endtrans %}
{% endblock %}
{% block content %}
2016-11-08 14:12:37 +00:00
<h3>{{ album.get_display_name() }}</h3>
2016-10-26 17:21:19 +00:00
<div>
2016-11-09 08:23:39 +00:00
{% for a in album.children.filter(is_folder=True, is_moderated=True).all() %}
2016-10-26 17:21:19 +00:00
<div style="display: inline-block; border: solid 1px black;">
<a href="{{ url("sas:album", album_id=a.id) }}">{{ a.name }}</a>
</div>
{% endfor %}
</div>
<div>
2016-11-08 14:12:37 +00:00
{# for a in album.children.filter(mime_type__in=['image/jpeg', 'image/png']).all() #}
2016-11-09 08:23:39 +00:00
{% for p in album.children.filter(is_folder=False, is_moderated=True).all() %}
2016-11-08 14:12:37 +00:00
{% if p.as_picture.can_be_viewed_by(user) %}
<div style="display: inline-block; border: solid 1px black; width: 9%; margin: 0.1%">
<a href="{{ url("sas:picture", picture_id=p.id) }}#pict">
<img src="{{ p.as_picture.get_download_url() }}" alt="{{ p.get_display_name() }}" style="max-width: 100%"/>
2016-10-26 17:21:19 +00:00
</a>
</div>
{% endif %}
{% endfor %}
</div>
<form action="" method="post" enctype="multipart/form-data">
{% csrf_token %}
{{ form.as_p() }}
<p><input type="submit" value="{% trans %}Upload{% endtrans %}" /></p>
</form>
2016-10-26 17:21:19 +00:00
{% endblock %}