Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bwinf
medal
Commits
43d37d8c
Commit
43d37d8c
authored
Jan 28, 2021
by
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
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/config.rs
View file @
43d37d8c
...
...
@@ -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)]
...
...
templates/jwinf/base.hbs
View file @
43d37d8c
...
...
@@ -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;"
>
...
...
templates/jwinf/index.hbs
View file @
43d37d8c
{{#
*
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"
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment