This adds a custom maintenance message which you can issue in your apache config user/jamesrf/maintenance_message
authorJames Fournie <jfournie@sitka.bclibraries.ca>
Sat, 23 Feb 2013 01:28:29 +0000 (17:28 -0800)
committerJames Fournie <jfournie@sitka.bclibraries.ca>
Sat, 23 Feb 2013 01:34:34 +0000 (17:34 -0800)
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 <jfournie@sitka.bclibraries.ca>
Open-ILS/examples/apache/eg.conf
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm
Open-ILS/src/templates/opac/css/style.css.tt2
Open-ILS/src/templates/opac/parts/topnav.tt2
Open-ILS/web/opac/skin/default/xml/body.xml
Open-ILS/web/opac/skin/default/xml/home/index_body.xml

index a0b2784..aec2c28 100644 (file)
@@ -149,3 +149,6 @@ NameVirtualHost *:443
     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."
index 0838a29..e2de1e8 100644 (file)
@@ -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;
index 65d12c0..f5e8c6a 100644 (file)
@@ -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;
+}
+
index f9a8d61..04a3758 100644 (file)
@@ -1,3 +1,8 @@
+[% IF ctx.maintenance_message %]
+<div id="maintenance_message">
+[%= ctx.maintenance_message %]
+</div>
+[% END %]
 [% IF !ctx.is_staff %]
 <div id="header-wrap">
 <div id="header">
index 3325a26..2df9f3e 100644 (file)
@@ -1,31 +1,38 @@
 <body class="tundra">
-       <table width='100%'>
-               <tbody>
-                       <tr>
-                               <td id='main_left_cell'>
-                                       <!--#include virtual="common/logo.xml"-->
-                                       <!--#include virtual="common/sidebar.xml"-->
-                               </td>
-                               <td id='main_right_cell'>
-                                       <div id='content' class=''>
+<!--#if expr="$MAINTENANCE_MESSAGE"-->
+    <div style="padding: 5px; width: 100%; background-color: #f00; color: #fff; text-align: center;">
+        <!--#echo var="MAINTENANCE_MESSAGE"-->
+    </div>
+<!--#endif-->
+    <div style="position:relative;">
+        <table width='100%'>
+            <tbody>
+                <tr>
+                    <td id='main_left_cell'>
+                        <!--#include virtual="common/logo.xml"-->
+                        <!--#include virtual="common/sidebar.xml"-->
+                    </td>
+                    <td id='main_right_cell'>
+                        <div id='content' class=''>
 
-                                               <!--#if expr="$OILS_PAGE!='advanced.xml'"-->
-                                                       <!--#include virtual="common/searchbar.xml"-->
-                                                       <!--#include virtual="common/statusbar.xml"-->
-                                               <!--#endif-->
+                            <!--#if expr="$OILS_PAGE!='advanced.xml'"-->
+                                <!--#include virtual="common/searchbar.xml"-->
+                                <!--#include virtual="common/statusbar.xml"-->
+                            <!--#endif-->
 
-                                               <!--#include virtual="common/fonts.xml"-->
+                            <!--#include virtual="common/fonts.xml"-->
 
-                                               <!--#include virtual="common/altcanvas.xml"-->
-                                               <!--#include virtual="common/ilsevents.xml"--> 
-                                               <!--#include virtual="page_${OILS_PAGE}"-->
-                                       </div>
-                                       <br/>
-                                       <!--#include virtual="common/tips.xml"-->
-                               </td>
-                       </tr>
-               </tbody>
-       </table>
+                            <!--#include virtual="common/altcanvas.xml"-->
+                            <!--#include virtual="common/ilsevents.xml"--> 
+                            <!--#include virtual="page_${OILS_PAGE}"-->
+                        </div>
+                        <br/>
+                        <!--#include virtual="common/tips.xml"-->
+                    </td>
+                </tr>
+            </tbody>
+        </table>
+    </div>
                <!--#include virtual='footer.xml'-->
     <center>
         <div id='gcfPrompt' class='hide_me'>
index c7d20f6..d65a6f7 100644 (file)
@@ -8,6 +8,12 @@
                </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>