warn if attempting to print or email an empty cart
authorGalen Charlton <gmc@equinoxinitiative.org>
Thu, 7 Jun 2018 20:58:59 +0000 (16:58 -0400)
committerGalen Charlton <gmc@equinoxinitiative.org>
Thu, 7 Jun 2018 20:58:59 +0000 (16:58 -0400)
Also:

* make styling of the warning message consistent
* add return to referrer button

Open-ILS/src/templates/opac/mylist.tt2
Open-ILS/src/templates/opac/mylist/email.tt2
Open-ILS/src/templates/opac/mylist/print.tt2

index b09f5f8..650786c 100644 (file)
@@ -13,7 +13,8 @@
             [%  IF ctx.mylist.size;
                     INCLUDE "opac/parts/anon_list.tt2";
                 ELSE %]
-                <div class="opac-auto-171 opac-auto-097">[% l("You have not created a cart yet."); %]</div>
+                <div class="warning_box">[% l("You have not created a cart yet."); %]</div>
+                <button type="button" class="opac-button" onclick="window.location='[% ctx.referer | html %]'">[% l('Return') %]</button>
                 [% END %]
             <div class="common-full-pad"></div>        
         </div>
index 9271d8e..773ea8d 100644 (file)
@@ -7,6 +7,7 @@
     [% INCLUDE "opac/parts/searchbar.tt2" %]
     <div id="content-wrapper">
         <div id="main-content">
+          [% IF ctx.mylist.size %]
              <p class="big-strong">[% l('Please confirm that you want to email the [_1] titles in the cart.', ctx.mylist.size) %]
              <form method="post" action="[% mkurl(ctx.opac_root _ '/mylist/doemail', {}, 1) %]">
              <input type="hidden" name="redirect_to" value="[% ctx.referer %]" />
                alt="[% l('Confirm') %]" class="opac-button" />
              <input type="reset" name="cancel" onclick="window.location='[% ctx.referer | html %]'" value="[% l('Cancel') %]" id="clear_cart_cancel" class="opac-button" />
              </form>
+          [% ELSE %]
+            <div class="warning_box">[% l("You have not created a cart yet."); %]</div>
+            <button type="button" class="opac-button" onclick="window.location='[% ctx.referer | html %]'">[% l('Return') %]</button>
+          [% END %]
             <div class="common-full-pad"></div>        
         </div>
     </div>
index 118c7d9..1916681 100644 (file)
@@ -7,6 +7,7 @@
     [% INCLUDE "opac/parts/searchbar.tt2" %]
     <div id="content-wrapper">
         <div id="main-content">
+          [% IF ctx.mylist.size %]
              <p class="big-strong">[% l('Please confirm that you want to print the [_1] titles in the cart.', ctx.mylist.size) %]
              <form method="post" action="[% mkurl(ctx.opac_root _ '/mylist/doprint', {}, 1) %]">
              <input type="hidden" name="redirect_to" value="[% ctx.referer %]" />
                alt="[% l('Confirm') %]" class="opac-button" />
              <input type="reset" name="cancel" onclick="window.location='[% ctx.referer | html %]'" value="[% l('Cancel') %]" id="clear_cart_cancel" class="opac-button" />
              </form>
+          [% ELSE %]
+            <div class="warning_box">[% l("You have not created a cart yet."); %]</div>
+            <button type="button" class="opac-button" onclick="window.location='[% ctx.referer | html %]'">[% l('Return') %]</button>
+          [% END %]
             <div class="common-full-pad"></div>        
         </div>
     </div>