Bug 10052 Followup for edithelp.tt and help-top.inc
authorMarcel de Rooy <m.de.rooy@rijksmuseum.nl>
Mon, 15 Apr 2013 11:01:45 +0000 (13:01 +0200)
committerGalen Charlton <gmc@esilibrary.com>
Thu, 23 May 2013 15:55:11 +0000 (08:55 -0700)
A grep on the stylesheet names revealed that similar code was used in those
template files.
This patch moves the code from doc-head-close.inc to a new include file.
Now, doc-head-close and the help templates refer to that one file.

Test plan:
If you tested the preceding two patches, now you only need to:
1) Check included css via page source in browser from staff main page.
2) Check it also from some other location.
3) Check again from Help: e.g. /cgi-bin/koha/help.pl
4) Check again from Edit Help: /cgi-bin/koha/edithelp.pl

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Template only, no string changes.
Tested according to test plan.
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
koha-tmpl/intranet-tmpl/prog/en/includes/doc-head-close.inc
koha-tmpl/intranet-tmpl/prog/en/includes/help-top.inc
koha-tmpl/intranet-tmpl/prog/en/includes/intranetstylesheet.inc [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/en/modules/help/edithelp.tt

index 2def80d..8db3b2a 100644 (file)
@@ -3,12 +3,7 @@
 <link rel="stylesheet" type="text/css" href="[% interface %]/lib/jquery/jquery-ui.css" />
 <link rel="stylesheet" type="text/css" href="[% interface %]/lib/bootstrap/bootstrap.min.css" />
 <link rel="stylesheet" type="text/css" media="print" href="[% themelang %]/css/print.css" />
-[% SET intranetstylesheet='staff-global.css' UNLESS intranetstylesheet %]
-[% IF (intranetstylesheet.match('^https?:|^\/')) %]
-    <link rel="stylesheet" type="text/css" href="[% intranetstylesheet %]" />
-[% ELSE %]
-    <link rel="stylesheet" type="text/css" href="[% themelang %]/css/[% intranetstylesheet %]" />
-[% END %]
+[% INCLUDE intranetstylesheet.inc %]
 [% IF ( bidi ) %]
    <link rel="stylesheet" type="text/css" href="[% themelang %]/css/right-to-left.css" />
 [% END %]
     <link rel="stylesheet" type="text/css" href="[% themelang %]/css/wizard.css" />
 [% END %]
 
-<!-- local colors -->
-[% IF ( intranetcolorstylesheet ) %]
-    [% IF (intranetcolorstylesheet.match('^https?:|^\/')) %]
-        <link rel="stylesheet" type="text/css" href="[% intranetcolorstylesheet %]" />
-    [% ELSE %]
-        <link rel="stylesheet" type="text/css" href="[% themelang %]/css/[% intranetcolorstylesheet %]" />
-    [% END %]
-[% END %]
-
 <!-- yui js --> 
 <script type="text/javascript" src="[% yuipath %]/utilities/utilities.js"></script> 
 <script type="text/javascript" src="[% yuipath %]/button/button-min.js"></script> 
index 72acc21..a530854 100644 (file)
@@ -4,21 +4,13 @@
 <link rel="shortcut icon" href="[% IF ( IntranetFavicon ) %][% IntranetFavicon %][% ELSE %][% themelang %]/includes/favicon.ico[% END %]" type="image/x-icon" />
 <link rel="stylesheet" type="text/css" href="[% interface %]/lib/jquery/jquery-ui.css" />
 <link rel="stylesheet" type="text/css" media="print" href="[% themelang %]/css/print.css" />
-[% IF ( intranetstylesheet ) %]
-<link rel="stylesheet" type="text/css" href="[% intranetstylesheet %]" />
-[% ELSE %]
-<link rel="stylesheet" type="text/css" href="[% themelang %]/css/staff-global.css" />
-[% END %]
+[% INCLUDE intranetstylesheet.inc %]
 [% IF ( bidi ) %]
    <link rel="stylesheet" type="text/css" href="[% themelang %]/css/right-to-left.css" />
 [% END %]
 <script type="text/javascript" src="[% interface %]/lib/jquery/jquery.js"></script>
 <script type="text/javascript" src="[% interface %]/lib/jquery/jquery-ui.js"></script>
 <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.hotkeys.min.js"></script>
-<!-- local colors -->
-[% IF ( intranetcolorstylesheet ) %]
-<link rel="stylesheet" type="text/css" href="[% themelang %]/css/[% intranetcolorstylesheet %]" />
-[% END %]
 <!-- yui js --> 
 <script type="text/javascript" src="[% yuipath %]/utilities/utilities.js"></script> 
 <script type="text/javascript" src="[% yuipath %]/button/button-min.js"></script> 
diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/intranetstylesheet.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/intranetstylesheet.inc
new file mode 100644 (file)
index 0000000..8c5af96
--- /dev/null
@@ -0,0 +1,15 @@
+[% SET intranetstylesheet='staff-global.css' UNLESS intranetstylesheet %]
+[% IF (intranetstylesheet.match('^https?:|^\/')) %]
+    <link rel="stylesheet" type="text/css" href="[% intranetstylesheet %]" />
+[% ELSE %]
+    <link rel="stylesheet" type="text/css" href="[% themelang %]/css/[% intranetstylesheet %]" />
+[% END %]
+
+<!-- local colors -->
+[% IF ( intranetcolorstylesheet ) %]
+    [% IF (intranetcolorstylesheet.match('^https?:|^\/')) %]
+        <link rel="stylesheet" type="text/css" href="[% intranetcolorstylesheet %]" />
+    [% ELSE %]
+        <link rel="stylesheet" type="text/css" href="[% themelang %]/css/[% intranetcolorstylesheet %]" />
+    [% END %]
+[% END %]
index fd274a2..734bf0d 100644 (file)
@@ -21,14 +21,7 @@ tinyMCE.init({
 });
 //]]>
 </script>
-[% IF ( intranetstylesheet ) %]
-    <link rel="stylesheet" type="text/css" href="[% intranetstylesheet %]" />
-[% ELSE %]
-    <link rel="stylesheet" type="text/css" href="[% themelang %]/css/staff-global.css" />
-[% END %]
-[% IF ( intranetcolorstylesheet ) %]
-    <link rel="stylesheet" type="text/css" href="[% themelang %]/css/[% intranetcolorstylesheet %]" />
-[% END %]
+[% INCLUDE intranetstylesheet.inc %]
 <link rel="stylesheet" type="text/css" href="[% themelang %]/css/help.css" />
 </head>
 <body id="help">