neon_arch commited on
Commit
1a2a833
1 Parent(s): 7206e7d

✨ feat: pass the new animation config option (#424)

Browse files
src/server/router.rs CHANGED
@@ -13,7 +13,12 @@ use std::fs::read_to_string;
13
  #[get("/")]
14
  pub async fn index(config: web::Data<Config>) -> Result<HttpResponse, Box<dyn std::error::Error>> {
15
  Ok(HttpResponse::Ok().body(
16
- crate::templates::views::index::index(&config.style.colorscheme, &config.style.theme).0,
 
 
 
 
 
17
  ))
18
  }
19
 
@@ -28,6 +33,7 @@ pub async fn not_found(
28
  crate::templates::views::not_found::not_found(
29
  &config.style.colorscheme,
30
  &config.style.theme,
 
31
  )
32
  .0,
33
  ))
@@ -47,7 +53,12 @@ pub async fn robots_data(_req: HttpRequest) -> Result<HttpResponse, Box<dyn std:
47
  #[get("/about")]
48
  pub async fn about(config: web::Data<Config>) -> Result<HttpResponse, Box<dyn std::error::Error>> {
49
  Ok(HttpResponse::Ok().body(
50
- crate::templates::views::about::about(&config.style.colorscheme, &config.style.theme).0,
 
 
 
 
 
51
  ))
52
  }
53
 
@@ -60,6 +71,7 @@ pub async fn settings(
60
  crate::templates::views::settings::settings(
61
  &config.style.colorscheme,
62
  &config.style.theme,
 
63
  &config
64
  .upstream_search_engines
65
  .keys()
 
13
  #[get("/")]
14
  pub async fn index(config: web::Data<Config>) -> Result<HttpResponse, Box<dyn std::error::Error>> {
15
  Ok(HttpResponse::Ok().body(
16
+ crate::templates::views::index::index(
17
+ &config.style.colorscheme,
18
+ &config.style.theme,
19
+ &config.style.animation,
20
+ )
21
+ .0,
22
  ))
23
  }
24
 
 
33
  crate::templates::views::not_found::not_found(
34
  &config.style.colorscheme,
35
  &config.style.theme,
36
+ &config.style.animation,
37
  )
38
  .0,
39
  ))
 
53
  #[get("/about")]
54
  pub async fn about(config: web::Data<Config>) -> Result<HttpResponse, Box<dyn std::error::Error>> {
55
  Ok(HttpResponse::Ok().body(
56
+ crate::templates::views::about::about(
57
+ &config.style.colorscheme,
58
+ &config.style.theme,
59
+ &config.style.animation,
60
+ )
61
+ .0,
62
  ))
63
  }
