samey/templates/pages/view_post.html

114 lines
5 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<title>Post #{{ post.id }} - {{ application_name }}</title>
<meta property="og:site_name" content="{{ application_name }}" />
{% include "fragments/common_headers.html" %}
{% if let Some(title) = post.title %}<meta property="og:title" content="{{ title }}"/>{% else %}<meta property="og:title" content="{{ tags_post }}" />{% endif %}
<meta property="og:url" content="/post/{{ post.id }}" />
{% if let Some(description) = description_plaintext %}<meta property="og:description" content="{{ description }}" />{% endif %}
{% match post.media_type.as_ref() %} {% when "image" %}
<meta property="og:image" content="/files/{{ post.media }}" />
<meta property="og:image:width" content="{{ post.width }}" />
<meta property="og:image:height" content="{{ post.height }}" />
<meta property="og:image:alt" content="{{ tags_post }}" />
<meta property="twitter:card" content="summary_large_image" />
{% if let Some(title) = post.title %}<meta property="twitter:title" content="{{ title }}"/>{% else %}<meta property="twitter:title" content="{{ tags_post }}" />{% endif %}
{% if let Some(description) = post.description %}<meta property="twitter:description" content="{{ description }}" />{% endif %}
<meta property="twitter:image" content="/files/{{ post.media }}" />
{% when "video" %}
<meta property="og:type" content="video.other" />
<meta property="og:video" content="/files/{{ post.media }}" />
<meta property="og:video:width" content="{{ post.width }}" />
<meta property="og:video:height" content="{{ post.height }}" />
<meta property="og:video:alt" content="{{ tags_post }}" />
<meta property="og:video:type" content="video/mp4" />
{% else %} {% endmatch %}
</head>
<body>
{% if age_confirmation %}{% include "fragments/age_restricted_check.html"
%}{% endif %}
<div><a href="{% if let Some(tags_text) = tags_text %}/posts/1?tags={{ tags_text.replace(' ', "+") }}{% else %}/posts/1{% endif %}">&lt; To posts</a></div>
<article>
<table>
{% for item in pool_data %}
<tr>
<td>
{% if let Some(previous_post_id) = item.previous_post_id %}
<a href="/post/{{ previous_post_id }}">&lt; Previous</a>
{% endif %}
</td>
<th>
<a href="/pool/{{ item.id }}">Pool: {{ item.name }}</a>
</th>
<td>
{% if let Some(next_post_id) = item.next_post_id %}
<a href="/post/{{ next_post_id }}">Next &gt;</a>
{% endif %}
</td>
</tr>
{% endfor %}
</table>
</article>
<main>
<h1>View post #{{ post.id }}</h1>
<div class="center-item" x-data="{ maximized: false, width: {{ post.width }}, height: {{ post.height }} }">
{% match post.media_type.as_ref() %}{% when "image" %}{% include
"fragments/get_image_media.html" %}{% when "video" %}{% include
"fragments/get_video_media.html" %}{% else %}{% endmatch %}
</div>
</main>
{% include "fragments/post_details.html" %}
{% if let Some(parent_post) = parent_post %}
<article id="parent-post">
<h2>Parent post</h2>
<div style="width: min-content">
<a href="/post/{{ parent_post.id }}" title="{% if let Some(tags) = parent_post.tags %}{{ tags }}{% endif %}">
<img src="/files/{{ parent_post.thumbnail }}" />
<div class="flex">
<div>{{ parent_post.rating | upper }}</div>
<div>{{ parent_post.media_type }}</div>
</div>
</a>
</div>
</article>
{% else %}
<article id="parent-post" hidden></article>
{% endif %} {% if !children_posts.is_empty() %}
<article>
<h2>Child posts</h2>
<ul class="flex reset">
{% for child_post in children_posts %}
<li>
<a href="/post/{{ child_post.id }}" title="{% if let Some(tags) = child_post.tags %}{{ tags }}{% endif %}">
<img src="/files/{{ child_post.thumbnail }}" />
<div class="flex">
<div>{{ child_post.rating | upper }}</div>
<div>{{ child_post.media_type }}</div>
</div>
</a>
</li>
{% endfor %}
</ul>
</article>
{% endif %}
<article id="tags-list">
<h2>Tags</h2>
{% if tags.is_empty() %}
<p>No tags in post. Consider adding some!</p>
{% else %}
<ul>
{% for tag in tags %}
<li>
{% if let Some(tags_text) = tags_text %}
<a href="/posts?tags={{ tags_text.replace(' ', "+") }}+{{ tag.name }}">+</a> <a href="/posts?tags={{ tags_text.replace(' ', "+") }}+-{{ tag.name }}">-</a> <a href="/posts?tags={{ tag.name }}">{{ tag.name }}</a>
{% else %}
<a href="/posts?tags={{ tag.name }}">+</a> <a href="/posts?tags=-{{ tag.name }}">-</a> <a href="/posts?tags={{ tag.name }}">{{ tag.name }}</a>
{% endif %}
</li>
{% endfor %}
</ul>
{% endif %}
</article>
</body>
</html>