Light theme

This commit is contained in:
spikecodes
2021-01-10 18:15:34 -08:00
parent c58b077330
commit 08683fa5a6
10 changed files with 48 additions and 21 deletions

View File

@@ -13,6 +13,7 @@ struct SettingsTemplate {
#[derive(serde::Deserialize)]
pub struct SettingsForm {
theme: Option<String>,
front_page: Option<String>,
layout: Option<String>,
wide: Option<String>,
@@ -32,8 +33,8 @@ pub async fn get(req: HttpRequest) -> HttpResponse {
pub async fn set(req: HttpRequest, form: Form<SettingsForm>) -> HttpResponse {
let mut res = HttpResponse::Found();
let names = vec!["front_page", "layout", "wide", "comment_sort", "hide_nsfw"];
let values = vec![&form.front_page, &form.layout, &form.wide, &form.comment_sort, &form.hide_nsfw];
let names = vec!["theme", "front_page", "layout", "wide", "comment_sort", "hide_nsfw"];
let values = vec![&form.theme, &form.front_page, &form.layout, &form.wide, &form.comment_sort, &form.hide_nsfw];
for (i, name) in names.iter().enumerate() {
match values[i] {