feat(templates): 🎨 adjust templates to fit the new rendering data format

This commit is contained in:
David Bailey 2024-12-09 10:53:05 +01:00
parent 9a5b9e609e
commit 9de4838081
7 changed files with 47 additions and 110 deletions

View file

@ -1,43 +0,0 @@
{% extends "pathed_content.html" %}
{% block extra_head %}
<link rel="stylesheet" href="/static/directorystyle.css">
{%endblock%}
{%block content_article%}
{% if subposts|length > 0 %}
<h3>Directory contents:</h3>
<table class="directory">
<tr>
<th></th>
<th class="hsmol_hide">Name</th>
<th>Title</th>
<th class="entry_update_time hsmol_hide">Modified</th>
</tr>
{% for subpost in subposts %}
<tr class="entry">
<td>
{{ fa[subpost.post_metadata.icon] | raw }}
</td>
<td class="hsmol_hide">
<a href={{subpost.post_path}}>{{subpost.post_basename}}</a>
</td>
<td class="entry_title">
<a href={{subpost.post_path}}>{{ subpost.post_metadata.title }}</a>
</td>
<td class="entry_update_time hsmol_hide">
{{ subpost.post_update_time }}
</td>
</tr>
{% endfor %}
</table>
{%else%}
<h4>This directory appears to be empty...</h4>
<span>This shouldn't happen, sorry!</span>
{% endif %}
{{ content_html|raw }}
{%endblock%}

View file

@ -1,59 +0,0 @@
{% extends "pathed_content.html" %}
{% block extra_head %}
<link rel="stylesheet" href="/static/directorystyle.css">
<link rel="stylesheet" href="/static/gallerystyle.css">
{%endblock%}
{%block content_article%}
{% if subposts|length > 0 %}
<table class="directory">
<h3>Art Subfolders:</h3>
<tr>
<th></th>
<th class="hsmol_hide">Name</th>
<th>Title</th>
<th class="entry_update_time hsmol_hide">Modified</th>
</tr>
{% for subpost in subposts %}
<tr class="entry">
<td>
{{ fa[subpost.post_metadata.icon] | raw }}
</td>
<td class="hsmol_hide">
<a href={{subpost.post_path}}>{{subpost.post_basename}}</a>
</td>
<td class="entry_title">
<a href={{subpost.post_path}}>{{ subpost.post_metadata.title }}</a>
</td>
<td class="entry_update_time hsmol_hide">
{{ subpost.post_update_time }}
</td>
</tr>
{% endfor %}
</table>
{% endif %}
{{ content_html|raw }}
{% if gallery_images|length > 0 %}
<ul class="gallery">
{% for post in gallery_images %}
<li class="entry">
<a href={{post.post_path}}>
<figure>
<img src="{{post.post_metadata.media_file}}">
<figcaption>
{{ post.post_metadata.title }}
</figcaption>
</figure>
</a>
</li>
{% endfor %}
</ul>
{%else%}
<h4>How sad. There are no images yet... What a real shame :c </h4>
{% endif %}
{%endblock%}

View file

@ -0,0 +1,13 @@
{% extends "pathed_content.html" %}
{% block extra_head %}
<link rel="stylesheet" href="/static/directorystyle.css">
{%endblock%}
{%block content_article%}
{{ include('fragments/directory/inline.html') }}
{{ content_html|raw }}
{%endblock%}

View file

@ -0,0 +1,27 @@
{% extends "pathed_content.html" %}
{%block content_article%}
{{ include('fragments/directory/inline.html') }}
{{ content_html|raw }}
{% if search_results|length > 0 %}
<ul class="gallery">
{% for post in search_results %}
<li class="entry">
<a href={{post.path}}>
<figure>
<img src="{{post.media_preview_url}}">
<figcaption>
{{ post.title }}
</figcaption>
</figure>
</a>
</li>
{% endfor %}
</ul>
{%else%}
<h4>How sad. There are no images yet... What a real shame :c </h4>
{% endif %}
{%endblock%}

View file

@ -1,5 +1,4 @@
{% extends "pathed_content.html" %}
{% block extra_head %}
@ -14,12 +13,12 @@
{%block content_article%}
<figure>
<a target="_blank" href="{{post.post_metadata.media_file}}">
<img id="gallery_image" src="{{post.post_metadata.media_file}}"></img>
<a target="_blank" href="{{page.media_url}}">
<img id="gallery_image" src="{{page.media_url}}"></img>
</a>
<figcaption>
{{ content_html|raw }}
{{ page.html|raw }}
</figcaption>
</figure>
{%endblock%}

View file

@ -8,10 +8,10 @@
{%block main_content%}
<article>
<form method="post" enctype="multipart/form-data" action="/api/admin/upload">
<input type="text" id="post_path" name="post_path"/>
<input type="password" id="api_key" name="api_key"/>
<input type="file" id="post_data" name="post_data"/>
<form method="post" enctype="multipart/form-data" action="/api/upload">
<input type="text" id="path" name="path"/>
<input type="password" id="ACCESS_KEY" name="ACCESS_KEY"/>
<input type="file" id="file" name="file"/>
<button>Submit</button>
</form>