From 4566e5d1cb9edb2ff34ebf61152320aef5edaaed Mon Sep 17 00:00:00 2001 From: D Ruth Bavousett Date: Thu, 3 May 2012 06:41:36 -0700 Subject: [PATCH] Bug 8061: RTL CSS overrides (OPAC) 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. --- koha-tmpl/opac-tmpl/prog/en/css/opac.css | 1 + koha-tmpl/opac-tmpl/prog/en/css/right-to-left.css | 184 ++++++++++++++++++++ .../opac-tmpl/prog/en/includes/doc-head-close.inc | 3 + .../prog/en/modules/opac-addbybiblionumber.tt | 2 +- koha-tmpl/opac-tmpl/prog/en/modules/opac-review.tt | 2 +- 5 files changed, 190 insertions(+), 2 deletions(-) create mode 100644 koha-tmpl/opac-tmpl/prog/en/css/right-to-left.css diff --git a/koha-tmpl/opac-tmpl/prog/en/css/opac.css b/koha-tmpl/opac-tmpl/prog/en/css/opac.css index 21dc08f..50f00a7 100644 --- a/koha-tmpl/opac-tmpl/prog/en/css/opac.css +++ b/koha-tmpl/opac-tmpl/prog/en/css/opac.css @@ -2055,6 +2055,7 @@ div.ft { #recentcomments { margin:auto; max-width:750px; + float:right; } .searchresults .commentline { 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 index 0000000..7c660a5 --- /dev/null +++ b/koha-tmpl/opac-tmpl/prog/en/css/right-to-left.css @@ -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"; +} diff --git a/koha-tmpl/opac-tmpl/prog/en/includes/doc-head-close.inc b/koha-tmpl/opac-tmpl/prog/en/includes/doc-head-close.inc index 15bea79..653f2a1 100644 --- a/koha-tmpl/opac-tmpl/prog/en/includes/doc-head-close.inc +++ b/koha-tmpl/opac-tmpl/prog/en/includes/doc-head-close.inc @@ -15,6 +15,9 @@ [% END %] +[% IF ( bidi ) %] + +[% END %] [% IF ( OPACUserCSS ) %][% END %] diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-addbybiblionumber.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-addbybiblionumber.tt index f6479f9..7ce4c52 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-addbybiblionumber.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-addbybiblionumber.tt @@ -1,9 +1,9 @@ [% INCLUDE 'doc-head-open.inc' %] [% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha Online[% END %] Catalog › Add to Your List -[% INCLUDE 'doc-head-close.inc' %] +[% INCLUDE 'doc-head-close.inc' %]
diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-review.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-review.tt index 57d098e..0387502 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-review.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-review.tt @@ -1,8 +1,8 @@ [% INCLUDE 'doc-head-open.inc' %][% LibraryNameTitle or "Koha Online" %] Catalog › Comments on [% title %] -[% INCLUDE 'doc-head-close.inc' %] +[% INCLUDE 'doc-head-close.inc' %]