Fixes and more styling

This commit is contained in:
Bad Manners 2025-04-13 11:00:36 -03:00
parent 2c44a69ec3
commit 3619063e68
21 changed files with 203 additions and 94 deletions

View file

@ -0,0 +1 @@
<h1 id="pool-title" hx-swap-oob="outerHTML">Pool - {{ pool_name }}</h1>

View file

@ -4,3 +4,4 @@
<link rel="stylesheet" href="/static/water.css" />
<link rel="stylesheet" href="/static/samey.css" />
<meta name="generator" content="Samey {{ env!("CARGO_PKG_VERSION") }}" />
<meta property="og:site_name" content="{{ application_name }}" />

View file

@ -2,7 +2,7 @@
<div>
<label>Tags</label>
{% let tags_value = tags %} {% include "fragments/tags_input.html" %}
<ul class="tags-autocomplete" id="search-autocomplete"></ul>
<ul class="reset tags-autocomplete" id="search-autocomplete"></ul>
</div>
<div>
<label>Title</label>
@ -32,14 +32,14 @@
{% include "fragments/post_source.html" %}
{% endfor %}
</ul>
<button hx-post="/post_source" hx-target="#sources" hx-swap="beforeend">+</button>
<button hx-post="/post_source" hx-target="#sources" hx-swap="beforeend">+ Add source</button>
</div>
<div>
<label>Parent post</label>
<input name="parent_post" type="text" pattern="[0-9]*" value="{% if let Some(parent_id) = post.parent_id %}{{ parent_id }}{% endif %}" />
<input name="parent_post" type="text" pattern="[0-9]*" value="{% if let Some(parent_id) = post.parent_id %}{{ parent_id }}{% endif %}" placeholder="Post ID" />
</div>
<div>
<button>Submit</button>
<button>Save changes</button>
<button hx-get="/post_details/{{ post.id }}">Cancel</button>
<button hx-confirm="Are you sure that you want to delete this post? This can't be undone!" hx-delete="/post/{{ post.id }}" hx-target="body" hx-replace-url="/">Delete post</button>
</div>

View file

@ -3,7 +3,7 @@
<span>No posts in pool.</span>
{% else %}
<ul
class="sortable"
class="reset flex sortable"
hx-put="/pool/{{ pool.id }}/sort"
hx-trigger="end"
hx-vals="js:{old_index: event.oldIndex, new_index: event.newIndex}"
@ -11,11 +11,13 @@
hx-swap="outerHTML"
>
{% for post in posts %}
<li class="pool-post">
<li class="pool-post flex flex-col">
<a href="/post/{{ post.id }}" title="{{ post.tags }}">
<img src="/files/{{ post.thumbnail }}" />
<div>{{ post.rating | upper }}</div>
<div>{{ post.media_type }}</div>
<div class="flex">
<div>{{ post.rating | upper }}</div>
<div>{{ post.media_type }}</div>
</div>
</a>
{% if can_edit %}
<button
@ -23,7 +25,7 @@
hx-target="closest .pool-post"
hx-swap="outerHTML"
>
Remove
Remove from pool
</button>
{% endif %}
</li>

View file

@ -51,6 +51,6 @@
{{ post.uploaded_at }}
</div>
{% if can_edit %}
<button hx-get="/post_details/{{ post.id }}/edit">Edit</button>
<button hx-get="/post_details/{{ post.id }}/edit">Edit post</button>
{% endif %}
</div>

View file

@ -6,6 +6,6 @@
value="{% if let Some(url) = source.url %}{{ url }}{% endif %}"
/>
<button hx-delete="/remove" hx-target="closest li" hx-swap="outerHTML">
-
Remove source
</button>
</li>

View file

@ -0,0 +1,7 @@
<a href="/post/{{ post.id }}" title="{{ post.tags }}">
<img src="/files/{{ post.thumbnail }}" />
<div class="flex">
<div>{{ post.rating | upper }}</div>
<div>{{ post.media_type }}</div>
</div>
</a>

View file

@ -1,2 +1,5 @@
{% include "fragments/tags_input.html" %}
<ul class="tags-autocomplete" hx-swap-oob="outerHTML:.tags-autocomplete"></ul>
<ul
class="reset tags-autocomplete"
hx-swap-oob="outerHTML:.tags-autocomplete"
></ul>

View file

@ -1,14 +1,19 @@
{% include "fragments/post_details.html" %} {% if let Some(parent_post) =
parent_post %}
<article id="parent-post" hx-swap-oob="outerHTML">
<h2>Parent</h2>
<a
href="/post/{{ parent_post.id }}"
title="{% if let Some(tags) = parent_post.tags %}{{ tags }}{% endif %}"
>
<img src="/files/{{ parent_post.thumbnail }}" />
<div>{{ parent_post.rating }}</div>
</a>
<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" hx-swap-oob="outerHTML" hidden></article>