Settings with Layouts

This commit is contained in:
spikecodes 2021-01-05 18:04:49 -08:00
parent 2b0193f5ea
commit aa7b4b2af7
16 changed files with 255 additions and 140 deletions

View file

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