diff --git a/Cargo.lock b/Cargo.lock index 7ab3fce..11814b9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -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", diff --git a/Cargo.toml b/Cargo.toml index 3694c23..b3b7bac 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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" diff --git a/README.md b/README.md index 2499066..57d65d8 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/docker-compose.yml b/docker-compose.yml index 9fb11e0..eb37c5a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,6 +1,8 @@ services: samey: image: badmanners/samey:latest + build: + context: . container_name: samey restart: unless-stopped ports: diff --git a/templates/fragments/edit_post_details.html b/templates/fragments/edit_post_details.html index 6fdf1ed..64f6616 100644 --- a/templates/fragments/edit_post_details.html +++ b/templates/fragments/edit_post_details.html @@ -1,46 +1,55 @@ -
-
- - {% let tags_value = tags %} {% include "fragments/tags_input.html" %} - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - - -
-
- - -
-
- - - -
- +
+ +
+ + {% let tags_value = tags %} {% include "fragments/tags_input.html" %} + +
    +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + +
      + {% for source in sources %} + {% include "fragments/post_source.html" %} + {% endfor %} +
    + +
    +
    + + +
    +
    + + + +
    + +
    \ No newline at end of file diff --git a/templates/fragments/post_details.html b/templates/fragments/post_details.html index 1283837..6aaa7b3 100644 --- a/templates/fragments/post_details.html +++ b/templates/fragments/post_details.html @@ -1,7 +1,6 @@ -
    +

    - {% if let Some(title) = post.title %}{{ title }}{% else %}Details{% - endif %} + {% if let Some(title) = post.title %}{{ title }}{% else %}Details{% endif %}

    {% if let Some(description) = post.description %}
    {{ description | markdown }}
    @@ -9,16 +8,14 @@ - + @@ -54,6 +51,12 @@
    Is public post? - {% if post.is_public %}Yes{% else %}No{% endif %} - {% if post.is_public %}Yes{% else %}No{% endif %}
    Rating - {% 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 %}
    {% if can_edit %} - + {% endif %} - +
    diff --git a/templates/fragments/tags_input.html b/templates/fragments/tags_input.html index 4fd09d9..4c6ad96 100644 --- a/templates/fragments/tags_input.html +++ b/templates/fragments/tags_input.html @@ -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" diff --git a/templates/pages/index.html b/templates/pages/index.html index 407bebc..a69c25f 100644 --- a/templates/pages/index.html +++ b/templates/pages/index.html @@ -14,6 +14,13 @@

    Search

    {% let tags_value = "" %} {% include "fragments/tags_input.html" %} +
    diff --git a/templates/pages/posts.html b/templates/pages/posts.html index e89c4b8..4e448c3 100644 --- a/templates/pages/posts.html +++ b/templates/pages/posts.html @@ -13,6 +13,13 @@

    Search

    {% let tags_value = tags_text.clone().unwrap_or("".into()) %} {% include "fragments/tags_input.html" %} +
    diff --git a/templates/pages/upload.html b/templates/pages/upload.html index f6533a6..e3853d2 100644 --- a/templates/pages/upload.html +++ b/templates/pages/upload.html @@ -13,6 +13,13 @@

    Upload media

    {% let tags_value = "" %} {% include "fragments/tags_input.html" %} + < To posts -
    -

    Search

    - - -
      - - -
      {% for item in pool_data %}