LP#1691009 Cache the RTL and LTR stylesheets
authorDan Scott <dscott@laurentian.ca>
Thu, 27 Apr 2017 19:31:39 +0000 (15:31 -0400)
committerGalen Charlton <gmc@equinoxinitiative.org>
Fri, 28 Apr 2017 14:18:24 +0000 (10:18 -0400)
To allow browsers to cache the correct version of the stylesheet, append a GET
param indicating the direction.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
Signed-off-by: Ben Shum <ben@evergreener.net>
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>

Open-ILS/src/templates/opac/parts/base.tt2

index 6a78bcc..8d7b07d 100644 (file)
@@ -10,7 +10,9 @@
         [% END %]
         <meta name = "viewport" content = "initial-scale = 1.0">
         <link rel="stylesheet" type="text/css" href="[% ctx.media_prefix %]/css/skin/default/opac/semiauto.css" />
-        <link rel="stylesheet" type="text/css" href="[% ctx.opac_root %]/css/style.css" />
+        <link rel="stylesheet" type="text/css" href="[% ctx.opac_root %]/css/style.css?dir=[%
+          IF ctx.get_i18n_l(ctx.eg_locale).rtl == 't' %]rtl[%
+          ELSE %]ltr[% END %]" />
         [% IF ctx.get_i18n_l(ctx.eg_locale).rtl == 't' %]
         <link rel="stylesheet" type="text/css" href="[% ctx.media_prefix %]/css/skin/default/opac/semiauto-rtl.css" />
         [% END %]