LP#1661661: Support for right-to-left (RTL) languages
authorNawras Othman <othman.nawras@gmail.com>
Tue, 7 Feb 2017 11:39:46 +0000 (06:39 -0500)
committerKathy Lussier <klussier@masslnc.org>
Fri, 17 Feb 2017 18:21:44 +0000 (13:21 -0500)
File changes added by Nawras Othman for RTL languages (such as Arabic).

First pass includes moving some remaining inline CSS to the stylesheet file,
Also includes a hard-coded check for the "ar-AR" locale (current Arabic).

Signed-off-by: Nawras Othman <othman.nawras@gmail.com>
Signed-off-by: Ben Shum <ben@evergreener.net>
Signed-off-by: Kathy Lussier <klussier@masslnc.org>
13 files changed:
Open-ILS/src/templates/opac/css/style-rtl.css.tt2 [new file with mode: 0644]
Open-ILS/src/templates/opac/css/style.css.tt2
Open-ILS/src/templates/opac/parts/advanced/global_row.tt2
Open-ILS/src/templates/opac/parts/advanced/search.tt2
Open-ILS/src/templates/opac/parts/anon_list.tt2
Open-ILS/src/templates/opac/parts/base.tt2
Open-ILS/src/templates/opac/parts/login/form.tt2
Open-ILS/src/templates/opac/parts/metarecord_hold_filters.tt2
Open-ILS/src/templates/opac/parts/myopac/main_base.tt2
Open-ILS/src/templates/opac/parts/myopac/prefs_base.tt2
Open-ILS/src/templates/opac/parts/place_hold.tt2
Open-ILS/src/templates/opac/parts/result/paginate.tt2
Open-ILS/web/css/skin/default/opac/semiauto-rtl.css [new file with mode: 0644]