64
 
 
71
  crate::templates::views::settings::settings(
72
  &config.style.colorscheme,
73
  &config.style.theme,
74
+ &config.style.animation,
75
  &config
76
  .upstream_search_engines
77
  .keys()
src/server/routes/search.rs CHANGED
@@ -72,6 +72,7 @@ pub async fn search(
72
  crate::templates::views::search::search(
73
  &config.style.colorscheme,
74
  &config.style.theme,
 
75
  query,
76
  &results?,
77
  )
 
72
  crate::templates::views::search::search(
73
  &config.style.colorscheme,
74
  &config.style.theme,
75
+ &config.style.animation,
76
  query,
77
  &results?,
78
  )
src/templates/views/about.rs CHANGED
@@ -14,9 +14,9 @@ use crate::templates::partials::{footer::footer, header::header};
14
  /// # Returns
15
  ///
16
  /// It returns the compiled html markup code as a result.
17
- pub fn about(colorscheme: &str, theme: &str) -> Markup {
18
  html!(
19
- (header(colorscheme, theme))
20
  main class="about-container"{
21
  article {
22
  div{
 
14
  /// # Returns
15
  ///
16
  /// It returns the compiled html markup code as a result.
17
+ pub fn about(colorscheme: &str, theme: &str, animation: &Option<String>) -> Markup {
18
  html!(
19
+ (header(colorscheme, theme, animation))
20
  main class="about-container"{
21
  article {
22
  div{
src/templates/views/index.rs CHANGED
@@ -14,9 +14,9 @@ use crate::templates::partials::{bar::bar, footer::footer, header::header};
14
  /// # Returns
15
  ///
16
  /// It returns the compiled html markup code as a result.
17
- pub fn index(colorscheme: &str, theme: &str) -> Markup {
18
  html!(
19
- (header(colorscheme, theme))
20
  main class="search-container"{
21
  img class="websurfx-logo" src="../images/websurfx_logo.svg" alt="Websurfx meta-search engine logo";
22
  (bar(&String::default()))
 
14
  /// # Returns
15
  ///
16
  /// It returns the compiled html markup code as a result.
17
+ pub fn index(colorscheme: &str, theme: &str, animation: &Option<String>) -> Markup {
18
  html!(
19
+ (header(colorscheme, theme, animation))
20
  main class="search-container"{
21
  img class="websurfx-logo" src="../images/websurfx_logo.svg" alt="Websurfx meta-search engine logo";
22
  (bar(&String::default()))
src/templates/views/not_found.rs CHANGED
@@ -13,9 +13,9 @@ use maud::{html, Markup};
13
  /// # Returns
14
  ///
15
  /// It returns the compiled html markup code as a result.
16
- pub fn not_found(colorscheme: &str, theme: &str) -> Markup {
17
  html!(
18
- (header(colorscheme, theme))
19
  main class="error_container"{
20
  img src="images/robot-404.svg" alt="Image of broken robot.";
21
  .error_content{
 
13
  /// # Returns
14
  ///
15
  /// It returns the compiled html markup code as a result.
16
+ pub fn not_found(colorscheme: &str, theme: &str, animation: &Option<String>) -> Markup {
17
  html!(
18
+ (header(colorscheme, theme, animation))
19
  main class="error_container"{
20
  img src="images/robot-404.svg" alt="Image of broken robot.";
21
  .error_content{
src/templates/views/search.rs CHANGED
@@ -22,11 +22,12 @@ use crate::{
22
  pub fn search(
23
  colorscheme: &str,
24
  theme: &str,
 
25
  query: &str,
26
  search_results: &SearchResults,
27
  ) -> Markup {
28
  html!(
29
- (header(colorscheme, theme))
30
  main class="results"{
31
  (search_bar(&search_results.engine_errors_info, search_results.safe_search_level, query))
32
  .results_aggregated{
 
22
  pub fn search(
23
  colorscheme: &str,
24
  theme: &str,
25
+ animation: &Option<String>,
26
  query: &str,
27
  search_results: &SearchResults,
28
  ) -> Markup {
29
  html!(
30
+ (header(colorscheme, theme, animation))
31
  main class="results"{
32
  (search_bar(&search_results.engine_errors_info, search_results.safe_search_level, query))
33
  .results_aggregated{
src/templates/views/settings.rs CHANGED
@@ -25,10 +25,11 @@ use crate::templates::partials::{
25
  pub fn settings(
26
  colorscheme: &str,
27
  theme: &str,
 
28
  engine_names: &[&String],
29
  ) -> Result<Markup, Box<dyn std::error::Error>> {
30
  Ok(html!(
31
- (header(colorscheme, theme))
32
  main class="settings"{
33
  h1{"Settings"}
34
  hr;
 
25
  pub fn settings(
26
  colorscheme: &str,
27
  theme: &str,
28
+ animation: &Option<String>,
29
  engine_names: &[&String],
30
  ) -> Result<Markup, Box<dyn std::error::Error>> {
31
  Ok(html!(
32
+ (header(colorscheme, theme, animation))
33
  main class="settings"{
34
  h1{"Settings"}
35
  hr;