[open-ils-commits] [GIT] Evergreen ILS branch master updated. 04ba0cb4b666ecca4fa53c08ea42ed7a9e2b7771

Evergreen Git git at git.evergreen-ils.org
Thu May 18 12:17:51 EDT 2017


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, master has been updated
       via  04ba0cb4b666ecca4fa53c08ea42ed7a9e2b7771 (commit)
      from  997e45aa27126442f1e3441a8b4d4e734a1fe365 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 04ba0cb4b666ecca4fa53c08ea42ed7a9e2b7771
Author: Jason Boyer <jboyer at library.in.gov>
Date:   Tue Feb 21 16:31:31 2017 -0500

    LP1274999: Next Link Appears at "End" of Copy List
    
    The total number of copies wasn't checked against the
    copy_limit and copy_offset, so anytime that the
    number of copies per page mod copy_limit == 0 the
    Next link would appear, even if there were only
    copy_limit copies total. Now the offset and limit are
    compared to the total number of copies available at
    the current depth to determine if the Next link
    should appear.
    
    Signed-off-by: Jason Boyer <jboyer at library.in.gov>
    Signed-off-by: Jason Etheridge <jason at esilibrary.com>

diff --git a/Open-ILS/src/templates/opac/parts/record/copy_table.tt2 b/Open-ILS/src/templates/opac/parts/record/copy_table.tt2
index c6ab1aa..3d4dae4 100644
--- a/Open-ILS/src/templates/opac/parts/record/copy_table.tt2
+++ b/Open-ILS/src/templates/opac/parts/record/copy_table.tt2
@@ -25,7 +25,11 @@ FOREACH copy_info IN copies;
     END;
 END;
 -%]
-[%- IF has_copies; %]
+[%-
+IF has_copies; 
+  depth = CGI.param('copy_depth').defined ? CGI.param('copy_depth') : CGI.param('depth').defined ? CGI.param('depth') : ctx.copy_summary.last.depth;
+  total_copies = ctx.copy_summary.$depth.count;
+%]
 <table class="table_no_border_space table_no_cell_pad table_no_border" width="100%" id="rdetails_status">
     <thead>
         <tr>
@@ -256,7 +260,7 @@ END; # FOREACH bib
                     l('Previous [_1]', ctx.copy_offset - new_offset) %]</a>
             </td>
         [%- END %]
-        [%- IF copies.size >= ctx.copy_limit AND NOT serial_holdings %]
+        [%- IF copies.size >= ctx.copy_limit AND NOT serial_holdings AND (ctx.copy_offset + ctx.copy_limit < total_copies) %]
             <td>
                 <a href="[% mkurl('', {copy_offset => ctx.copy_offset + ctx.copy_limit, copy_limit => ctx.copy_limit}) %]">[%
                     l('Next [_1]', ctx.copy_limit) %] »</a>
@@ -267,7 +271,7 @@ END; # FOREACH bib
         <tr>
             <td>
                 [%- more_copies_limit = 50 %] [%# TODO: config %]
-                [%- IF  ctx.copy_limit != more_copies_limit AND copies.size >= ctx.copy_limit %]
+                [%- IF  ctx.copy_limit != more_copies_limit AND copies.size >= ctx.copy_limit AND ctx.copy_limit < total_copies %]
                     <div class="rdetail_show_copies">
                         <img src="[% ctx.media_prefix %]/images/plus_sign.png" alt="[% l('Show more copies icon') %]"/>
                         <a href="[% mkurl('', {copy_limit => more_copies_limit, copy_offset => 0}) %]">[% l('Show more copies') %]</a>

-----------------------------------------------------------------------

Summary of changes:
 .../src/templates/opac/parts/record/copy_table.tt2 |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list