From: James Fournie Date: Sat, 23 Feb 2013 01:28:29 +0000 (-0800) Subject: This adds a custom maintenance message which you can issue in your apache config X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=refs%2Fheads%2Fuser%2Fjamesrf%2Fmaintenance_message;p=working%2FEvergreen.git This adds a custom maintenance message which you can issue in your apache config by setting an environment variable and restarting/reloading apache. This message appears in both TPAC and JSPAC for both staff and patrons in the form of a red banner across the top of the screen. Signed-off-by: James Fournie --- diff --git a/Open-ILS/examples/apache/eg.conf b/Open-ILS/examples/apache/eg.conf index a0b27846c1..aec2c286b2 100644 --- a/Open-ILS/examples/apache/eg.conf +++ b/Open-ILS/examples/apache/eg.conf @@ -149,3 +149,6 @@ NameVirtualHost *:443 Include eg_vhost.conf +# 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." diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm index 0838a29eb5..e2de1e8a85 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm @@ -243,6 +243,8 @@ sub load_common { 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; diff --git a/Open-ILS/src/templates/opac/css/style.css.tt2 b/Open-ILS/src/templates/opac/css/style.css.tt2 index 65d12c0f7c..f5e8c6a9c1 100644 --- a/Open-ILS/src/templates/opac/css/style.css.tt2 +++ b/Open-ILS/src/templates/opac/css/style.css.tt2 @@ -1490,3 +1490,12 @@ a.preflib_change { #patron_usr_barcode_not_found { font-weight: bold; color: [% css_colors.text_alert %]; } + +#maintenance_message { + padding: 5px; + width: 100%; + background-color: [% css_colors.text_alert %]; + color: #fff; + text-align: center; +} + diff --git a/Open-ILS/src/templates/opac/parts/topnav.tt2 b/Open-ILS/src/templates/opac/parts/topnav.tt2 index f9a8d618a4..04a3758d9c 100644 --- a/Open-ILS/src/templates/opac/parts/topnav.tt2 +++ b/Open-ILS/src/templates/opac/parts/topnav.tt2 @@ -1,3 +1,8 @@ +[% IF ctx.maintenance_message %] +
+[%= ctx.maintenance_message %] +
+[% END %] [% IF !ctx.is_staff %]
diff --git a/Open-ILS/web/opac/skin/default/xml/home/index_body.xml b/Open-ILS/web/opac/skin/default/xml/home/index_body.xml index c7d20f6b03..d65a6f74e4 100644 --- a/Open-ILS/web/opac/skin/default/xml/home/index_body.xml +++ b/Open-ILS/web/opac/skin/default/xml/home/index_body.xml @@ -8,6 +8,12 @@

+ +
+ +
+ +