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 .field
= label f, :spoilered_complex_str, "Complex Spoiler Filter" = label f, :spoilered_complex_str, "Complex Spoiler Filter"
br 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 br
= error_tag f, :spoilered_complex_str = error_tag f, :spoilered_complex_str
.fieldlabel .fieldlabel
@ -51,7 +51,7 @@
.field .field
= label f, :hidden_complex_str, "Complex Hide Filter" = label f, :hidden_complex_str, "Complex Hide Filter"
br 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 br
= error_tag f, :hidden_complex_str = error_tag f, :hidden_complex_str
.fieldlabel .fieldlabel

View file

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

View file

@ -1,7 +1,18 @@
h1 Search h1 Search
= form_for :search, ~p"/search", [id: "searchform", method: "get", class: "js-search-form", enforce_utf8: false], fn f -> = 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
.block__header.flex .block__header.flex

View file

@ -16,9 +16,8 @@ elixir:
placeholder="add a tag" placeholder="add a tag"
autocomplete="off" autocomplete="off"
autocapitalize="none" autocapitalize="none"
data-autocomplete="true" data-autocomplete="single-tag"
data-autocomplete-min-length="3" data-autocomplete-max-suggestions=5
data-autocomplete-source="/autocomplete/tags?term="
] ]
button.button.button--state-primary.button--bold[ button.button.button--state-primary.button--bold[
class="js-taginput-show" 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 -> = form_for :tags, ~p"/tags", [method: "get", class: "hform", enforce_utf8: false], fn f ->
.field .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" = submit "Search", class: "hform__button button"
.fieldlabel .fieldlabel
@ -31,7 +41,7 @@ h2 Search Results
.block.block--fixed.block--danger .block.block--fixed.block--danger
' Oops, there was an error parsing your query! Check for mistakes like mismatched parentheses. The error was: ' Oops, there was an error parsing your query! Check for mistakes like mismatched parentheses. The error was:
pre = assigns[:error] pre = assigns[:error]
- true -> - true ->
p p
' No tags found! ' No tags found!