This adds a custom maintenance message which you can issue in your
Apache config by setting the environment variable "MAINTENANCE_MESSAGE"
and restarting/reloading Apache. This message appears in the TPAC for
both staff and patrons in the form of a red banner across the top of the
screen.
Signed-off-by: James Fournie <jfournie@sitka.bclibraries.ca>
Signed-off-by: Dan Scott <dscott@laurentian.ca>
Signed-off-by: Ben Shum <bshum@biblio.org>
Include eg_vhost.conf
</VirtualHost>
+# Set a maintenance message for notifying OPAC users of scheduled downtime
+# This can be put in specific vhosts as needed
+#SetEnv MAINTENANCE_MESSAGE "The system will be down tomorrow night so use the card catalog at that time."
return $self->redirect_ssl unless $self->cgi->https;
}
+ $ctx->{maintenance_message} = $self->apache->subprocess_env("MAINTENANCE_MESSAGE");
+
$ctx->{referer} = $self->cgi->referer;
$ctx->{path_info} = $self->cgi->path_info;
$ctx->{full_path} = $ctx->{base_path} . $self->cgi->path_info;
padding-top: 1em;
padding-bottom: 0.5em;
font-style: italic;
-}
\ No newline at end of file
+}
+
+#maintenance_message {
+ padding: 5px;
+ width: 100%;
+ background-color: [% css_colors.text_alert %];
+ color: [% css_colors.text_invert %];
+ text-align: center;
+}
+[% IF ctx.maintenance_message %]
+<div id="maintenance_message">
+[%= ctx.maintenance_message %]
+</div>
+[% END %]
[% IF !ctx.is_staff %]
<div id="header-wrap">
<div id="header">
</p>
</noscript>
+<!--#if expr="$MAINTENANCE_MESSAGE"-->
+ <div style="padding: 5px; width: 100%; background-color: #f00; color: #fff; text-align: center;">
+ <!--#echo var="MAINTENANCE_MESSAGE"-->
+ </div>
+<!--#endif-->
+
<table id='toptable' width='100%' style='border-collapse: collapse;'>
<tbody>
<tr>