Bug fixes
This commit is contained in:
parent
7f533cc583
commit
bb118f6144
11 changed files with 123 additions and 82 deletions
20
Cargo.lock
generated
20
Cargo.lock
generated
|
|
@ -1356,6 +1356,25 @@ dependencies = [
|
|||
"wasm-bindgen",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "h2"
|
||||
version = "0.4.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5017294ff4bb30944501348f6f8e42e6ad28f42c8bbef7a74029aff064a4e3c2"
|
||||
dependencies = [
|
||||
"atomic-waker",
|
||||
"bytes",
|
||||
"fnv",
|
||||
"futures-core",
|
||||
"futures-sink",
|
||||
"http",
|
||||
"indexmap",
|
||||
"slab",
|
||||
"tokio",
|
||||
"tokio-util",
|
||||
"tracing",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "half"
|
||||
version = "2.5.0"
|
||||
|
|
@ -1507,6 +1526,7 @@ dependencies = [
|
|||
"bytes",
|
||||
"futures-channel",
|
||||
"futures-util",
|
||||
"h2",
|
||||
"http",
|
||||
"http-body",
|
||||
"httparse",
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ members = [".", "migration"]
|
|||
[dependencies]
|
||||
askama = { version = "0.13.0", features = ["serde_json"] }
|
||||
async-trait = "0.1.88"
|
||||
axum = { version = "0.8.3", features = ["multipart", "macros"] }
|
||||
axum = { version = "0.8.3", features = ["http2", "multipart", "macros"] }
|
||||
axum-extra = { version = "0.10.1", features = ["form"] }
|
||||
axum-login = "0.17.0"
|
||||
chrono = "0.4.40"
|
||||
|
|
|
|||
|
|
@ -6,13 +6,18 @@ Sam's small image board.
|
|||
|
||||
Still very much an early WIP.
|
||||
|
||||
### Known issues
|
||||
|
||||
- [ ] No way to close tag autocompletion on mobile
|
||||
|
||||
### Roadmap
|
||||
|
||||
- [ ] Favicon from post
|
||||
- [ ] Logging
|
||||
- [ ] Improved error handling
|
||||
- [ ] Bulk edit tag
|
||||
- [ ] Caching
|
||||
- [ ] Lossless compression
|
||||
- [ ] Bulk edit tags/Fix tag capitalization
|
||||
- [ ] User management
|
||||
- [ ] Cleanup/fixup background tasks
|
||||
- [ ] Text media
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
services:
|
||||
samey:
|
||||
image: badmanners/samey:latest
|
||||
build:
|
||||
context: .
|
||||
container_name: samey
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
|
|
|
|||
|
|
@ -1,7 +1,15 @@
|
|||
<form hx-put="/post_details/{{ post.id }}" hx-target="this" hx-swap="outerHTML">
|
||||
<article id="post-details">
|
||||
<form hx-put="/post_details/{{ post.id }}" hx-target="#post-details" hx-swap="outerHTML">
|
||||
<div>
|
||||
<label>Tags</label>
|
||||
{% let tags_value = tags %} {% include "fragments/tags_input.html" %}
|
||||
<div
|
||||
hx-trigger="keyup[key=='Escape'] from:previous .tags"
|
||||
hx-target="next .tags-autocomplete"
|
||||
hx-swap="innerHTML"
|
||||
hx-delete="/remove"
|
||||
hidden
|
||||
></div>
|
||||
<ul class="reset tags-autocomplete" id="search-autocomplete"></ul>
|
||||
</div>
|
||||
<div>
|
||||
|
|
@ -43,4 +51,5 @@
|
|||
<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>
|
||||
</div>
|
||||
</form>
|
||||
</article>
|
||||
|
|
@ -1,7 +1,6 @@
|
|||
<article id="post-details" hx-target="this" hx-swap="outerHTML">
|
||||
<article id="post-details">
|
||||
<h2>
|
||||
{% if let Some(title) = post.title %}{{ title }}{% else %}Details{%
|
||||
endif %}
|
||||
{% if let Some(title) = post.title %}{{ title }}{% else %}Details{% endif %}
|
||||
</h2>
|
||||
{% if let Some(description) = post.description %}
|
||||
<div id="description">{{ description | markdown }}</div>
|
||||
|
|
@ -9,16 +8,14 @@
|
|||
<table>
|
||||
<tr>
|
||||
<th>Is public post?</th>
|
||||
<td>
|
||||
{% if post.is_public %}Yes{% else %}No{% endif %}
|
||||
</td>
|
||||
<td>{% if post.is_public %}Yes{% else %}No{% endif %}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Rating</th>
|
||||
<td>
|
||||
{% match post.rating.as_ref() %} {% when "u" %} Unrated {% when "s" %} Safe
|
||||
{% when "q" %} Questionable {% when "e" %} Explicit {% else %} Unknown {%
|
||||
endmatch %}
|
||||
{% match post.rating.as_ref() %} {% when "u" %} Unrated {% when "s" %}
|
||||
Safe {% when "q" %} Questionable {% when "e" %} Explicit {% else %}
|
||||
Unknown {% endmatch %}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
|
@ -54,6 +51,12 @@
|
|||
</tr>
|
||||
</table>
|
||||
{% if can_edit %}
|
||||
<button hx-get="/post_details/{{ post.id }}/edit">Edit post</button>
|
||||
<button
|
||||
hx-get="/post_details/{{ post.id }}/edit"
|
||||
hx-target="#post-details"
|
||||
hx-swap="outerHTML"
|
||||
>
|
||||
Edit post
|
||||
</button>
|
||||
{% endif %}
|
||||
</div>
|
||||
</article>
|
||||
|
|
|
|||
|
|
@ -5,10 +5,11 @@
|
|||
name="tags"
|
||||
placeholder="Tags"
|
||||
hx-post="/search_tags"
|
||||
hx-trigger="input changed"
|
||||
hx-trigger="input changed delay:500ms"
|
||||
hx-target="next .tags-autocomplete"
|
||||
hx-vals="js:{selection_end: event.target.selectionEnd}"
|
||||
hx-on::after-settle="this.focus(); this.setSelectionRange(-1, -1);"
|
||||
hx-swap="innerHTML"
|
||||
hx-vals="js:{selection_end: document.querySelector('.tags').selectionEnd}"
|
||||
hx-on::after-settle="document.querySelector('.tags').focus(); document.querySelector('.tags').setSelectionRange(-1, -1);"
|
||||
value="{{ tags_value }}"
|
||||
aria-autocomplete="list"
|
||||
aria-controls="search-autocomplete"
|
||||
|
|
|
|||
|
|
@ -14,6 +14,13 @@
|
|||
<h2>Search</h2>
|
||||
<form method="get" action="/posts/1">
|
||||
{% let tags_value = "" %} {% include "fragments/tags_input.html" %}
|
||||
<div
|
||||
hx-trigger="keyup[key=='Escape'] from:previous .tags"
|
||||
hx-target="next .tags-autocomplete"
|
||||
hx-swap="innerHTML"
|
||||
hx-delete="/remove"
|
||||
hidden
|
||||
></div>
|
||||
<ul class="reset tags-autocomplete" id="search-autocomplete"></ul>
|
||||
<button type="submit">Search</button>
|
||||
</form>
|
||||
|
|
|
|||
|
|
@ -13,6 +13,13 @@
|
|||
<h2>Search</h2>
|
||||
<form method="get" action="/posts">
|
||||
{% let tags_value = tags_text.clone().unwrap_or("".into()) %} {% include "fragments/tags_input.html" %}
|
||||
<div
|
||||
hx-trigger="keyup[key=='Escape'] from:previous .tags"
|
||||
hx-target="next .tags-autocomplete"
|
||||
hx-swap="innerHTML"
|
||||
hx-delete="/remove"
|
||||
hidden
|
||||
></div>
|
||||
<ul class="reset tags-autocomplete" id="search-autocomplete"></ul>
|
||||
<button type="submit">Search</button>
|
||||
</form>
|
||||
|
|
|
|||
|
|
@ -13,6 +13,13 @@
|
|||
<h1>Upload media</h1>
|
||||
<form method="post" action="/upload" enctype="multipart/form-data">
|
||||
{% let tags_value = "" %} {% include "fragments/tags_input.html" %}
|
||||
<div
|
||||
hx-trigger="keyup[key=='Escape'] from:previous .tags"
|
||||
hx-target="next .tags-autocomplete"
|
||||
hx-swap="innerHTML"
|
||||
hx-delete="/remove"
|
||||
hidden
|
||||
></div>
|
||||
<ul class="reset tags-autocomplete" id="upload-autocomplete"></ul>
|
||||
<input
|
||||
type="file"
|
||||
|
|
|
|||
|
|
@ -29,26 +29,6 @@
|
|||
{% 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 %}">< To posts</a></div>
|
||||
<article>
|
||||
<h2>Search</h2>
|
||||
<form method="get" action="/posts">
|
||||
<input
|
||||
class="tags"
|
||||
type="text"
|
||||
id="search-tags"
|
||||
name="tags"
|
||||
placeholder="Tags"
|
||||
hx-post="/search_tags"
|
||||
hx-trigger="input changed"
|
||||
hx-target="next .tags-autocomplete"
|
||||
hx-vals="js:{selection_end: event.target.selectionEnd}"
|
||||
hx-on::after-settle="this.focus(); this.setSelectionRange(-1, -1);"
|
||||
value="{% if let Some(tags_text) = tags_text %}{{ tags_text }}{% endif %}"
|
||||
/>
|
||||
<ul class="reset tags-autocomplete" id="search-autocomplete"></ul>
|
||||
<button type="submit">Search</button>
|
||||
</form>
|
||||
</article>
|
||||
<article>
|
||||
<table>
|
||||
{% for item in pool_data %}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue