Skip to content

Commit 485148f

Browse files
committed
Support informative on/off top bar
1 parent 30f4380 commit 485148f

File tree

8 files changed

+69
-1
lines changed

8 files changed

+69
-1
lines changed

themes/ssp/default/includes/header.php

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
$themeConfig = SimpleSAML\Configuration::getConfig('module_themevanilla.php');
44
$ribbonText = $themeConfig->getValue('ribbon_text');
5+
$notyText = !empty($themeConfig->getValue('noty_text')) ? $themeConfig->getValue('noty_text') : '';
6+
$notyClass = !empty($themeConfig->getValue('noty_class'))
7+
? 'noty-top-' . $themeConfig->getValue('noty_class')
8+
: 'noty-top-info';
59

610
/**
711
* Support the htmlinject hook, which allows modules to change header, pre and post body on all pages.
@@ -74,7 +78,12 @@
7478
SimpleSAML\Module::getModuleURL('themevanilla/resources/images/favicon.ico')
7579
) ?>"
7680
/>
77-
81+
<link
82+
rel="stylesheet"
83+
href="https://use.fontawesome.com/releases/v5.13.0/css/all.css"
84+
integrity="sha384-Bfad6CLCknfcloXFOyFnlgtENryhrpZCe29RTifKEixXQZ38WheV+i/6YWSzkz3V"
85+
crossorigin="anonymous"
86+
/>
7887
<?php
7988

8089
if (!empty($jquery)) {
@@ -143,11 +152,23 @@
143152
<body<?= $onLoad ?>>
144153

145154
<div class="header">
155+
<!-- Ribbon Text -->
146156
<?php if (!empty($ribbonText)) : ?>
147157
<div class="corner-ribbon red">
148158
<?= $ribbonText ?>
149159
</div>
150160
<?php endif; ?>
161+
162+
<!-- Noty top bar -->
163+
<?php if (!empty($notyText)) : ?>
164+
<div id="noty-info-bar" class="<?= $notyClass ?> noty-top-global">
165+
<?= $notyText ?>
166+
<a class="noty-top-close" href="#" onclick="closeNoty(this)">
167+
<i class="fas fa-times"></i>
168+
</a>
169+
</div>
170+
<?php endif; ?>
171+
151172
<div class="text-center ssp-logo">
152173
<a
153174
<?=

www/resources/icons/error.png

4.24 KB
Loading

www/resources/icons/info.png

4.3 KB
Loading

www/resources/icons/success.png

4.34 KB
Loading

www/resources/icons/warning.png

4.46 KB
Loading

www/resources/js/theme.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ function resizeAll() {
2828
}
2929
};
3030

31+
// Hide Top Bar notification
32+
function closeNoty(element) {
33+
$(element).parent().hide()
34+
}
35+
3136
$(document).ready(function() {
3237
if (!Cookies.get('cookies_accepted')) {
3338
$('#cookies').show();

www/resources/sass/_noty.scss

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/* CSS Style for notification boxes*/
2+
.noty-top-info, .noty-top-success, .noty-top-warning, .noty-top-error {
3+
border-bottom: 1px solid;
4+
/*padding:15px 10px 15px 50px;*/
5+
/*background-repeat: no-repeat;*/
6+
/*background-position: 10px center;*/
7+
}
8+
.noty-top-info {
9+
color: #00529B;
10+
background-color: #BDE5F8;
11+
/*background-image: url('../../resources/icons/info.png');*/
12+
}
13+
.noty-top-success {
14+
color: #4F8A10;
15+
background-color: #DFF2BF;
16+
/*background-image:url('../../resources/icons/success.png');*/
17+
}
18+
.noty-top-warning {
19+
color: #9F6000;
20+
background-color: #FEEFB3;
21+
/*background-image: url('../../resources/icons/warning.png');*/
22+
}
23+
.noty-top-error {
24+
color: #D8000C;
25+
background-color: #FFBABA;
26+
/*background-image: url('../../resources/icons/error.png');*/
27+
}
28+
.noty-top-global {
29+
display: flex;
30+
justify-content: space-between;
31+
align-items: center;
32+
width: 100%;
33+
position: absolute;
34+
z-index: 2000;
35+
padding: 0.5em; /* Use this property only without the icons */
36+
}
37+
.noty-top-close {
38+
text-decoration: none;
39+
color: unset;
40+
}
41+
/*/*/

www/resources/sass/app.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@
55
@import "extra";
66
@import "loader";
77
@import "cmg_loader";
8+
@import "noty";
89
@import "idps_buttons";

0 commit comments

Comments
 (0)