2021-01-03 04:50:23 +00:00
{% extends "base.html" %}
{% import "utils.html" as utils %}
{% block title %}Libreddit Settings{% endblock %}
{% block search %}
{% call utils::search("".to_owned(), "", "") %}
{% endblock %}
2021-01-10 21:08:36 +00:00
{% block content %}
2021-01-31 05:21:46 +00:00
< div id = "settings" >
2021-03-18 00:28:05 +00:00
< form action = "/settings" method = "POST" >
2021-01-31 05:21:46 +00:00
< div class = "prefs" >
2021-12-27 21:43:44 +00:00
< legend > Appearance< / legend >
2021-01-31 05:21:46 +00:00
< div id = "theme" >
< label for = "theme" > Theme:< / label >
< select name = "theme" >
2021-11-24 19:31:19 +00:00
{% call utils::options(prefs.theme, ["system", "light", "dark", "black", "dracula", "nord", "laserwave", "violet", "gold", "rosebox"], "system") %}
2021-01-31 05:21:46 +00:00
< / select >
< / div >
2021-12-27 21:43:44 +00:00
< legend > Interface< / legend >
2021-01-31 05:21:46 +00:00
< div id = "front_page" >
< label for = "front_page" > Front page:< / label >
< select name = "front_page" >
{% call utils::options(prefs.front_page, ["default", "popular", "all"], "default") %}
< / select >
< / div >
< div id = "layout" >
< label for = "layout" > Layout:< / label >
< select name = "layout" >
{% call utils::options(prefs.layout, ["card", "clean", "compact"], "card") %}
< / select >
< / div >
< div id = "wide" >
< label for = "wide" > Wide UI:< / label >
2021-05-15 20:59:42 +00:00
< input type = "hidden" value = "off" name = "wide" >
2021-01-31 05:21:46 +00:00
< input type = "checkbox" name = "wide" { % if prefs . wide = = " on " % } checked { % endif % } >
< / div >
2021-12-27 21:43:44 +00:00
< legend > Content< / legend >
2021-03-26 04:41:58 +00:00
< div id = "post_sort" >
< label for = "post_sort" title = "Applies only to subreddit feeds" > Default subreddit post sort:< / label >
< select name = "post_sort" >
{% call utils::options(prefs.post_sort, ["hot", "new", "top", "rising", "controversial"], "hot") %}
< / select >
< / div >
2021-01-31 05:21:46 +00:00
< div id = "comment_sort" >
< label for = "comment_sort" > Default comment sort:< / label >
< select name = "comment_sort" >
{% call utils::options(prefs.comment_sort, ["confidence", "top", "new", "controversial", "old"], "confidence") %}
< / select >
< / div >
2021-01-31 05:43:46 +00:00
< div id = "show_nsfw" >
< label for = "show_nsfw" > Show NSFW posts:< / label >
2021-05-15 20:59:42 +00:00
< input type = "hidden" value = "off" name = "show_nsfw" >
2021-01-31 05:43:46 +00:00
< input type = "checkbox" name = "show_nsfw" { % if prefs . show_nsfw = = " on " % } checked { % endif % } >
2021-01-31 05:21:46 +00:00
< / div >
2021-10-26 04:27:55 +00:00
< div id = "autoplay_videos" >
< label for = "autoplay_videos" > Autoplay videos< / label >
< input type = "hidden" value = "off" name = "autoplay_videos" >
< input type = "checkbox" name = "autoplay_videos" { % if prefs . autoplay_videos = = " on " % } checked { % endif % } >
< / div >
2021-05-10 01:25:52 +00:00
< div id = "use_hls" >
2021-11-24 06:43:25 +00:00
< label for = "use_hls" > Use HLS for videos
< details id = "feeds" >
< summary > Why?< / summary >
< div id = "feed_list" class = "helper" > Reddit videos require JavaScript (via HLS.js) to be enabled to be played with audio. Therefore, this toggle lets you either use Libreddit JS-free or utilize this feature.< / div >
< / details >
< / label >
2021-05-15 20:59:42 +00:00
< input type = "hidden" value = "off" name = "use_hls" >
2021-05-10 01:25:52 +00:00
< input type = "checkbox" name = "use_hls" { % if prefs . use_hls = = " on " % } checked { % endif % } >
< / div >
< div id = "hide_hls_notification" >
< label for = "hide_hls_notification" > Hide notification about possible HLS usage< / label >
2021-05-15 20:59:42 +00:00
< input type = "hidden" value = "off" name = "hide_hls_notification" >
2021-05-10 01:25:52 +00:00
< input type = "checkbox" name = "hide_hls_notification" { % if prefs . hide_hls_notification = = " on " % } checked { % endif % } >
< / div >
2021-02-13 20:55:23 +00:00
< input id = "save" type = "submit" value = "Save" >
2021-01-11 02:15:34 +00:00
< / div >
2021-01-31 05:21:46 +00:00
< / form >
2021-02-13 20:55:23 +00:00
{% if prefs.subscriptions.len() > 0 %}
< div class = "prefs" id = "settings_subs" >
2021-12-27 21:43:44 +00:00
< legend > Subscribed Feeds< / legend >
2021-02-13 20:55:23 +00:00
{% for sub in prefs.subscriptions %}
< div >
2021-11-22 06:30:44 +00:00
{% let feed -%}
{% if sub.starts_with("u_") -%}{% let feed = format!("u/{}", & sub[2..]) -%}{% else -%}{% let feed = format!("r/{}", sub) -%}{% endif -%}
< a href = "/{{ feed }}" > {{ feed }}< / a >
2021-02-13 20:55:23 +00:00
< form action = "/r/{{ sub }}/unsubscribe/?redirect=settings" method = "POST" >
< button class = "unsubscribe" > Unsubscribe< / button >
< / form >
< / div >
{% endfor %}
< / div >
2021-01-30 11:27:49 +00:00
{% endif %}
2021-11-26 04:02:04 +00:00
{% if !prefs.filters.is_empty() %}
< div class = "prefs" id = "settings_filters" >
2021-12-27 21:43:44 +00:00
< legend > Filtered Feeds< / legend >
2021-11-26 04:02:04 +00:00
{% for sub in prefs.filters %}
< div >
{% let feed -%}
{% if sub.starts_with("u_") -%}{% let feed = format!("u/{}", & sub[2..]) -%}{% else -%}{% let feed = format!("r/{}", sub) -%}{% endif -%}
< a href = "/{{ feed }}" > {{ feed }}< / a >
< form action = "/r/{{ sub }}/unfilter/?redirect=settings" method = "POST" >
< button class = "unfilter" > Unfilter< / button >
< / form >
< / div >
{% endfor %}
< / div >
{% endif %}
2021-05-10 01:25:52 +00:00
2021-02-13 20:55:23 +00:00
< div id = "settings_note" >
< p > < b > Note:< / b > settings and subscriptions are saved in browser cookies. Clearing your cookies will reset them.< / p > < br >
2022-05-17 03:11:01 +00:00
< p > You can restore your current settings and subscriptions after clearing your cookies using < a href = "/settings/restore/?theme={{ prefs.theme }}&front_page={{ prefs.front_page }}&layout={{ prefs.layout }}&wide={{ prefs.wide }}&post_sort={{ prefs.post_sort }}&comment_sort={{ prefs.comment_sort }}&show_nsfw={{ prefs.show_nsfw }}&use_hls={{ prefs.use_hls }}&hide_hls_notification={{ prefs.hide_hls_notification }}&subscriptions={{ prefs.subscriptions.join(" % 2B " ) } } & filters = {{ prefs . filters . join ( " % 2B " ) } } " > this link< / a > .< / p >
2021-02-13 20:55:23 +00:00
< / div >
2021-01-31 05:21:46 +00:00
< / div >
2021-01-30 11:27:49 +00:00
2021-01-17 19:39:57 +00:00
{% endblock %}