Issue #30 - Add finished flag to mark the real time that an outage was finished.

This commit is contained in:
Daniel Thee Roperto
2016-09-15 18:24:36 +10:00
parent 7ca44c74ab
commit 2cfda63922
17 changed files with 508 additions and 210 deletions

View File

@@ -34,10 +34,27 @@ If you need to make changes here, remember to update your settings inside Moodle
margin: 10px 0;
}
.auth_outage_warningbar_box_message A {
A.auth_outage_warningbar_box_title {
color: white;
}
A.auth_outage_warningbar_box_finish {
background-color: white;
border: 1px solid black;
border-radius: 5px;
color: darkgray;
font-weight: bold;
margin-left: 10px;
padding-left: 5px;
padding-right: 10px;
text-decoration: none;
transition: background-color 200ms linear;
}
A.auth_outage_warningbar_box_finish:hover {
background-color: black;
}
.navbar.navbar-fixed-top {
top: 90px;
}

View File

@@ -27,6 +27,8 @@ if (!defined('MOODLE_INTERNAL')) {
die('Direct access to this script is forbidden.'); // It must be included from a Moodle page.
}
global $OUTPUT;
$infolink = new moodle_url('/auth/outage/info.php', ['id' => $outage->id]);
echo html_writer::tag('style', get_config('auth_outage', 'css'));
@@ -35,8 +37,28 @@ echo html_writer::tag('style', get_config('auth_outage', 'css'));
<div id="auth_outage_warningbar_box">
<div class="auth_outage_warningbar_center">
<div id="auth_outage_warningbar_countdown"><?php echo $countdown; ?></div>
<div class="auth_outage_warningbar_box_message">
<?php echo html_writer::link($infolink, $outage->get_title(), ['target' => '_blank']); ?>
<div>
<?php
echo html_writer::link(
$infolink,
$outage->get_title(),
['target' => '_blank', 'class' => 'auth_outage_warningbar_box_title']
);
if (is_siteadmin() && $outage->is_ongoing()) {
$url = new moodle_url('/auth/outage/finish.php', ['id' => $outage->id]);
$text = html_writer::empty_tag('img', [
'src' => $OUTPUT->pix_url('t/check'),
'alt' => get_string('finish', 'auth_outage'),
'class' => 'iconsmall'
]) . ' ' . get_string('finish', 'auth_outage');
$attr = [
'title' => get_string('finish', 'auth_outage'),
'class' => 'auth_outage_warningbar_box_finish'
];
echo html_writer::link($url, $text, $attr);
}
?>
</div>
</div>
</div>