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

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

Skia's avatar
Skia committed
7
8
9
10
11
12
13
14
{% macro print_path(file) %}
{% if file %}
{{ print_path(file.parent) }}
<a href="{{ url('sas:album', album_id=file.id) }}">{{ file.get_display_name() }}</a> >
{% endif %}
{% endmacro %}


Skia's avatar
Skia committed
15
{% block content %}
Skia's avatar
Skia committed
16
{{ print_path(album.parent) }} {{ album.get_display_name() }}
Skia's avatar
WIP SAS  
Skia committed
17
<h3>{{ album.get_display_name() }}</h3>
Skia's avatar
Skia committed
18
<div>
Skia's avatar
Skia committed
19
    {% for a in album.children.filter(is_folder=True, is_moderated=True).all() %}
Skia's avatar
Skia committed
20
21
22
23
24
25
    <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
26
    {# for a in album.children.filter(mime_type__in=['image/jpeg', 'image/png']).all() #}
Skia's avatar
Skia committed
27
    {% for p in album.children.filter(is_folder=False, is_moderated=True).all() %}
Skia's avatar
WIP SAS  
Skia committed
28
    {% if p.as_picture.can_be_viewed_by(user) %}
29
30
    <div style="display: inline-block; border: solid 1px black; width: 9%; margin: 0.1%">
        <a href="{{ url("sas:picture", picture_id=p.id) }}#pict">
Skia's avatar
Skia committed
31
            <img src="{{ p.as_picture.get_download_thumb_url() }}" alt="{{ p.get_display_name() }}" style="max-width: 100%"/>
Skia's avatar
Skia committed
32
33
34
35
36
        </a>
    </div>
    {% endif %}
    {% endfor %}
</div>
37
38
39
40
41
<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
42
43
{% endblock %}