From: Dan Scott <dan@coffeecode.net>
Date: Mon, 9 Jan 2012 02:04:37 +0000 (-0500)
Subject: TPAC: Regular justification of columns in search result
X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=6f81e39a6e4ba459fbfa8f66dcb486803d1b0e16;p=evergreen%2Fpines.git

TPAC: Regular justification of columns in search result

The search results page was constituted via a table, enclosing one table
per row for each result, enclosing one further table per result for the
attributes such as call number / publisher / edition that have been
chosen to be displayed in the simple and detailed views.

The column widths for each search result row were being calculated per
result, with the effect that title columns were starting at different
offsets - a rather unpolished effect.

By eliminating the middle table, we can let the widths be determined by
all of the search result rows together, providing a normalized result as
the HTML deities intended.

We also move some inline CSS into style.css.

Note that IE 7, at least, ignores the :nth-child() usage to deliver the
borders; because we no longer wrap the set of rows (including optional
Content Cafe and ChiliFresh rows) in an intermediate table, we had to
switch to a border-top attribute. We could have gone with a straight "tr
> td" approach, but that would have added a line at the top of the first
result, which looked weird. Still an option if one really wants to.

Signed-off-by: Dan Scott <dan@coffeecode.net>
Signed-off-by: Dan Wells <dbw2@calvin.edu>
---

diff --git a/Open-ILS/src/templates/opac/parts/result/table.tt2 b/Open-ILS/src/templates/opac/parts/result/table.tt2
index 36a4e769f0..4bb8f85ce3 100644
--- a/Open-ILS/src/templates/opac/parts/result/table.tt2
+++ b/Open-ILS/src/templates/opac/parts/result/table.tt2
@@ -32,23 +32,17 @@
                             attrs = {marc_xml => rec.marc_xml};
                             PROCESS get_marc_attrs args=attrs %]
                         <tr class="result_table_row">
-                            <td class="result_table_row" align='left' width='100%'>
-                                <table cellpadding="0" cellspacing="0" class='result_table_subtable'>
-                                    <tbody class='result_table_subtbody'>
-                                        <tr name='counts_row'>
-                                            <td valign="top" class="results_row_count"
-                                                name="results_row_count">[%
+                                            <td class="results_row_count" name="results_row_count">[%
                                                     result_count; result_count = result_count + 1
                                                 %].</td>
-                                            <td class='result_table_pic_header' align='center'
-                                                width="78" nowrap="nowrap" valign="top">
+                                            <td class='result_table_pic_header'>
                                                 [% ident = attrs.isbn_clean || attrs.upc; IF ident; %]
                                                 <a href="[% mkurl(ctx.opac_root _ '/record/' _ rec.id) %]"><img alt="[% l('Image of item') %]"
                                                         name='item_jacket' class='result_table_pic' width="55"
                                                         src='[% ctx.media_prefix %]/opac/extras/ac/jacket/small/[% ident | uri %]' /></a><br />
                                                 [% END %]
                                             </td>
-                                            <td class='result_table_title_cell' name='result_table_title_cell' valign="top">
+                                            <td class='result_table_title_cell' name='result_table_title_cell'>
                                                 <div class="bold">
                                                     <a name='record_[% rec.id %]' name='item_title'
                                                         href="[% mkurl(ctx.opac_root _ '/record/' _ rec.id) %]"
@@ -250,8 +244,8 @@
                                                     </div>
                                                 </div>
                                             </td>
-                                        </tr>
                                         [%- IF ENV.OILS_CHILIFRESH_ACCOUNT %]
+                                        </tr>
                                         <tr>
                                             <td/>
                                             <td align='center'> <!-- Chilifresh reviews link --> 
@@ -265,9 +259,6 @@
                                             </td>
                                         </tr>
                                         [%- END %]
-                                    </tbody>
-                                </table>
-                            </td>
                         </tr>
                     [% END %]
                     </tbody>
diff --git a/Open-ILS/web/css/skin/default/opac/style.css b/Open-ILS/web/css/skin/default/opac/style.css
index 62eb298246..a9876eb65b 100644
--- a/Open-ILS/web/css/skin/default/opac/style.css
+++ b/Open-ILS/web/css/skin/default/opac/style.css
@@ -719,8 +719,20 @@ div.format_icon {
 	margin-top: 1em;
 }
 
-tr.result_table_row td.result_table_row {
-    border-bottom:1px solid #d4d4d4;
+tr.result_table_row > td.results_row_count,
+tr.result_table_row > td.result_table_pic_header,
+tr.result_table_row > td.result_table_title_cell {
+    vertical-align: top;
+}
+
+tr.result_table_row:nth-child(n+2) > td {
+    border-top: 1px solid #d4d4d4;
+}
+
+tr.result_table_row > td.result_table_pic_header {
+    white-space: nowrap;
+    width: 78px;
+    padding-left: 1em;
 }
 
 .result_numbers {
@@ -751,10 +763,6 @@ div.result_place_hold {
 	text-transform:capitalize;
 }
 
-.result_table_title_cell {
-	padding-left: 7px;
-}
-
 #myopac_summary_div p {
 	margin:0;
 	margin-bottom: 10px;