From 2880e76e8f18c3f692545986e5cdfa7da9d98350 Mon Sep 17 00:00:00 2001 From: D Ruth Bavousett Date: Fri, 5 Apr 2013 17:58:33 +0300 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. Signed-off-by: Karam Qubsi Signed-off-by: Katrin Fischer Amended patch adding back author and adding sign off. Signed-off-by: Katrin Fischer Signed-off-by: Jared Camins-Esakov --- .../opac-tmpl/prog/en/css/right-to-left.css | 184 ++++++++++++++++++ .../prog/en/includes/doc-head-close.inc | 3 + .../prog/en/modules/opac-addbybiblionumber.tt | 2 +- .../opac-tmpl/prog/en/modules/opac-review.tt | 2 +- 4 files changed, 189 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/right-to-left.css b/koha-tmpl/opac-tmpl/prog/en/css/right-to-left.css new file mode 100644 index 0000000000..141fcc843f --- /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 45424e8d77..147b82ce0e 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 @@ -24,6 +24,9 @@ [% END %] [% IF ( OPACMobileUserCSS ) %][% 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 a1e1f9b82e..566a18f342 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 4198701be1..3df04b4995 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 |html %] -[% INCLUDE 'doc-head-close.inc' %] +[% INCLUDE 'doc-head-close.inc' %]