use maud::{html, PreEscaped}; use crate::{templates, utils::theme, SERVER_CONFIG}; // ROUTE: /settings /// Settings menu template builder. pub fn build_template() -> PreEscaped { let menu_template = html! { (PreEscaped("")) div class="card center" { (PreEscaped("")) div id="settingsButtons" { // render the network settings and power menu buttons if we're // not in standalone mode @if !SERVER_CONFIG.standalone_mode { a id="power" class="button button-primary center" href="/settings/power" title="Power Menu" { "Power" } a id="network" class="button button-primary center" href="/settings/network" title="Network Settings" { "Network" } } a id="scuttlebutt" class="button button-primary center" href="/settings/scuttlebutt" title="Scuttlebutt Settings" { "Scuttlebutt" } a id="admin" class="button button-primary center" href="/settings/admin" title="Administrator Settings" { "Administration" } } } }; // wrap the nav bars around the settings menu template content // parameters are template, title and back url let body = templates::nav::build_template(menu_template, "Settings", Some("/")); // query the current theme so we can pass it into the base template builder let theme = theme::get_theme(); // render the base template with the provided body templates::base::build_template(body, theme) }