mirror of
https://github.com/neon-mmd/websurfx.git
synced 2024-11-21 21:48:21 -05:00
✨ feat: pass the new animation config option (#424)
This commit is contained in:
parent
7206e7d6a1
commit
1a2a833597
@ -13,7 +13,12 @@ use std::fs::read_to_string;
|
||||
#[get("/")]
|
||||
pub async fn index(config: web::Data<Config>) -> Result<HttpResponse, Box<dyn std::error::Error>> {
|
||||
Ok(HttpResponse::Ok().body(
|
||||
crate::templates::views::index::index(&config.style.colorscheme, &config.style.theme).0,
|
||||
crate::templates::views::index::index(
|
||||
&config.style.colorscheme,
|
||||
&config.style.theme,
|
||||
&config.style.animation,
|
||||
)
|
||||
.0,
|
||||
))
|
||||
}
|
||||
|
||||
@ -28,6 +33,7 @@ pub async fn not_found(
|
||||
crate::templates::views::not_found::not_found(
|
||||
&config.style.colorscheme,
|
||||
&config.style.theme,
|
||||
&config.style.animation,
|
||||
)
|
||||
.0,
|
||||
))
|
||||
@ -47,7 +53,12 @@ pub async fn robots_data(_req: HttpRequest) -> Result<HttpResponse, Box<dyn std:
|
||||
#[get("/about")]
|
||||
pub async fn about(config: web::Data<Config>) -> Result<HttpResponse, Box<dyn std::error::Error>> {
|
||||
Ok(HttpResponse::Ok().body(
|
||||
crate::templates::views::about::about(&config.style.colorscheme, &config.style.theme).0,
|
||||
crate::templates::views::about::about(
|
||||
&config.style.colorscheme,
|
||||
&config.style.theme,
|
||||
&config.style.animation,
|
||||
)
|
||||
.0,
|
||||
))
|
||||
}
|
||||
|
||||
@ -60,6 +71,7 @@ pub async fn settings(
|
||||
crate::templates::views::settings::settings(
|
||||
&config.style.colorscheme,
|
||||
&config.style.theme,
|
||||
&config.style.animation,
|
||||
&config
|
||||
.upstream_search_engines
|
||||
.keys()
|
||||
|
@ -72,6 +72,7 @@ pub async fn search(
|
||||
crate::templates::views::search::search(
|
||||
&config.style.colorscheme,
|
||||
&config.style.theme,
|
||||
&config.style.animation,
|
||||
query,
|
||||
&results?,
|
||||
)
|
||||
|
@ -14,9 +14,9 @@ use crate::templates::partials::{footer::footer, header::header};
|
||||
/// # Returns
|
||||
///
|
||||
/// It returns the compiled html markup code as a result.
|
||||
pub fn about(colorscheme: &str, theme: &str) -> Markup {
|
||||
pub fn about(colorscheme: &str, theme: &str, animation: &Option<String>) -> Markup {
|
||||
html!(
|
||||
(header(colorscheme, theme))
|
||||
(header(colorscheme, theme, animation))
|
||||
main class="about-container"{
|
||||
article {
|
||||
div{
|
||||
|
@ -14,9 +14,9 @@ use crate::templates::partials::{bar::bar, footer::footer, header::header};
|
||||
/// # Returns
|
||||
///
|
||||
/// It returns the compiled html markup code as a result.
|
||||
pub fn index(colorscheme: &str, theme: &str) -> Markup {
|
||||
pub fn index(colorscheme: &str, theme: &str, animation: &Option<String>) -> Markup {
|
||||
html!(
|
||||
(header(colorscheme, theme))
|
||||
(header(colorscheme, theme, animation))
|
||||
main class="search-container"{
|
||||
img class="websurfx-logo" src="../images/websurfx_logo.svg" alt="Websurfx meta-search engine logo";
|
||||
(bar(&String::default()))
|
||||
|
@ -13,9 +13,9 @@ use maud::{html, Markup};
|
||||
/// # Returns
|
||||
///
|
||||
/// It returns the compiled html markup code as a result.
|
||||
pub fn not_found(colorscheme: &str, theme: &str) -> Markup {
|
||||
pub fn not_found(colorscheme: &str, theme: &str, animation: &Option<String>) -> Markup {
|
||||
html!(
|
||||
(header(colorscheme, theme))
|
||||
(header(colorscheme, theme, animation))
|
||||
main class="error_container"{
|
||||
img src="images/robot-404.svg" alt="Image of broken robot.";
|
||||
.error_content{
|
||||
|
@ -22,11 +22,12 @@ use crate::{
|
||||
pub fn search(
|
||||
colorscheme: &str,
|
||||
theme: &str,
|
||||
animation: &Option<String>,
|
||||
query: &str,
|
||||
search_results: &SearchResults,
|
||||
) -> Markup {
|
||||
html!(
|
||||
(header(colorscheme, theme))
|
||||
(header(colorscheme, theme, animation))
|
||||
main class="results"{
|
||||
(search_bar(&search_results.engine_errors_info, search_results.safe_search_level, query))
|
||||
.results_aggregated{
|
||||
|
@ -25,10 +25,11 @@ use crate::templates::partials::{
|
||||
pub fn settings(
|
||||
colorscheme: &str,
|
||||
theme: &str,
|
||||
animation: &Option<String>,
|
||||
engine_names: &[&String],
|
||||
) -> Result<Markup, Box<dyn std::error::Error>> {
|
||||
Ok(html!(
|
||||
(header(colorscheme, theme))
|
||||
(header(colorscheme, theme, animation))
|
||||
main class="settings"{
|
||||
h1{"Settings"}
|
||||
hr;
|
||||
|
Loading…
Reference in New Issue
Block a user