Skip to content

Commit 2284da6

Browse files
authored
Implement site notice (#76)
1 parent a880577 commit 2284da6

File tree

4 files changed

+29
-13
lines changed

4 files changed

+29
-13
lines changed

composer.lock

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config.sample.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,12 @@
5757

5858
// uncomment the line below to skip the domain check
5959
// $allowed_domains = array();
60+
61+
// Site Notice
62+
$siteNotice = new stdClass();
63+
$siteNotice->display = false;
64+
$siteNotice->noticePath = 'dcf-notice';
65+
$siteNotice->containerID = 'dcf-main';
66+
$siteNotice->type = 'dcf-notice-info';
67+
$siteNotice->title = 'Maintenance Notice';
68+
$siteNotice->message = 'We will be performing site maintenance on February 4th from 4:30 to 5:00 pm CST. This site may not be available during this time.';

www/css/go.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,9 @@ table.dataTable tbody th.dt-body-nowrap,table.dataTable tbody td.dt-body-nowrap
169169
visibility: hidden;
170170
}
171171

172+
.dcf-notice {
173+
margin-top: 1em;
174+
}
172175

173176
@media screen and (max-width: 767px) {
174177

www/index.php

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,17 +83,21 @@
8383
$page->addHeadLink($lilurl->getBaseUrl(), 'home');
8484

8585
$page->addScriptDeclaration("require(['jquery'], function(jq) {
86-
jq(function($){
87-
var \$out = $('.dcf-notice input');
88-
\$out.attr('id', 'gourl_out');
89-
\$out.attr('class', 'dcf-input-text dcf-w-100%');
90-
\$out.attr('title', 'Your Go URL');
91-
});
86+
jq(function($){
87+
var \$out = $('.dcf-notice input');
88+
\$out.attr('id', 'gourl_out');
89+
\$out.attr('class', 'dcf-input-text dcf-w-100%');
90+
\$out.attr('title', 'Your Go URL');
91+
});
9292
});");
9393

9494
$page->appcontrols = $savvy->render(null,'navigation.php');
9595
$page->maincontentarea = $savvy->render(null,'flashBag.php');
9696
$page->maincontentarea .= $savvy->render(null, $controller->getViewTemplate());
9797
$page->doctitle = sprintf('<title>%s</title>', $page->doctitle);
9898

99+
if (isset($siteNotice) && $siteNotice->display) {
100+
$page->displayDCFNoticeMessage($siteNotice->title, $siteNotice->message, $siteNotice->type, $siteNotice->noticePath, $siteNotice->containerID);
101+
}
102+
99103
echo $page;

0 commit comments

Comments
 (0)