diff --git a/Open-ILS/src/templates/opac/css/style-rtl.css.tt2 b/Open-ILS/src/templates/opac/css/style-rtl.css.tt2
new file mode 100644 (file)
index 0000000..cc14054
--- /dev/null
@@ -0,0 +1,144 @@
+body{direction:rtl;}
+.searchbar{margin-right:1em;}
+div.select-box-wrapper{padding-right:3px;text-align:right;}
+#dash_wrapper{margin-right:0.5em;}
+#logout_link{right:1px;}
+#dash_wrapper #unread_message_count_floater{margin-right:-1.5em;}
+#header-links a{float:right;margin-left:22px;}
+#gold-links{margin-right:1em;padding-right:0px;}
+#gold-links-home{padding-right:0px;}
+#util-bar{margin-right:1em;padding-right:0px;}
+#search-wrapper #breadcrumb{float:right;}
+#search-wrapper #search-within{float:left;right:-173px;}
+#search-wrapper #search-box{margin-right:1em;padding-right:0px;}
+#adv_search_tabs, #acct_tabs, #acct_fines_tabs, #acct_checked_tabs, #acct_holds_tabs, #acct_prefs_tabs, #results_header_inner{margin-right:2px;}
+#adv_search_tabs a, #acct_tabs a, #acct_fines_tabs a, #acct_checked_tabs a, #acct_holds_tabs a, #acct_prefs_tabs a{float:right;margin:10px 0px 0px 7px;-moz-border-radius:10px 10px 0px 0px;border-radius:10px 10px 0px 0px;}
+.adv_filter_block{float:right;}
+.adv_filter_block_item{float:right;}
+#adv_special_block{float:right;}
+#adv_search_submit{margin-right:10px;}
+.checkbox_col{padding-right:10px !important;}
+.rdetail_header{padding:5px 0px 6px 7px;margin-right:1em;}
+.rdetail_result_count{padding-right:1em;}
+.rdetail_result_nav{padding-right:1em;}
+#rdetail_image_cell{padding-left:10px;}
+div.rdetail_uris ul li{right:1em;}
+div#rdetail_actions_div{float:left;}
+span#rdetail_copy_counts{border-left:thin;margin-left:1em;padding-left:1em;}
+span#rdetail_hold_counts p{padding-right:2em;}
+#rdetail_image_div{float:right;margin-left:1em;}
+.rdetail_aux_utils{border-right:1px dotted #ccc;padding-right:17px;padding-left:70px;}
+div.format_icon{float:left;margin-left:17px;}
+.result_util{padding-right:1em;}
+#rdetails_status td{padding:7px 13px 3px 0px;}
+#rdetails_status thead th{padding:13px 13px 13px 0px;text-align:right;}
+#rdetails_status tbody td{padding-right:13px;text-align:right;}
+.rdetail_extras_hr{margin-right:1px;margin-left:1px;}
+##rdetail_extras_expand, #rdetail_extras_collapse, #rdetail_locs_collapse{margin-right:13px;}
+#rdetail_locs_expand, #rdetail_locs_collapse{margin-right:13px;}
+#main-content-home{padding-right:17px;margin-right:1em;}
+#main-content{padding-right:0px;}
+#main-content-after-bar{margin-right:1em;padding-right:4px;}
+#results-side-bar{float:right;margin-left:5px;}
+#main-content .left_brain{padding-right:28px;}
+#main-content .left_brain .input_bg{padding:10px 13px 0px 10px;}
+.login-help-box{float:right;margin-right:2em;}
+.results_header_lbl{float:right;}
+.results_header_sel{float:right;}
+.results_header_nav1{padding:5px 0px 6px 7px;}
+.result_metadata{float:right;padding-left:2em;}
+tr.result_table_row > td.result_table_pic_header{padding-right:1em;}
+.result_number{padding-right:1em;}
+div.result_table_utils_cont{text-align:right;float:right;}
+.zero_search_hits_main{float:right;}
+.zero_search_hits_saved{float:right;margin-left:2em;}
+#lowhits_help{float:left;}
+.results_info_table td{padding-left:10px;}
+#myopac_prefs_div .data_grid td{padding:6px 17px 7px 0px;}
+.header_middle{padding:0px 0px 0px 7px;}
+#acct_sum_block{float:right;clear:right;}
+#myopac_sum_fines{float:left;padding:15px 23px 0px 0px;}
+#myopac_sum_fines_placehold{float:left;}
+.acct_holds_temp td{text-align:right;}
+#acct_checked_tabs .align, #acct_holds_tabs .align, #acct_prefs_tabs .align{float:right;}
+#acct_checked_main_header th, #acct_holds_main_header th, #acct_checked_hist_header th, acct_holds_hist_header th, #acct_list_header th, #acct_list_header_anon th, #temp_list_holds th, #acct_messages_main_header th{text-align:right;}
+.myopac_payments_table th{text-align:right;}
+div#facet_sidebar{float:right;margin-left:1em;}
+.facet_box_temp .header .title{float:right;padding-right:12px;}
+.facet_box_temp .header a.button{float:left;padding-left:6px;}
+.facet_template .count{text-align:left;}
+#footer{margin-right:1em;}
+#acct_prefs_header{float:right;}
+.search_page_nav_link{padding-right:1em;}
+.failure-text{margin-right:4em;}
+#adv_search_refine{padding-right:5em;}
+#account-update-email table td{text-align:right;}
+#hold_editor_table th{text-align:left;padding-left:1em;}
+.fmt-note{padding-right:1em !important;}
+.hold-editor-controls a{padding-right:2em;}
+.text-right{text-align:left;}
+.text-right-top{text-align:left;}
+.expert-search tbody tr th{text-align:left;padding-right:2em;}
+.results-paginator-list{padding-right:1em;}
+.mr_holds_no_formats{margin-right:25px;}
+.results_header_btns, .results_header_sel{float:right;}
+.rdetail-mfhd-type{padding-right:1em;}
+.rdetail_content{margin-right:1.5em;padding-right:1.5em;}
+.rdetail_openurl_entry{margin-right:1em;padding-right:1em;}
+.bookbag-controls-holder .most{padding-right:0;margin-left:5em;}
+.bookbag-specific{margin-right:1em;}
+.bookbag-specific div.sort{float:right;text-align:right;}
+.bookbag-specific div.meta{float:left;text-align:left;}
+table.bookbag-specific{border-left:1px solid #666;}
+.bookbag-share{float:right;}
+.bookbag-controls{float:right;padding:5px 10px 0px 0px;}
+.bookbag-specific td.list_checkbox{padding-right:10px !important;}
+.bookbag-specific td.list_entry{padding-right:5px !important;}
+.float-left{float:right;}
+.float-right{float:left;}
+.saved-searches-header .button{float:left;}
+.saved-searches-header .text{float:right;padding-left:1em;}
+.saved-searches{padding-left:1em;}
+#staff-saved-search{border-left:1px solid #333;}
+.result_item_circulated span{right:3px;}
+.oils_AS_match_term{text-align:right;}
+.oils_AS_match_field{text-align:left;}
+.rdetail-holding-group{margin-right:1.5em;}
+.rdetail-holding-group span{margin-right:1.5em;}
+.rdetail-holding-group .paging{margin-right:1.5em;}
+.ac_tab{float:right;padding-left:10px;}
+#locale_picker_form{float:left;border-left:thin #69A088 solid;}
+.browse-result-sources, .browse-result-authority-bib-links{margin-right:1em;}
+.browse-result-authority-field-name{margin-left:1em;}
+#main-content-register{margin-right:40px;}
+#main-content-register td{text-align:right;}
+#main-content-register td:not(:first-child){padding-right:20px;}
+.patron-reg-invalid{padding-left:10px;}
+.td-left{text-align:right;}
+#adv_global_addrow.td-search-left{text-align:right;}
+@media only screen and (max-width:600px) {
+    #acct_tabs a, #acct_fines_tabs a{-moz-border-radius:6px 6px 0px 0px;border-radius:6px 6px 0px 0px;margin:0px 0px 0px 5px;}
+    #dash_identity a{float:right;}
+    #holds_box form blockquote{margin-right:10px;margin-left:2px;}
+    .result_table_pic_header{padding-right:0px !important;padding-left:5px;}
+    .facet_template .count{padding-right:1em;}
+    #format_actions{float:right;}
+    .search_catalog_lbl{margin-right:0;}
+    #adv_search_tabs a{-moz-border-radius:0px 10px 0px 0px;border-radius:7px 7px 0px 0px;}
+    thead tr{right:-9999px;}
+    table#acct_checked_main_header td, table#acct_holds_main_header td, table#acct_checked_hist_header td, #acct_holds_hist_header td{padding-right:40%;}
+    table#acct_checked_main_header td:before, table#acct_holds_main_header td:before, table#acct_checked_hist_header td:before, #acct_holds_hist_header td_before{right:2px;padding-left:10px;}
+}
+
+/*Inline rules from templates*/
+
+.td-left{text-align:right; width:100%;}
+.td-search-left{text-align:right;}
+.div-left{float: right;} 
+.td-right{text-align:left;}
+.login-form-left{float:right;}
+.hold-div{padding-right: 10px;}
+.padding-left-6{padding-right: 6px;}
+.padding-left-10{padding-right:10px;}
+.padding-left-5{padding-right: 5px;}
+.metarecord_filter_container{float:right;margin-left:10px;}
index e9fccea..864304b 100644 (file)
@@ -2215,3 +2215,28 @@ label[for*=expert_]
   color: [% css_colors.text_badnews %]; 
   padding: 10px;
 }
+
+/*Inline rules from other templates files*/
+
+.td-left{text-align:left; width:100%;}
+.td-search-left{text-align:left;}
+#myopac_summary_div{padding:0px;}
+.div-left{float: left;} 
+.td-right{text-align:right;}
+.login-form-left{float: left; padding-bottom: 10px; margin-right: 40px;}
+.hold-div{padding-left: 10px; padding-bottom: 15px;}
+.hold-span{font-weight: bold;}
+.padding-left-6{padding-left: 6px;}
+.padding-left-10{padding-left:10px;}
+.padding-left-5{padding-left: 5px;}
+
+/* Rules from metarecord_hold_filters.tt2 */
+
+.metarecord_filters{
+      padding: 5px;
+      margin-top: 5px;
+      border-bottom: 1px solid #333;
+      border-top: 1px solid #333; }
+.metarecord_filter_container{float : left;margin-right: 10px;}
+.metarecord_filter_container select{padding: 2px;width: 13em; /* consistent w/ adv search selectors */}
+.metarecord_filter_header{padding-bottom: 5px;}
index 3743047..5310bb6 100644 (file)
@@ -24,7 +24,7 @@
 
 <!-- tag the second row so the bool column won't be hidden -->
 <tr[% IF loop.index == 1 %] id="adv_global_row"[% END %]>
-    <td align='left' width='100%'>
+    <td class="td-left">
 
         <!-- bool selector.  hide for first row.  safe to ignore first bool value in form submission -->
         <select title="[% l('Boolean search operator') %]" 
index 5ea98bf..5491bfb 100644 (file)
@@ -21,7 +21,7 @@
                     [% INCLUDE "opac/parts/advanced/global_row.tt2" %]
                     <!-- add a new row -->
                     <tr id='adv_global_addrow'>
-                        <td align='left'>
+                        <td class="td-search-left">
                             <a href="javascript:;" id="myopac_new_global_row" onclick='addSearchRow();'>[% l('Add Search Row') %]</a>
                         </td>
                     </tr>
index 517e5cd..2cb06fa 100644 (file)
@@ -17,7 +17,7 @@
             <table class="table_no_border_space table_no_cell_pad table_no_border">
                 <thead id="acct_list_header_anon">
                     <tr>
-                        <td width="1%" style="padding-left:10px;">
+                        <td width="1%" class='padding-left-10'>
                             <input type="checkbox" onclick="
                                 var inputs=document.getElementsByTagName('input'); 
                                 for (i = 0; i < inputs.length; i++) { 
                         attrs = {marc_xml => ctx.mylist_marc_xml.$item};
                         PROCESS get_marc_attrs args=attrs %]
                     <tr>
-                        <td class="item_list_padding" style="padding-left: 10px;">
+                        <td class="item_list_padding padding-left-10">
                             <input type="checkbox" name="record" value="[% item %]" />
                         </td>
-                        <td class="item_list_padding" style="padding-left: 5px;"><a href="[% mkurl(ctx.opac_root _ '/record/' _ item, {}, ['edit_notes', 'id']) %]">[% attrs.title | html %]</a></td>
-                        <td class="item_list_padding" style="padding-left: 5px;"><a href="[%- 
+                        <td class="item_list_padding padding-left-5" ><a href="[% mkurl(ctx.opac_root _ '/record/' _ item, {}, ['edit_notes', 'id']) %]">[% attrs.title | html %]</a></td>
+                        <td class="item_list_padding padding-left-5"><a href="[%- 
                             authorquery = attrs.author | replace('[,\.:;]', '');
                             mkurl(
                                 ctx.opac_root _ '/results',
@@ -61,7 +61,7 @@
                                 ['page', 'id', 'edit_notes']
                             )
                         -%]">[% attrs.author | html %]</a></td>
-                        <td class="item_list_padding" style="padding-left: 5px;">
+                        <td class="item_list_padding padding-left-5">
                         [% 
                             copy = attrs.holdings.0;
                             IF copy;
index 1a3a979..2f25e51 100644 (file)
         <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" />
+        [%- IF  ctx.locale  == "ar_ar" %]
+        <link rel="stylesheet" type="text/css" href="[% ctx.opac_root %]/css/style-rtl.css" />
+        <link rel="stylesheet" type="text/css" href="[% ctx.media_prefix %]/css/skin/default/opac/semiauto-rtl.css"$
+       [% END %]        
+        
         [%- libname = ctx.get_aou(ctx.search_ou).name;
             libname = libname | html;
             libsname = ctx.get_aou(ctx.search_ou).shortname; %]
index 19319fa..23e38c6 100644 (file)
 </div>
 [% END %]
 
-<div id='login-form-box' class='login_boxes left_brain' style='float:left'>
+<div id='login-form-box' class='login_boxes left_brain float-left'>
     <h1>[% l('Log in to Your Account') %]</h1>
     [% l('Please enter the following information:') %]
     <form method='post'>
-        <div style="float: left; padding-bottom: 10px; margin-right: 40px;">
+        <div class='login-form-left'>
             <label for='username_field' class="lbl1" >[% l('Library Card Number or Username') %]</label>
             <div class="input_bg">
                 <input type='text' id="username_field" name="username" autofocus />
@@ -25,7 +25,7 @@
             <div class="lbl2">[% l('Please include leading zeros.') %]</div>
             <div class="lbl2">[% l('Example: 0026626051') %]</div>
         </div>
-        <div style="float: left;">
+        <div class='float-left'>
             <label for="password_field" class="lbl1" >[% l('PIN Number or Password') %]</label>
             <div class="input_bg">
                 <input id="password_field" name="password" type="password" />
index be444e8..cb2e36a 100644 (file)
@@ -4,24 +4,7 @@ limiting the set of desired records for a given metarecord.
 %]
 
 <style>
-  /* TODO: MOVE ME */
-  .metarecord_filters {
-      padding: 5px;
-      margin-top: 5px;
-      border-bottom: 1px solid #333;
-      border-top: 1px solid #333;
-  }
-  .metarecord_filter_container {
-    float : left;
-    margin-right: 10px;
-  }
-  .metarecord_filter_container select {
-    padding: 2px;
-    width: 13em; /* consistent w/ adv search selectors */
-  }
-  .metarecord_filter_header {
-    padding-bottom: 5px;
-  }
+  /* The rules has been moved to style.css  */
 </style>
 
 [% BLOCK metarecord_hold_filters_selector;
index bf84e80..16ad59b 100644 (file)
@@ -3,9 +3,9 @@
     WRAPPER "opac/parts/myopac/base.tt2";
 %]
 
-<div id='myopac_summary_div' style="padding:0px;">
+<div id='myopac_summary_div'>
 
-    <div style="float:left;">
+    <div class='div-left'>
         <div class="header_middle">[% l('Account Summary') %]</div>
     </div>
 
             <table class="acct_sum_table" title="[% l('Account Summary') %]">
                 <tr>
                     <td>[% l("Account Expiration Date") %]</td>
-                    <td align="right">
+                    <td class='td-right'>
                         [% date.format(ctx.parse_datetime(ctx.user.expire_date), DATE_FORMAT) %]
                     </td>
                 </tr>
                 <tr>
                     <td>[% l("Items Currently Checked out ([_1])", ctx.user_stats.checkouts.total_out) %]</td>
-                    <td align="right">
+                    <td class='td-right'>
                         <a href="[% mkurl(ctx.opac_root _ '/myopac/circs') %]"
                             title="[% l('View My Checked Out Items') %]">
                             [% l("View All") %]
@@ -55,7 +55,7 @@
                 </tr>
                 <tr>
                     <td>[% l('Items Currently on Hold ([_1])', ctx.user_stats.holds.total) %]</td>
-                    <td align="right">
+                    <td class='td-right'>
                         <a href="[% mkurl(ctx.opac_root _ '/myopac/holds') %]"
                             title="[% l('View My Holds') %]">
                             [% l('View All') %]
@@ -64,7 +64,7 @@
                 </tr>
                 <tr>
                     <td>[% l('Items ready for pickup ([_1])', ctx.user_stats.holds.ready) %]</td>
-                    <td align="right">
+                    <td class='td-right'>
                         <a href="[% mkurl(ctx.opac_root _ '/myopac/holds', {available => 1}) %]"
                             title="[% l('View My Holds Ready for Pickup') %]">
                             [% l('View All') %]
index c8c26f0..cdf936f 100644 (file)
@@ -12,7 +12,7 @@
 
 <div id='myopac_prefs_div'>
     <div id="acct_prefs_tabs">
-        <div style="float:left;">
+        <div class='float-left'>
                 [%- FOREACH page IN acct_prefs_pages;
                     IF page.url == prefs_page;
                         cls_select = "align selected";
index 8b898d8..8bf1713 100644 (file)
@@ -92,9 +92,9 @@
                     </div>
                     [% IF hdata.parts AND !this_hold_disallowed %]
                         [% IF hdata.parts.size > 0 %]
-                        <div style='padding-left: 10px; padding-bottom: 15px;'>
+                        <div class='hold-div'>
                             [% IF enable.radio.parts == 'true' %]
-                                <span style='font-weight: bold;'><label for='select_hold_part'>[%
+                                <span class='hold-span'><label for='select_hold_part'>[%
                                l('Select a Part:')
                                %]</label></span>
                              <div class='radio-parts-selection'>
index 86de798..2130759 100644 (file)
@@ -7,7 +7,7 @@
                 '<span class="result_count_number">' _ ctx.hit_count _ '</span>')  ~%]
                 Results [_1] - [_2] of about [_3]
                 [%~ END %]
-                <span style='padding-left: 6px;'>
+                <span class='padding-left-6'>
                     [%~ |l('<span class="result_count_number">' _ (page + 1) _ '</span>',
                     '<span class="result_count_number">' _ page_count _ '</span>') ~%]
                     (page [_1] of [_2])
diff --git a/Open-ILS/web/css/skin/default/opac/semiauto-rtl.css b/Open-ILS/web/css/skin/default/opac/semiauto-rtl.css
new file mode 100644 (file)
index 0000000..dd065e2
--- /dev/null
@@ -0,0 +1,40 @@
+.qtype_selector_margin {
+    margin-left: 7px;
+}
+.item_list_padding {
+    padding: 8px 0px 6px 0px;
+}
+.opac-auto-108 {
+    padding-right: 5px;
+}
+#search-box table {
+    right: -10px;
+}
+#util_back_btn {
+    right: 10px;
+}
+#util_help_btn {
+    right: 40px;
+}
+#util_forw_btn {
+    right: 50px;
+}
+#util_home_btn {
+    right: 20px;
+}
+#util_print_btn {
+    right: 30px;
+}
+.opac-auto-161 {
+    text-align: left;
+    padding-left: 7px;
+}
+.opac-auto-164 {
+    padding-right: 5px;
+}
+.selector_actions_for_list {
+    margin-left: 11px;
+}
+.selector_actions_for_list_inner_option {
+    margin-right: 2em;
+}