Display app version for administrators
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Pierre HUBERT 2022-07-22 15:11:30 +02:00
parent 9bdce94487
commit 433572293b
2 changed files with 6 additions and 0 deletions

View File

@ -17,6 +17,7 @@ pub(crate) struct BaseSettingsPage {
pub app_name: &'static str,
pub is_admin: bool,
pub user_name: String,
pub version: &'static str,
}
impl BaseSettingsPage {
@ -29,6 +30,7 @@ impl BaseSettingsPage {
app_name: APP_NAME,
is_admin: user.admin,
user_name: user.username.to_string(),
version: env!("CARGO_PKG_VERSION"),
}
}
}

View File

@ -14,6 +14,9 @@
<a href="/" class="d-flex align-items-center mb-3 mb-md-0 me-md-auto link-dark text-decoration-none">
<span class="fs-4">{{ _p.app_name }}</span>
</a>
{% if _p.is_admin %}
<span>Version {{ _p.version }}</span>
{% endif %}
<hr>
<ul class="nav nav-pills flex-column mb-auto">
<li class="nav-item">
@ -81,6 +84,7 @@
else el.classList.remove("active")
})
</script>
</body>
</html>