Commit 43d37d8c authored by Robert Czechowski's avatar Robert Czechowski
Browse files

Add notification messages on the index page that depend on the user agent

parent a066df80
Pipeline #992 passed with stages
in 8 minutes and 39 seconds
......@@ -50,7 +50,7 @@ pub struct Config {
pub allow_sex_diverse: Option<bool>,
pub allow_sex_other: Option<bool>,
pub dbstatus_secret: Option<String>,
pub template_params: Option<::std::collections::BTreeMap<String, String>>,
pub template_params: Option<::std::collections::BTreeMap<String, serde_json::Value>>,
}
#[derive(StructOpt, Debug)]
......
......@@ -110,18 +110,6 @@
{{/if}}
{{/if}}
{{#if config.notification}}
{{#if index}}
<div class="columns">
<div class="column is-8 is-offset-2">
<div class="notification is-info">
{{{ config.notification }}}
</div>
</div>
</div>
{{/if}}
{{/if}}
{{~> page}}
</div>
<footer class="footer" style="margin-top: 150px;">
......
{{#*inline "page"}}
{{#if config.notification}}
<div class="columns">
<div class="column is-8 is-offset-2">
<div class="notification is-info">
{{{ config.notification }}}
</div>
</div>
</div>
{{/if}}
{{#if config.browser_notification}}
{{#each config.browser_notification}}
<div class="columns" id="browser-notification-{{@index}}">
<div class="column is-8 is-offset-2">
<div class="notification is-info">
{{{ message }}}
</div>
</div>
</div>
<script>
if (navigator.userAgent.search("{{ ua_contains }}") < 0) {
document.getElementById("browser-notification-{{@index}}").style.display = "none";
}
</script>
{{/each}}
{{/if}}
{{#if teacher}}
<div class="columns alogin">
<div class="column is-8 is-offset-2">
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment