mirror of
https://github.com/redlib-org/redlib.git
synced 2025-06-24 18:10:58 +00:00
Add "hide nsfw" option
This commit is contained in:
parent
3d142afd03
commit
b13874d0db
10 changed files with 98 additions and 75 deletions
|
@ -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(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue