2023-07-30 18:55:12 -04:00
{% load static %}
<!DOCTYPE html>
< html >
< head >
< meta name = "viewport" content = "width=device-width, height=device-height" / >
< title >
Folder: {{request.path}}
< / title >
< link href = "{% static 'css/styles.css' %}" rel = "stylesheet" >
< / head >
2023-08-21 21:20:27 -04:00
2023-07-30 18:55:12 -04:00
< body class = "background" >
2023-08-21 21:20:27 -04:00
<!-- Navigation bar. -->
2023-08-20 12:44:41 -04:00
< table class = "fc mauto" >
< tr >
2023-08-21 21:20:27 -04:00
<!-- Home button. -->
2023-08-20 12:44:41 -04:00
< td >
< a href = "/gallery/" class = "mr-2" >
< img src = "{% static 'imgs/gohome.png' %}" class = "small-nav-icon" >
< / a >
< / td >
2023-08-21 21:20:27 -04:00
<!-- Back button. -->
{% if not search %}
2023-08-20 12:44:41 -04:00
< td >
< a href = ".." class = "mr-2" >
< img src = "{% static 'imgs/back.png' %}" class = "small-nav-icon" >
< / a >
< / td >
2023-08-21 21:20:27 -04:00
{% endif %}
<!-- Directory path. -->
2023-08-20 12:44:41 -04:00
< td >
< h1 class = "mr-2" >
2023-08-21 21:20:27 -04:00
{% if not search %}
{{request.path}} - Files: {{num_files}}
{% else %}
Search: {{search_text}} - Files: {{num_files}}
{% endif %}
2023-08-20 12:44:41 -04:00
< / h1 >
< / td >
2023-08-21 21:20:27 -04:00
<!-- Page links. -->
2023-08-20 12:44:41 -04:00
{% if num_pages > 1 %}
< td >
2023-08-23 17:45:39 -04:00
< div class = "mauto mr-2" >
2023-08-21 21:20:27 -04:00
{% for page in pages %}< a href = "./?page={{page}}{%if search %}&{{search}}{% endif %}" > {{page}}< / a > {% if not forloop.last %}< span > < / span > {% endif %}{% endfor %}
2023-08-20 12:44:41 -04:00
< / div >
< / td >
{% endif %}
2023-08-23 17:45:39 -04:00
<!-- Logout button. -->
< td >
< form method = "post" action = "{% url 'logout' %}" >
{% csrf_token %}
< button type = "submit" class = "clear-btn" >
< img src = "{% static 'imgs/boot.png' %}" class = "small-nav-icon" >
< / button >
< / form >
< / td >
2023-08-20 12:44:41 -04:00
< / tr >
< / table >
2023-08-21 21:20:27 -04:00
<!-- Search form. -->
{% if not search %}
< form action = "{% url 'gallery_view_root' %}" method = "GET" >
2023-08-19 23:37:19 -04:00
< table class = "fc mauto" >
< tr >
2023-08-21 21:20:27 -04:00
<!-- Search title. -->
< td >
< h3 >
Search:
< / h3 >
2023-08-19 23:37:19 -04:00
< / td >
2023-08-21 21:20:27 -04:00
<!-- Search bar. -->
< td >
2023-08-23 16:53:06 -04:00
< input type = "search" name = "search" class = "search-box" >
2023-08-19 23:37:19 -04:00
< / td >
2023-08-21 21:20:27 -04:00
<!-- Search submit. -->
< td >
2023-08-23 17:45:39 -04:00
< button type = "submit" class = "clear-btn" >
2023-08-21 21:20:27 -04:00
< img src = "{% static 'imgs/find.png' %}" class = "small-nav-icon" >
< / button >
2023-08-19 23:37:19 -04:00
< / td >
< / tr >
2023-07-30 21:18:36 -04:00
< / table >
2023-08-21 21:20:27 -04:00
< / form >
{% endif %}
<!-- Images in current directory. -->
{% if images|length > 0 %}
< table class = "fc mauto" >
< tr >
<!-- Previous page button. -->
{% if page != 1 %}
< td class = "fc" >
< a href = "./?page={{prev_page}}{%if search %}&{{search}}{% endif %}" >
< img src = "{% static 'imgs/back.png' %}" class = "navigation-icon" >
< / a >
< / td >
{% endif %}
<!-- Image rows. -->
< td class = "fc" >
< table class = "mauto" >
< tbody >
{% for row in images %}
< tr >
{% for image in row %}
< td class = "column" >
< a href = "{{image.path}}" >
<!-- Thumbnail. -->
< img src = "{{image.thumbnail}}" >
< br >
<!-- Image name. -->
< span >
{{image.name|truncatechars:15}}
< / span >
< / a >
< / td >
{% endfor %}
< / tr >
{% endfor %}
< / tbody >
< / table >
< / td >
<!-- Next page button. -->
{% if page != num_pages %}
< td class = "fc" >
< a href = "./?page={{next_page}}{%if search %}&{{search}}{% endif %}" >
< img src = "{% static 'imgs/forward.png' %}" class = "navigation-icon" >
< / a >
< / td >
{% endif %}
< / tr >
< / table >
2023-07-30 18:55:12 -04:00
{% endif %}
2023-08-21 21:20:27 -04:00
2023-07-30 18:55:12 -04:00
{% if subdirs|length > 0 %}
2023-08-21 21:20:27 -04:00
<!-- Sub - directories title. -->
2023-07-30 18:55:12 -04:00
< div class = "centered-container" >
< h1 >
Sub-directories
< / h1 >
< / div >
2023-08-21 21:20:27 -04:00
<!-- Sub - directory rows. -->
2023-07-30 21:18:36 -04:00
< div class = "centered-container" >
< table class = "mauto" >
< tbody >
{% for row in subdirs %}
< tr >
2023-08-21 21:20:27 -04:00
{% for subdir in row %}
2023-07-30 21:18:36 -04:00
< td class = "column" >
2023-08-21 21:20:27 -04:00
< a href = "{{subdir.path}}" >
2023-07-30 21:18:36 -04:00
< img src = "{% static 'imgs/folder-pictures.png' %}" >
< br >
< span >
2023-08-21 21:20:27 -04:00
{{subdir.name}}
2023-07-30 21:18:36 -04:00
< / span >
< / a >
< / td >
{% endfor %}
< / tr >
{% endfor %}
< / tbody >
< / table >
2023-07-30 18:55:12 -04:00
< / div >
{% endif %}
< / body >
< / html >