This commit is contained in:
Skia
2016-11-08 15:12:37 +01:00
parent 585ba55e5e
commit 5ea41de91d
2 changed files with 29 additions and 13 deletions

View File

@ -5,25 +5,27 @@
{% endblock %}
{% block content %}
<h3>{{ sithfile.get_display_name() }}</h3>
<h3>{{ album.get_display_name() }}</h3>
<form action="" method="post" enctype="multipart/form-data">
{% csrf_token %}
{{ form.as_p() }}
<p><input type="submit" value="{% trans %}Upload{% endtrans %}" /></p>
</form>
<div>
{% for a in sithfile.children.filter(is_folder=True).all() %}
{% for a in album.children.filter(is_folder=True).all() %}
<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>
{% for a in sithfile.children.filter(mime_type__in=['image/jpeg', 'image/png']).all() %}
{% if a.as_picture.can_be_viewed_by(user) %}
{# for a in album.children.filter(mime_type__in=['image/jpeg', 'image/png']).all() #}
{% for p in album.children.filter(is_folder=False).all() %}
<p>{{ p.name }}</p>
{% if p.as_picture.can_be_viewed_by(user) %}
<div style="display: inline-block; border: solid 1px black;">
<a href="{{ url("sas:picture", picture_id=a.id) }}">
<img src="{{ a.as_picture.get_download_url() }}" alt="{{ a.get_display_name() }}" style="width: 50px"/>
<a href="{{ url("sas:picture", picture_id=p.id) }}">
<img src="{{ p.as_picture.get_download_url() }}" alt="{{ p.get_display_name() }}" style="width: 50px"/>
</a>
</div>
{% endif %}