2021-01-03 17:50:23 +13:00
{% extends "base.html" %}
{% import "utils.html" as utils %}
{% block title %}Libreddit Settings{% endblock %}
{% block search %}
{% call utils::search("".to_owned(), "", "") %}
{% endblock %}
2021-01-11 10:08:36 +13:00
{% block content %}
2021-01-31 18:21:46 +13:00
< div id = "settings" >
2021-03-18 13:28:05 +13:00
< form action = "/settings" method = "POST" >
2021-01-31 18:21:46 +13:00
< div class = "prefs" >
< p > Appearance< / p >
< div id = "theme" >
< label for = "theme" > Theme:< / label >
< select name = "theme" >
2021-05-01 04:26:49 +12:00
{% call utils::options(prefs.theme, ["system", "light", "dark", "black", "dracula", "nord", "laserwave"], "system") %}
2021-01-31 18:21:46 +13:00
< / select >
< / div >
< p > Interface< / p >
< 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 >
< input type = "checkbox" name = "wide" { % if prefs . wide = = " on " % } checked { % endif % } >
< / div >
< p > Content< / p >
2021-03-26 17:41:58 +13: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 18:21:46 +13: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 18:43:46 +13:00
< div id = "show_nsfw" >
< label for = "show_nsfw" > Show NSFW posts:< / label >
< input type = "checkbox" name = "show_nsfw" { % if prefs . show_nsfw = = " on " % } checked { % endif % } >
2021-01-31 18:21:46 +13:00
< / div >
2021-02-14 09:55:23 +13:00
< input id = "save" type = "submit" value = "Save" >
2021-01-11 15:15:34 +13:00
< / div >
2021-01-31 18:21:46 +13:00
< / form >
2021-02-14 09:55:23 +13:00
{% if prefs.subscriptions.len() > 0 %}
< div class = "prefs" id = "settings_subs" >
2021-04-07 05:23:05 +12:00
< p > Subscribed Feeds< / p >
2021-02-14 09:55:23 +13:00
{% for sub in prefs.subscriptions %}
< div >
2021-04-07 05:23:05 +12:00
< span > {% if sub.starts_with("u_") -%}{{ format!("u/{}", & sub[2..]) }}{% else -%}{{ format!("r/{}", sub) }}{% endif -%}< / span >
2021-02-14 09:55:23 +13:00
< form action = "/r/{{ sub }}/unsubscribe/?redirect=settings" method = "POST" >
< button class = "unsubscribe" > Unsubscribe< / button >
< / form >
< / div >
{% endfor %}
< / div >
2021-01-31 00:27:49 +13:00
{% endif %}
2021-02-14 09:55:23 +13: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 >
< 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 }}&comment_sort={{ prefs.comment_sort }}&show_nsfw={{ prefs.show_nsfw }}&subscriptions={{ prefs.subscriptions.join(" % 2B " ) } } " > this link< / a > .< / p >
< / div >
2021-01-31 18:21:46 +13:00
< / div >
2021-01-31 00:27:49 +13:00
2021-01-18 08:39:57 +13:00
{% endblock %}