diff --git a/Cargo.lock b/Cargo.lock index 21807a0..321f665 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1079,7 +1079,7 @@ dependencies = [ [[package]] name = "golgi" version = "0.1.4" -source = "git+https://git.coopcloud.tech/golgi-ssb/golgi#ca4c1114ddf328b818144c5a1af0187b1357e9be" +source = "git+https://git.coopcloud.tech/golgi-ssb/golgi.git#ca4c1114ddf328b818144c5a1af0187b1357e9be" dependencies = [ "async-std", "async-stream 0.3.3", @@ -2331,7 +2331,7 @@ dependencies = [ [[package]] name = "peach-web" -version = "0.6.17" +version = "0.6.18" dependencies = [ "async-std", "base64 0.13.0", diff --git a/peach-web/Cargo.toml b/peach-web/Cargo.toml index 2ad1068..6c295cc 100644 --- a/peach-web/Cargo.toml +++ b/peach-web/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "peach-web" -version = "0.6.17" +version = "0.6.18" authors = ["Andrew Reid ", "Max Fowler "] edition = "2018" description = "peach-web is a web application which provides a web interface for monitoring and interacting with the PeachCloud device. This allows administration of the single-board computer (ie. Raspberry Pi) running PeachCloud, as well as the ssb-server and related plugins." 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) }