Bug 8061: RTL CSS overrides (OPAC)
authorD Ruth Bavousett <druthb@gmail.com>
Fri, 5 Apr 2013 14:58:33 +0000 (17:58 +0300)
committerJared Camins-Esakov <jcamins@cpbibliography.com>
Sun, 7 Apr 2013 16:51:54 +0000 (12:51 -0400)
This patch repairs a few things in templates and CSS to allow
for the injection of right-to-left CSS, also in this patch.
It should apply to 3.8 and master.

To test, install and enable a right-to-left language for the
OPAC, currently Hebrew or Arabic.
The Arabic OPAC translations for 3.6 are mostly-complete, so
they are a good test case.

It's helpful to have a reader of the language handy, but the
layout should be easy enough to figure out, even for
non-readers.

Signed-off-by: Karam Qubsi <karamqubsi@gmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Amended patch adding back author and adding sign off.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
koha-tmpl/opac-tmpl/prog/en/css/right-to-left.css [new file with mode: 0644]
koha-tmpl/opac-tmpl/prog/en/includes/doc-head-close.inc
koha-tmpl/opac-tmpl/prog/en/modules/opac-addbybiblionumber.tt
koha-tmpl/opac-tmpl/prog/en/modules/opac-review.tt

diff --git a/koha-tmpl/opac-tmpl/prog/en/css/right-to-left.css b/koha-tmpl/opac-tmpl/prog/en/css/right-to-left.css
new file mode 100644 (file)
index 0000000..141fcc8
--- /dev/null
@@ -0,0 +1,184 @@
+/* Adjust text directions */
+body,
+body #doc,
+#doc2,
+#doc3,
+#doc4,
+.yui-t1,
+.yui-t2,
+.yui-t3,
+.yui-t4,
+.yui-t5,
+.yui-t6,
+.yui-t7
+{
+   text-align:right;
+   direction: rtl;
+}
+
+caption,
+table#marc th
+{
+   text-align: right;
+}
+
+/* Swap floats */
+
+body#advsearch #cartmenulink,
+body#advsearch #listsmenulink,
+#renewcontrols,
+.commentline .avatar,
+.resort,
+.yui-t1 #yui-main,
+.yui-t2 #yui-main,
+.yui-t3 #yui-main
+{
+   float: left;
+}
+
+div.lang,
+fieldset.rows label,
+fieldset.rows span.label,
+#auth,
+#bookcover,
+.left,
+.nav_results ul.pg_menu li,
+.ui-tabs-nav li,
+.yui-g div.first,
+.yui-gc div.first,
+.yui-gc div.first div.first,
+.yui-gd div.first,
+.yui-ge div.first,
+.yui-gf div.first,
+.yui-t1 .yui-b
+{
+   float: right;
+}
+
+h1#libraryname
+{
+   float: right !important;
+}
+
+#fluid-offset
+{
+   float: none;
+}
+
+/* Adjust margins, padding, alignment and table-element widths */
+
+div#menu li a
+{
+   margin-left: -1px;
+}
+
+.yui-t1 #yui-main,
+.yui-t1 #yui-main .yui-b,
+.yui-t2 #yui-main,
+.yui-t3 #yui-main
+{
+   margin-left: 0;
+}
+
+h1,
+h2,
+h3,
+h4,
+h5,
+h6
+{
+   margin-left: 0.5em;
+}
+
+.results_summary .label
+{
+   margin-left: 0.5em;
+}
+
+ul li
+{
+   margin-right: 1.5em;
+}
+
+ul.pg_menu li,
+.author,
+.nav_results
+{
+   margin-right: 0.5em;
+}
+
+#usershowreviews
+{
+   margin-right: 15em;
+}
+
+#moresearches
+{
+   margin: .6em 10em .3em 0;
+}
+
+#menu ul
+{
+   padding-left:0;
+}
+
+#custom-doc,
+#opac-main-search
+{
+   padding-right: 2em;
+}
+
+.nav_results .l_Results a
+{
+   padding: 8px 3px 8px 28px;
+}
+
+body#advsearch #moresearches
+{
+   clear:none;
+}
+
+span.koha_url
+{
+   left: 2em;
+   right:auto;
+}
+
+.yui-u first
+{
+   right: 15em;
+}
+
+table#marc td:first-child
+{
+   width: 15em;
+}
+
+.yui-t1 #yui-main,
+.yui-t2 #yui-main,
+.yui-t3 #yui-main {
+   width: 80%;
+}
+
+/* Borders */
+
+div#menu {
+   border-right: 0;
+   border-left: 1px solid #979797;
+}
+
+#menu ul li.active a {
+   border-left: 0;
+   border-right: 1px solid #979797;
+}
+
+/* flip over breadcrumb image */
+
+h3 img {
+        -moz-transform: scaleX(-1);
+        -o-transform: scaleX(-1);
+        -webkit-transform: scaleX(-1);
+        transform: scaleX(-1);
+        filter: FlipH;
+        -ms-filter: "FlipH";
+}
index 45424e8..147b82c 100644 (file)
@@ -24,6 +24,9 @@
  <link rel="stylesheet" type="text/css" href="[% themelang %]/css/persona-buttons.css" />
 [% END %]
 [% IF ( OPACMobileUserCSS ) %]<style type="text/css" media="screen and (max-width:700px)">[% OPACMobileUserCSS %]</style>[% END %]
+[% IF ( bidi ) %]
+    <link rel="stylesheet" type="text/css" href="[% themelang %]/css/right-to-left.css" />
+[% END %]
 [% IF ( OPACUserCSS ) %]<style type="text/css">[% OPACUserCSS %]</style>[% END %]
 <!-- yui js --> 
 <script type="text/javascript" src="[% yuipath %]/utilities/utilities.js"></script> 
index a1e1f9b..566a18f 100644 (file)
@@ -1,9 +1,9 @@
 [% INCLUDE 'doc-head-open.inc' %]
 [% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog &rsaquo; Add to your list
-[% INCLUDE 'doc-head-close.inc' %]
 <style type="text/css">
    #custom-doc { width:34.62em;*width:33.78em;min-width:450px; margin:auto; margin-top: .4em;text-align:left; }
    </style>
+[% INCLUDE 'doc-head-close.inc' %]
 </head>
 <body id="addtolist">
 <div id="custom-doc" class="yui-t7">
index 4198701..3df04b4 100644 (file)
@@ -1,8 +1,8 @@
 [% INCLUDE 'doc-head-open.inc' %][% LibraryNameTitle or "Koha online" %] catalog &rsaquo; Comments on [% title |html %]
-[% INCLUDE 'doc-head-close.inc' %]
 <style type="text/css">
   #custom-doc { width:37.08em;*width:36.16em;min-width:485px; margin:1em auto; text-align:left; }
 </style>
+[% INCLUDE 'doc-head-close.inc' %]
 <script type="text/javascript">
 //<![CDATA[
         $(document).ready(function() {