From 2830cd454b57baafcbdf639b2550f41dbbc77760 Mon Sep 17 00:00:00 2001
From: Maryse Simard <maryse.simard@inlibro.com>
Date: Thu, 20 Oct 2022 17:25:59 -0400
Subject: [PATCH] Bug 17015: UI tweaks

---
 .../en/modules/tools/discrete_calendar.tt     | 27 +++++++++++++------
 1 file changed, 19 insertions(+), 8 deletions(-)

diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/discrete_calendar.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/discrete_calendar.tt
index 5593d554b7..ede2ef91b0 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/discrete_calendar.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/discrete_calendar.tt
@@ -3,7 +3,7 @@
 [% USE Branches %]
 [% SET footerjs = 1 %]
 [% INCLUDE 'doc-head-open.inc' %]
-<title>[% Branches.GetName( branch ) | html %] calendar; Tools &rsaquo; Koha &rsaquo</title>
+<title>[% Branches.GetName( branch ) | html %] calendar &rsaquo; Tools &rsaquo; Koha</title>
 [% INCLUDE 'doc-head-close.inc' %]
 [% Asset.css("css/calendar.css") | $raw %]
 </head>
@@ -56,7 +56,7 @@
                 </div>
                 [% END %]
 
-                <h2>[% Branches.GetName( branch ) | html %] calendar</h2>
+                <h1>[% Branches.GetName( branch ) | html %] calendar</h1>
 
                 <div class="row">
                     <div class="col-sm-8">
@@ -131,6 +131,17 @@
                                                 <option value="F">Floating holiday</option>
                                                 <option value="N" disabled>Need validation</option>
                                             </select>
+                                            <a href="#" class="helptext">[?]</a>
+                                            <div class="hint">
+                                                <ol>
+                                                    <li><strong>Working day:</strong> the library is open on that day.</li>
+                                                    <li><strong>Unique holiday:</strong> make a single holiday. For example, selecting August 1, 2012 will make it a holiday, but will not affect August 1 in other years.</li>
+                                                    <li><strong>Weekly holiday:</strong> make this weekday a holiday, every week. For example, if your library is closed on Saturdays, use this option to make every Saturday a holiday.</li>
+                                                    <li><strong>Repeatable holiday:</strong> this will take this day and month as a reference to make it a holiday. Through this option, you can repeat this rule for every year. For example, selecting August 1 will make August 1 a holiday every year.</li>
+                                                    <li><strong>Floating holiday:</strong> this will take this day and month as a reference to make it a floating holiday. Through this option, you can add a holiday that repeats every year but not necessarily on the exact same day. On subsequent years the date will need validation.</li>
+                                                    <li><strong>Need validation:</strong> this holiday has been added automatically, but needs to be validated.</li>
+                                                </ol>
+                                            </div>
                                         </li>
                                         <li id="days_of_week">
                                             <label for="day_of_week">Week day</label>
@@ -468,6 +479,12 @@
             var today = new Date();
             today.setHours(0, 0, 0, 0);
 
+            if (date.date_obj < today) {
+                formatDay( [ "past-date", _("Past day")], dayElem );
+            } else {
+                formatDay( [ "normalday", _("Normal day")], dayElem );
+            }
+
             if (datesInfos[dateString] && datesInfos[dateString].holiday_type =='W') {
                 formatDay( [ "repeatableweekly", _("Weekly holiday: %s").format(datesInfos[dateString].title)], dayElem );
             } else if (datesInfos[dateString] && datesInfos[dateString].holiday_type == 'R') {
@@ -478,12 +495,6 @@
                 formatDay( [ "float", _("Floating holiday: %s").format(datesInfos[dateString].title)], dayElem );
             } else if (datesInfos[dateString] && datesInfos[dateString].holiday_type == 'E') {
                 formatDay( [ "holiday", _("Single holiday: %s").format(datesInfos[dateString].title)], dayElem );
-            } else {
-                if (date.date_obj < today) {
-                    formatDay( [ "past-date", _("Past day")], dayElem );
-                }else {
-                    formatDay( [ "normalday", _("Normal day")], dayElem );
-                }
             }
         }
 
-- 
2.34.1