Add "hide nsfw" option

This commit is contained in:
spikecodes 2021-01-08 17:35:04 -08:00
parent 3d142afd03
commit b13874d0db
10 changed files with 98 additions and 75 deletions

View file

@ -1,5 +1,5 @@
// CRATES
use crate::utils::{cookie, error, fetch_posts, param, Post};
use crate::utils::{error, fetch_posts, param, prefs, Post, Preferences};
use actix_web::{HttpRequest, HttpResponse};
use askama::Template;
@ -19,7 +19,7 @@ struct SearchTemplate {
posts: Vec<Post>,
sub: String,
params: SearchParams,
layout: String,
prefs: Preferences,
}
// SERVICES
@ -45,7 +45,7 @@ pub async fn find(req: HttpRequest) -> HttpResponse {
after,
restrict_sr: param(&path, "restrict_sr"),
},
layout: cookie(req, "layout"),
prefs: prefs(req),
}
.render()
.unwrap(),