album.jinja 1.12 KB
Newer Older
Skia's avatar
Skia committed
1
2
3
4
5
6
7
{% extends "core/base.jinja" %}

{% block title %}
{% trans %}SAS{% endtrans %}
{% endblock %}

{% block content %}
Skia's avatar
WIP SAS    
Skia committed
8
<h3>{{ album.get_display_name() }}</h3>
Skia's avatar
Skia committed
9
10
11
12
13
<form action="" method="post" enctype="multipart/form-data">
    {% csrf_token %}
    {{ form.as_p() }}
    <p><input type="submit" value="{% trans %}Upload{% endtrans %}" /></p>
</form>
Skia's avatar
Skia committed
14
<div>
Skia's avatar
WIP SAS    
Skia committed
15
    {% for a in album.children.filter(is_folder=True).all() %}
Skia's avatar
Skia committed
16
17
18
19
20
21
    <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>
Skia's avatar
WIP SAS    
Skia committed
22
23
24
25
    {# 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) %}
Skia's avatar
Skia committed
26
    <div style="display: inline-block; border: solid 1px black;">
Skia's avatar
WIP SAS    
Skia committed
27
28
        <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"/>
Skia's avatar
Skia committed
29
30
31
32
33
34
35
        </a>
    </div>
    {% endif %}
    {% endfor %}
</div>
{% endblock %}