♻️ Refactor config initialization by name and type

This commit is contained in:
Manuel Cillero 2024-08-17 13:05:20 +02:00
parent 3ff00ac38f
commit b599e2f7d4
18 changed files with 193 additions and 192 deletions

View file

@ -4,7 +4,7 @@ use crate::prelude::*;
#[derive(AutoDefault)]
pub struct Branding {
id : OptionId,
#[default(_code = "config::SETTINGS.app.name.to_owned()")]
#[default(_code = "global::SETTINGS.app.name.to_owned()")]
app_name : String,
slogan : OptionTranslated,
logo : OptionComponent<Image>,

View file

@ -22,7 +22,7 @@ pub struct PoweredBy {
impl ComponentTrait for PoweredBy {
fn new() -> Self {
let year = Utc::now().format("%Y").to_string();
let c = concat_string!(year, " © ", config::SETTINGS.app.name);
let c = concat_string!(year, " © ", global::SETTINGS.app.name);
PoweredBy {
copyright: Some(c),
..Default::default()

View file

@ -70,7 +70,7 @@ fn hello_world() -> flex::Container {
"app",
format!(
"<span class=\"app-name\">{}</span>",
&config::SETTINGS.app.name,
&global::SETTINGS.app.name,
),
))
.with_font_size(FontSize::Medium),
@ -125,7 +125,7 @@ fn welcome() -> flex::Container {
"app",
format!(
"<span class=\"app-name\">{}</span>",
&config::SETTINGS.app.name
&global::SETTINGS.app.name
),
))
.with_size(HeadingSize::Subtitle),
@ -230,7 +230,7 @@ fn reporting_issues() -> flex::Container {
"app",
format!(
"<span class=\"app-name\">{}</span>",
&config::SETTINGS.app.name,
&global::SETTINGS.app.name,
),
),
)),