Update the slime HTML templates with new data attributes

This commit is contained in:
MareStare 2025-03-04 04:58:35 +00:00
parent 696a2fd74a
commit b8b3ed5982
6 changed files with 34 additions and 12 deletions

View file

@ -26,7 +26,7 @@
.field
= label f, :spoilered_complex_str, "Complex Spoiler Filter"
br
= textarea f, :spoilered_complex_str, class: "input input--wide", autocapitalize: "none", data: [autocomplete: "true", autocomplete_min_length: 3, autocomplete_mode: "search"]
= textarea f, :spoilered_complex_str, class: "input input--wide", autocapitalize: "none", autocomplete: "off", data: [autocomplete: "multi-tags"]
br
= error_tag f, :spoilered_complex_str
.fieldlabel
@ -51,7 +51,7 @@
.field
= label f, :hidden_complex_str, "Complex Hide Filter"
br
= textarea f, :hidden_complex_str, class: "input input--wide", autocapitalize: "none", data: [autocomplete: "true", autocomplete_min_length: 3, autocomplete_mode: "search"]
= textarea f, :hidden_complex_str, class: "input input--wide", autocapitalize: "none", autocomplete: "off", data: [autocomplete: "multi-tags"]
br
= error_tag f, :hidden_complex_str
.fieldlabel

View file

@ -23,9 +23,11 @@ header.header
value=@conn.params["q"]
placeholder="Search"
autocapitalize="none"
data-autocomplete="true"
data-autocomplete-min-length="3"
data-autocomplete-mode="search"
autocomplete=if(@conn.cookies["enable_search_ac"], do: "on", else: "off")
inputmode="search"
data-autocomplete="multi-tags"
data-autocomplete-condition="enable_search_ac"
data-autocomplete-history-id="search-history"
]
= if present?(@conn.params["sf"]) do

View file

@ -10,7 +10,7 @@
' Artist Link validation is intended for artists. Validating your link will give you control over your content on the site, allowing you to create a
a> href="/commissions" commissions
' listing and request takedowns or DNPs. Do not request a link if the source contains no artwork which you have created.
= text_input f, :tag_name, value: assigns[:tag_name], class: "input", autocomplete: "off", placeholder: "artist:your-name", data: [autocomplete: "true", autocomplete_min_length: "3", autocomplete_source: "/autocomplete/tags?term="]
= text_input f, :tag_name, value: assigns[:tag_name], class: "input", autocomplete: "off", placeholder: "artist:your-name", data: [autocomplete: "single-tag"]
= error_tag f, :tag
.field

View file

@ -1,7 +1,18 @@
h1 Search
= form_for :search, ~p"/search", [id: "searchform", method: "get", class: "js-search-form", enforce_utf8: false], fn f ->
= text_input f, :q, class: "input input--wide js-search-field", placeholder: "Search terms are chained with commas", autocapitalize: "none", name: "q", value: @conn.params["q"], data: [autocomplete: "true", autocomplete_min_length: 3, autocomplete_mode: "search"]
= text_input f, :q, class: "input input--wide js-search-field",
placeholder: "Search terms are chained with commas",
autocapitalize: "none",
name: "q",
value: @conn.params["q"],
autocomplete: if(@conn.cookies["enable_search_ac"], do: "on", else: "off"),
inputmode: "search",
data: [ \
autocomplete: "multi-tags",
autocomplete_condition: "enable_search_ac",
autocomplete_history_id: "search-history",
]
.block
.block__header.flex

View file

@ -16,9 +16,8 @@ elixir:
placeholder="add a tag"
autocomplete="off"
autocapitalize="none"
data-autocomplete="true"
data-autocomplete-min-length="3"
data-autocomplete-source="/autocomplete/tags?term="
data-autocomplete="single-tag"
data-autocomplete-max-suggestions=5
]
button.button.button--state-primary.button--bold[
class="js-taginput-show"

View file

@ -2,7 +2,17 @@ h1 Tags
= form_for :tags, ~p"/tags", [method: "get", class: "hform", enforce_utf8: false], fn f ->
.field
= text_input f, :tq, name: :tq, value: @conn.params["tq"] || "*", class: "input hform__text", placeholder: "Search tags", autocapitalize: "none"
= text_input f, :tq, name: :tq, value: @conn.params["tq"] || "*",
class: "input hform__text",
placeholder: "Search tags",
autocapitalize: "none",
autocomplete: if(@conn.cookies["enable_search_ac"], do: "on", else: "off"),
inputmode: "search",
data: [ \
autocomplete: "multi-tags",
autocomplete_condition: "enable_search_ac",
]
= submit "Search", class: "hform__button button"
.fieldlabel
@ -31,7 +41,7 @@ h2 Search Results
.block.block--fixed.block--danger
' Oops, there was an error parsing your query! Check for mistakes like mismatched parentheses. The error was:
pre = assigns[:error]
- true ->
p
' No tags found!