Replace non-functional images with CSS styled text
authorDan Scott <dan@coffeecode.net>
Fri, 16 Mar 2012 02:38:06 +0000 (22:38 -0400)
committerDan Scott <dan@coffeecode.net>
Fri, 16 Mar 2012 02:38:06 +0000 (22:38 -0400)
The plus-sign and minus-sign images, used only for showing more or fewer
copies, did not actually do anything when you clicked on them. In
addition, they can be reasonably represented as plain text + CSS, saving
an extra HTTP request per copy detail page that has more than 10 copies.

Moving the text + CSS into the <A> tag also makes them clickable, which
is kind of nice. And, being CSS, it's easy to change the colour scheme
to suit a different site.

Signed-off-by: Dan Scott <dan@coffeecode.net>
Open-ILS/src/templates/opac/parts/record/copy_table.tt2
Open-ILS/web/css/skin/default/opac/style.css
Open-ILS/web/images/minus_sign.png [deleted file]
Open-ILS/web/images/plus_sign.png [deleted file]

index 240f970..71e5502 100644 (file)
@@ -125,13 +125,13 @@ END;
                 [%- more_copies_limit = 50 %] [%# TODO: config %]
                 [%- IF  ctx.copy_limit != more_copies_limit AND ctx.copies.size >= ctx.copy_limit %]
                     <div class="rdetail_show_copies">
-                        <img src="[% ctx.media_prefix %]/images/plus_sign.png" />
-                        <a href="[% mkurl('', {copy_limit => more_copies_limit, copy_offset => 0}) %]">[% l('Show more copies') %]</a>
+                        <a href="[% mkurl('', {copy_limit => more_copies_limit, copy_offset => 0}) %]"><span
+                        class="charsign">+</span>[% l('Show more copies') %]</a>
                     </div>
                 [%- ELSIF ctx.copy_limit == more_copies_limit %]
                     <div  class="rdetail_show_copies">
-                        <img src="[% ctx.media_prefix %]/images/minus_sign.png" />
-                        <a href="[% mkurl('', {copy_limit => 0, copy_offset => 0}) %]">[% l('Show fewer copies') %]</a>
+                        <a href="[% mkurl('', {copy_limit => 0, copy_offset => 0}) %]"><span
+                        class="charsign">-</span>[% l('Show fewer copies') %]</a>
                     </div>
                 [%- END %]
             </td>
index 10dacd9..8591c8e 100644 (file)
@@ -1406,3 +1406,15 @@ table.result_holdings_table thead tr {
 table.result_holdings_table thead tr th {
     font-weight: bold;
 }
+.charsign {
+    vertical-align: middle;
+    font-weight: bold;
+    padding: 5px 10px;
+    margin: .5em;
+    color: white;
+    background-color: #00593d;
+    border-radius: 4px;
+}
+a.charsign, a.charsign:hover {
+    text-decoration: none
+}
diff --git a/Open-ILS/web/images/minus_sign.png b/Open-ILS/web/images/minus_sign.png
deleted file mode 100644 (file)
index 553efcf..0000000
Binary files a/Open-ILS/web/images/minus_sign.png and /dev/null differ
diff --git a/Open-ILS/web/images/plus_sign.png b/Open-ILS/web/images/plus_sign.png
deleted file mode 100644 (file)
index 1f12d14..0000000
Binary files a/Open-ILS/web/images/plus_sign.png and /dev/null differ