From 106fdcf7a84d581ae05402cf4953f48353433c2e Mon Sep 17 00:00:00 2001
From: Jonathan Druart <jonathan.druart@biblibre.com>
Date: Wed, 15 Apr 2015 12:19:42 +0200
Subject: [PATCH] Bug 10174: Add a tooltip to explain what is a digest

The digest term seems to be ambiguous for some people.

This patch adds a tooltip to explain what it is (feel free to provide
a better wording).

Test plan:
Go at the OPAC and click on the "Your messaging tab", you should see an
icon close to "Digest only" to explain what is a digest.
Same at the intranet on editing/showing patron info
---
 .../prog/en/includes/messaging-preference-form.inc            |  4 +++-
 koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-messaging.tt    | 11 ++++++++++-
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/messaging-preference-form.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/messaging-preference-form.inc
index 3b7bb50..1dfc187 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/includes/messaging-preference-form.inc
+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/messaging-preference-form.inc
@@ -12,6 +12,7 @@
           $("#rss"+newid).removeAttr("checked");
 			}
 		});
+        $("#info_digests").tooltip();
 	});
 //]]>
 </script>
@@ -23,7 +24,8 @@
         <th>Days in advance</th>
         [% IF ( SMSSendDriver ) %]<th>SMS</th>[% END %]
         [% IF ( TalkingTechItivaPhone ) %]<th>Phone</th>[% END %]
-        <th>Email</th><th>Digests only?</th>
+        <th>Email</th>
+        <th>Digests only <i id="info_digests" data-toggle="tooltip" title="You can ask for a digest to reduce the number of messages. Messages will be saved and sent as a single mesage." data-placement="right" class="icon icon-info-sign"></i></th>
         <!-- <th>RSS</th> -->
         [% UNLESS ( messaging_form_inactive ) %]<th>Do not notify</th>[% END %]
     </tr>
diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-messaging.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-messaging.tt
index c13adc4..3ec4cc1 100644
--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-messaging.tt
+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-messaging.tt
@@ -30,7 +30,15 @@
                         <input type="hidden" name="modify" value="yes" />
 
                             <table class="table table-bordered table-condensed table-striped">
-                                <tr><th>&nbsp;</th><th>Days in advance</th>[% IF ( SMSSendDriver ) %]<th>SMS</th>[% END %][% IF ( TalkingTechItivaPhone ) %]<th>Phone</th>[% END %]<th>Email</th><th>Digests only?</th><!-- <th>RSS</th> --><th>Do not notify</th></tr>
+                                <tr>
+                                    <th>&nbsp;</th>
+                                    <th>Days in advance</th>
+                                    [% IF ( SMSSendDriver ) %]<th>SMS</th>[% END %]
+                                    [% IF ( TalkingTechItivaPhone ) %]<th>Phone</th>[% END %]
+                                    <th>Email</th>
+                                    <th>Digests only <i id="info_digests" data-toggle="tooltip" title="You can ask for a digest to reduce the number of messages. Messages will be saved and sent as a single message." data-placement="right" class="icon icon-info-sign"></i></th>
+                                    <!-- <th>RSS</th> --><th>Do not notify</th>
+                                </tr>
                                 [% FOREACH messaging_preference IN messaging_preferences %]
                                     <tr>
                                         <td>[% IF ( messaging_preference.Item_Due ) %]Item due
@@ -139,6 +147,7 @@
           $("#rss"+newid).removeAttr("checked");
       }
     });
+    $("#info_digests").tooltip();
   });
 //]]>
 </script>
-- 
2.1.0