Add remaining settings UI improvements to the local settings tab

This commit is contained in:
MareStare 2025-03-25 00:55:57 +00:00
parent 6ae0c27c11
commit b4f25790ed

View file

@ -206,58 +206,90 @@ h1 Content Settings
.block__tab class=local_tab_class(@conn) data-tab="local"
.block.block--fixed.block--warning Settings on this tab are saved in the current browser. They are independent of your login.
= field_with_help( \
"Use high quality thumbnails on displays with a high pixel density. " <> \
"Requires more data than regular thumbnails.", \
[ \
checkbox(f, :hidpi, checked: @conn.cookies["hidpi"] == "true"), \
label(f, :hidpi, "Serve HiDPI thumbnails"), \
] \
)
= field_with_help( \
"Serve WebM/MP4 versions of GIF images when available. Good for " <> \
"lower-bandwidth connections, but the video versions may have missing " <> \
"start/end frames, and don't support transparency.", \
[ \
checkbox(f, :serve_webm, checked: @conn.cookies["serve_webm"] == "true"), \
label(f, :serve_webm, "Serve WebM"), \
] \
)
= field_with_help( \
"Use video thumbnails for WebM videos. Does not apply to GIF images.", \
[ \
checkbox(f, :webm, checked: @conn.cookies["webm"] == "true"), \
label(f, :webm, "Use video thumbnails"), \
] \
)
= field_with_help( \
"Automatically enable audio on video pages when they are loaded.", \
[ \
checkbox(f, :unmute_videos, checked: @conn.cookies["unmute_videos"] == "true"), \
label(f, :unmute_videos, "Enable video audio by default"), \
] \
)
= field_with_help( \
"Hide the uploader and date posted information on image pages.", \
[ \
checkbox(f, :hide_uploader, checked: @conn.cookies["hide_uploader"] == "true"), \
label(f, :hide_uploader), \
] \
)
= field_with_help( \
"Don't attempt to filter tag suggestions using your current filter.", \
[ \
checkbox(f, :unfilter_tag_suggestions, checked: @conn.cookies["unfilter_tag_suggestions"] == "true"), \
label(f, :unfilter_tag_suggestions), \
] \
)
= field_with_help( \
"Hide score information for images.", \
[ \
checkbox(f, :hide_score, checked: @conn.cookies["hide_score"] == "true"), \
label(f, :hide_score), \
] \
)
= field_with_help( \
"Show streams marked as NSFW on the channels page.", \
[ \
checkbox(f, :chan_nsfw, checked: @conn.cookies["chan_nsfw"] == "true"), \
label(f, :chan_nsfw, "Show NSFW channels"), \
] \
)
.field
=> label f, :hidpi, "Serve HiDPI thumbnails"
=> checkbox f, :hidpi, checked: @conn.cookies["hidpi"] == "true"
.fieldlabel: i Use high quality thumbnails on displays with a high pixel density. Requires more data than regular thumbnails.
.field
=> label f, :serve_webm, "Serve WebM"
=> checkbox f, :serve_webm, checked: @conn.cookies["serve_webm"] == "true"
.fieldlabel: i Serve WebM/MP4 versions of GIF images when available. Good for lower-bandwidth connections, but the video versions may have missing start/end frames, and do not support transparency.
.field
=> label f, :webm, "Use video thumbnails"
=> checkbox f, :webm, checked: @conn.cookies["webm"] == "true"
.fieldlabel: i Use video thumbnails for WebM videos. Does not apply to GIF images.
.field
=> label f, :unmute_videos, "Enable video audio by default"
=> checkbox f, :unmute_videos, checked: @conn.cookies["unmute_videos"] == "true"
.fieldlabel: i Automatically enable audio on video pages when they are loaded.
.field
=> label f, :hide_uploader
=> checkbox f, :hide_uploader, checked: @conn.cookies["hide_uploader"] == "true"
.fieldlabel: i Hide the uploader and date posted information on image pages.
.field
=> label f, :unfilter_tag_suggestions
=> checkbox f, :unfilter_tag_suggestions, checked: @conn.cookies["unfilter_tag_suggestions"] == "true"
.fieldlabel: i Don't attempt to filter tag suggestions using your current filter.
.field
=> label f, :hide_score
=> checkbox f, :hide_score, checked: @conn.cookies["hide_score"] == "true"
.fieldlabel: i Hide score information for images.
.field
=> label f, :chan_nsfw, "Show NSFW channels"
=> checkbox f, :chan_nsfw, checked: @conn.cookies["chan_nsfw"] == "true"
.fieldlabel: i Show streams marked as NSFW on the channels page.
.field
=> label f, :enable_search_ac, "Enable search auto-completion"
=> checkbox f, :enable_search_ac, checked: @conn.cookies["enable_search_ac"] == "true"
=> label f, :enable_search_ac, "Enable search auto-completion"
.autocomplete-settings class=if(@conn.cookies["enable_search_ac"] != "true", do: "hidden", else: "")
.field
=> label f,
:autocomplete_search_history_hidden,
"Hide search history in auto-completion"
=> checkbox f,
:autocomplete_search_history_hidden,
checked: @conn.cookies["autocomplete_search_history_hidden"] == "true"
=> label f,
:autocomplete_search_history_hidden,
"Hide search history in auto-completion"
.autocomplete-search-history-settings[
class=if(@conn.cookies["autocomplete_search_history_hidden"] == "true", do: "hidden", else: "")
]
.field
=> label f,
:autocomplete_search_history_max_suggestions_when_typing,
"Maximum number of search history suggestions in autocompletion when typing"
=> number_input f,
:autocomplete_search_history_max_suggestions_when_typing,
min: 0,
@ -265,12 +297,20 @@ h1 Content Settings
step: 1,
value: @conn.cookies["autocomplete_search_history_max_suggestions_when_typing"] || 3,
class: "input"
=> label f,
:autocomplete_search_history_max_suggestions_when_typing,
"Maximum number of search history suggestions in auto-completion when typing"
= if staff?(@conn.assigns.current_user) do
.field
=> label f, :hide_staff_tools
=> checkbox f, :hide_staff_tools, checked: @conn.cookies["hide_staff_tools"] == "true"
.fieldlabel: i Hide most of the staff tools (e.g. IPs, anon names) making your site appear as if you weren't staff, this is useful when browsing in public.
= field_with_help( \
"Hide most of the staff tools (e.g. IPs, anon names) making your site " <> \
"appear as if you weren't staff, this is useful when browsing in public.",
[ \
checkbox(f, :hide_staff_tools, checked: @conn.cookies["hide_staff_tools"] == "true"),
label(f, :hide_staff_tools),
] \
)
= if !@conn.assigns.current_user do
.block__tab.hidden data-tab="join-the-herd"