Make motd optional
This commit is contained in:
parent
258dcd7298
commit
da42de5c92
@ -20,14 +20,13 @@ pub fn App() -> impl IntoView {
|
||||
let config = config.unwrap_or_default();
|
||||
view! { <Sessions config /> }.into_any()
|
||||
}
|
||||
Err(e) => {
|
||||
view! {
|
||||
<div class="box error-background">
|
||||
<h1>"Error"</h1>
|
||||
<p>{e}</p>
|
||||
</div>
|
||||
}.into_any()
|
||||
Err(e) => view! {
|
||||
<div class="box error-background">
|
||||
<h1>"Error"</h1>
|
||||
<p>{e}</p>
|
||||
</div>
|
||||
}
|
||||
.into_any(),
|
||||
})
|
||||
};
|
||||
|
||||
@ -98,14 +97,14 @@ where
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(default)]
|
||||
pub struct SessionConfig {
|
||||
pub motd: String,
|
||||
pub motd: Option<String>,
|
||||
pub sessions: Vec<NthWeekday>,
|
||||
}
|
||||
|
||||
impl Default for SessionConfig {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
motd: "Proben Dienstags um 18:30 Uhr und Sonntags um 10:00 Uhr".to_string(),
|
||||
motd: Some("Probe jeden ersten Sonntag im Monat um 10:00 Uhr und jeden dritten Dienstag im Monat um 18:30 Uhr".to_string()),
|
||||
sessions: vec![
|
||||
NthWeekday::new(1, Weekday::Sun),
|
||||
NthWeekday::new(3, Weekday::Tue),
|
||||
|
||||
Loading…
Reference in New Issue
Block a user