diff --git a/peach-web/src/templates/base.rs b/peach-web/src/templates/base.rs index db8304e..3fb5d05 100644 --- a/peach-web/src/templates/base.rs +++ b/peach-web/src/templates/base.rs @@ -1,5 +1,25 @@ use maud::{html, PreEscaped, DOCTYPE}; +/// JavaScript event listener for the back button on the top navigation bar of +/// the UI. +/// +/// When the button is clicked, prevent the default behaviour and invoke +/// the history API to load the previous URL (page) in the history list. +fn js_back_button_script() -> PreEscaped { + html! { + (PreEscaped(" + + ")) + } +} + /// Base template builder. /// /// Takes an HTML body as input and splices it into the base template. @@ -14,6 +34,7 @@ pub fn build_template(body: PreEscaped, theme: String) -> PreEscaped")) nav class="nav-bar" { - a class="nav-item" href=[back] title="Back" { + a id="backButton" class="nav-item" href=[back] title="Back" { img class="icon-medium nav-icon-left icon-active" src="/icons/back.svg" alt="Back"; } h1 class="nav-title" { (title) }