From 4b294e374dde15f22e6944f858b4479d079cb9f0 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Thu, 9 Sep 2021 18:32:20 +0000 Subject: [PATCH] Bug 28988: Reindent calendar template This patch performs general template cleanup to the calendar template: Make indentation consistent and trim trailing whitespace. To test, apply the patch and go to Tools -> Calendar. The page should look correct and work correctly. If you view the diff while ignoring whitespace the only changes should be where line breaks were introduced. Signed-off-by: David Nind Signed-off-by: Katrin Fischer Signed-off-by: Jonathan Druart --- .../prog/en/modules/tools/holidays.tt | 734 +++++++++--------- 1 file changed, 384 insertions(+), 350 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tt index a25c35501d..a8bdc947d1 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tt @@ -32,327 +32,361 @@
-

[% Branches.GetName( branch ) | html %] calendar

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

Edit this holiday

- -
    -
  1. - Library: - -
  2. -
  3. - From date: - , - - [% IF ( dateformat == "us" ) %]//[% ELSIF ( dateformat == "metric") %]//[% ELSIF ( dateformat == "dmydot") %]..[% ELSE %]//[% END %] - - - - - - -
  4. -
  5. - To date: - -
  6. -
  7. - -
  8. - - -
  9. -
  10. - - [?] -
    You can make an exception for this holiday rule. This means that you will be able to say that for a repeatable holiday there is one day which is going to be an exception.
    -
  11. -
  12. - - - [?] -
    You can make an exception on a range of dates repeated yearly.
    -
  13. -
  14. - [?] -
    This will delete this holiday rule. If it is a repeatable holiday, this option checks for possible exceptions. If an exception exists, this option will remove the exception and set the date to a regular holiday.
  15. -
  16. . - [?] -
    This will delete the single holidays rules only. The repeatable holidays and exceptions will not be deleted.
    -
  17. -
  18. . - [?] -
    This will delete the repeated holidays rules only. The repeatable holidays will be deleted but not the exceptions.
    -
  19. -
  20. . - [?] -
    This will delete the exceptions inside a given range. Be careful about your scope range; if it is oversized you could slow down Koha.
    -
  21. -
  22. - [?] -
    This will save changes to the holiday's title and description. If the information for a repeatable holiday is modified, it affects all of the dates on which the holiday is repeated.
  23. -
  24. - - . - [?] -
    If checked, changes for this holiday will be copied to all libraries. If the holiday doesn't exists for a library, no change is made.
    -
  25. -
-
- - Cancel -
-
-
-
- - -
-
-
-

Add new holiday

-
    -
  1. - Library: - - -
  2. -
  3. - From date: - , - - [% IF ( dateformat == "us" ) %]//[% ELSIF ( dateformat == "metric" ) %]//[% ELSIF ( dateformat == "dmydot" ) %]..[% ELSE %]//[% END %] - - - - - - -
  4. -
  5. - To date: - -
  6. -
  7. -
  8. - -
  9. -
  10. - . - [?] -
    Make a single holiday. For example, selecting August 1, 2012 will make it a holiday, but will not affect August 1 in other years.
    -
  11. -
  12. - . - [?] -
    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.
    -
  13. -
  14. - . - [?] -
    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.
    -
  15. -
  16. - . - [?] -
    Make a single holiday on a range. For example, selecting August 1, 2012 and August 10, 2012 will make all days between August 1 and 10 a holiday, but will not affect August 1-10 in other years.
    -
  17. -
  18. - . - [?] -
    Make a single holiday on a range repeated yearly. For example, selecting August 1, 2012 and August 10, 2012 will make all days between August 1 and 10 a holiday, and will affect August 1-10 in other years.
    -
  19. -
  20. - - . - [?] -
    If checked, this holiday will be copied to all libraries. If the holiday already exists for a library, no change is made.
    -
-
- - Cancel -
-
-
-
- - - - - - - - -

Calendar information

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

Hints

-
    -
  • Search in the calendar the day you want to set as holiday.
  • -
  • Click the date to add or edit a holiday.
  • -
  • Enter a title and description for the holiday.
  • -
  • Specify how the holiday should repeat.
  • -
  • Click Save to finish.
  • -
-

Key

-

- Working day - Unique holiday - Holiday repeating weekly - Holiday repeating yearly - Holiday exception -

-
-
- - -[% IF ( EXCEPTION_HOLIDAYS_LOOP ) %] -

Exceptions

- - - - - - - - - - [% FOREACH EXCEPTION_HOLIDAYS_LOO IN EXCEPTION_HOLIDAYS_LOOP %] - - - - - - [% END %] - -
DateTitleDescription
- - [% EXCEPTION_HOLIDAYS_LOO.DATE | html %] - - [% EXCEPTION_HOLIDAYS_LOO.TITLE | html %][% EXCEPTION_HOLIDAYS_LOO.DESCRIPTION | html %]
-[% END %] - -[% IF ( WEEK_DAYS_LOOP ) %] -

Weekly - Repeatable holidays

- - - - - - - - - - [% FOREACH WEEK_DAYS_LOO IN WEEK_DAYS_LOOP %] - - - - - - - [% END %] - -
Day of weekTitleDescription
[% WEEK_DAYS_LOO.KEY | html %][% WEEK_DAYS_LOO.TITLE | html %][% WEEK_DAYS_LOO.DESCRIPTION | html %]
-[% END %] - -[% IF ( DAY_MONTH_HOLIDAYS_LOOP ) %] -

Yearly - Repeatable holidays

- - - - [% IF ( dateformat == "metric" ) %] - - [% ELSE %] - - [% END %] - - - - - - [% FOREACH DAY_MONTH_HOLIDAYS_LOO IN DAY_MONTH_HOLIDAYS_LOOP %] - - - - - - [% END %] - -
Day/monthMonth/dayTitleDescription
- [% DAY_MONTH_HOLIDAYS_LOO.DATE | html %] - [% DAY_MONTH_HOLIDAYS_LOO.TITLE | html %][% DAY_MONTH_HOLIDAYS_LOO.DESCRIPTION | html %]
-[% END %] - -[% IF ( HOLIDAYS_LOOP ) %] -

Unique holidays

- - - - - - - - - - - [% FOREACH HOLIDAYS_LOO IN HOLIDAYS_LOOP %] - - - - - - [% END %] - -
DateTitleDescription
- - [% HOLIDAYS_LOO.DATE | html %] - - [% HOLIDAYS_LOO.TITLE | html %][% HOLIDAYS_LOO.DESCRIPTION.replace('\\\r\\\n', '
') | html %]
-[% END %] -
-
-
- +

[% Branches.GetName( branch ) | html %] calendar

+ +
+
+ + + + + + + + +
+
+ +
+

Edit this holiday

+ +
    +
  1. + Library: + +
  2. +
  3. + From date: + , + [% IF ( dateformat == "us" ) %] + // + [% ELSIF ( dateformat == "metric") %] + // + [% ELSIF ( dateformat == "dmydot") %] + ..[% ELSE %]// + [% END %] + + + + + + +
  4. +
  5. + To date: + +
  6. +
  7. + +
  8. + +
  9. + + +
  10. +
  11. +
    + + [?] +
    You can make an exception for this holiday rule. This means that you will be able to say that for a repeatable holiday there is one day which is going to be an exception.
    +
    +
  12. +
  13. +
    + + + [?] +
    You can make an exception on a range of dates repeated yearly.
    +
    +
  14. +
  15. + + + [?] +
    This will delete this holiday rule. If it is a repeatable holiday, this option checks for possible exceptions. If an exception exists, this option will remove the exception and set the date to a regular holiday.
    +
  16. +
  17. + . + [?] +
    This will delete the single holidays rules only. The repeatable holidays and exceptions will not be deleted.
    +
  18. +
  19. + . + [?] +
    This will delete the repeated holidays rules only. The repeatable holidays will be deleted but not the exceptions.
    +
  20. +
  21. + . + [?] +
    This will delete the exceptions inside a given range. Be careful about your scope range; if it is oversized you could slow down Koha.
    +
  22. +
  23. + + [?] +
    This will save changes to the holiday's title and description. If the information for a repeatable holiday is modified, it affects all of the dates on which the holiday is repeated.
  24. +
  25. + + . + [?] +
    If checked, changes for this holiday will be copied to all libraries. If the holiday doesn't exists for a library, no change is made.
    +
  26. +
+
+ + Cancel +
+
+
+
+ + +
+
+
+

Add new holiday

+
    +
  1. + Library: + + +
  2. +
  3. + From date: + , + + [% IF ( dateformat == "us" ) %] + // + [% ELSIF ( dateformat == "metric" ) %] + // + [% ELSIF ( dateformat == "dmydot" ) %] + .. + [% ELSE %] + // + [% END %] + + + + + + +
  4. +
  5. + To date: + +
  6. +
  7. + +
  8. +
  9. + + +
  10. +
  11. + + . + [?] +
    Make a single holiday. For example, selecting August 1, 2012 will make it a holiday, but will not affect August 1 in other years.
    +
  12. +
  13. + + . + [?] +
    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.
    +
  14. +
  15. + + . + [?] +
    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.
    +
  16. +
  17. + + . + [?] +
    Make a single holiday on a range. For example, selecting August 1, 2012 and August 10, 2012 will make all days between August 1 and 10 a holiday, but will not affect August 1-10 in other years.
    +
  18. +
  19. + + . + [?] +
    Make a single holiday on a range repeated yearly. For example, selecting August 1, 2012 and August 10, 2012 will make all days between August 1 and 10 a holiday, and will affect August 1-10 in other years.
    +
  20. +
  21. + + . + [?] +
    If checked, this holiday will be copied to all libraries. If the holiday already exists for a library, no change is made.
    +
  22. +
+
+ + Cancel +
+
+
+
+ + + + + + + + +

Calendar information

+
+
+
+ + + + +
+
+
+ +
+
+

Hints

+
    +
  • Search in the calendar the day you want to set as holiday.
  • +
  • Click the date to add or edit a holiday.
  • +
  • Enter a title and description for the holiday.
  • +
  • Specify how the holiday should repeat.
  • +
  • Click Save to finish.
  • +
+

Key

+

+ Working day + Unique holiday + Holiday repeating weekly + Holiday repeating yearly + Holiday exception +

+
+ +
+ + + [% IF ( EXCEPTION_HOLIDAYS_LOOP ) %] +

Exceptions

+ + + + + + + + + + + [% FOREACH EXCEPTION_HOLIDAYS_LOO IN EXCEPTION_HOLIDAYS_LOOP %] + + + + + + [% END %] + +
DateTitleDescription
+ + [% EXCEPTION_HOLIDAYS_LOO.DATE | html %] + + [% EXCEPTION_HOLIDAYS_LOO.TITLE | html %][% EXCEPTION_HOLIDAYS_LOO.DESCRIPTION | html %]
+ [% END %] + + [% IF ( WEEK_DAYS_LOOP ) %] +

Weekly - Repeatable holidays

+ + + + + + + + + + [% FOREACH WEEK_DAYS_LOO IN WEEK_DAYS_LOOP %] + + + + + + [% END %] + +
Day of weekTitleDescription
[% WEEK_DAYS_LOO.KEY | html %][% WEEK_DAYS_LOO.TITLE | html %][% WEEK_DAYS_LOO.DESCRIPTION | html %]
+ [% END %] + + [% IF ( DAY_MONTH_HOLIDAYS_LOOP ) %] +

Yearly - Repeatable holidays

+ + + + [% IF ( dateformat == "metric" ) %] + + [% ELSE %] + + [% END %] + + + + + + [% FOREACH DAY_MONTH_HOLIDAYS_LOO IN DAY_MONTH_HOLIDAYS_LOOP %] + + + + + + [% END %] + +
Day/monthMonth/dayTitleDescription
+ [% DAY_MONTH_HOLIDAYS_LOO.DATE | html %] + [% DAY_MONTH_HOLIDAYS_LOO.TITLE | html %][% DAY_MONTH_HOLIDAYS_LOO.DESCRIPTION | html %]
+ [% END %] + + [% IF ( HOLIDAYS_LOOP ) %] +

Unique holidays

+ + + + + + + + + + + [% FOREACH HOLIDAYS_LOO IN HOLIDAYS_LOOP %] + + + + + + [% END %] + +
DateTitleDescription
+ + [% HOLIDAYS_LOO.DATE | html %] + + [% HOLIDAYS_LOO.TITLE | html %][% HOLIDAYS_LOO.DESCRIPTION.replace('\\\r\\\n', '
') | html %]
+ [% END %] +
+
+
@@ -378,17 +412,17 @@ var day_month_holidays = new Array(); var hola= "[% code | html %]"; [% FOREACH WEEK_DAYS_LOO IN WEEK_DAYS_LOOP %] - week_days["[% WEEK_DAYS_LOO.KEY | html %]"] = {title:"[% WEEK_DAYS_LOO.TITLE | replace('"','\"') | html %]", description:"[% WEEK_DAYS_LOO.DESCRIPTION | replace('"','\"') | html %]"}; + week_days["[% WEEK_DAYS_LOO.KEY | html %]"] = {title:"[% WEEK_DAYS_LOO.TITLE | replace('"','\"') | html %]", description:"[% WEEK_DAYS_LOO.DESCRIPTION | replace('"','\"') | html %]"}; [% END %] [% FOREACH HOLIDAYS_LOO IN HOLIDAYS_LOOP %] - holidates.push("[% HOLIDAYS_LOO.KEY | html %]"); - holidays["[% HOLIDAYS_LOO.KEY | html %]"] = {title:"[% HOLIDAYS_LOO.TITLE | replace('"','\"') | html %]", description:"[% HOLIDAYS_LOO.DESCRIPTION | replace('"','\"') | html %]"}; + holidates.push("[% HOLIDAYS_LOO.KEY | html %]"); + holidays["[% HOLIDAYS_LOO.KEY | html %]"] = {title:"[% HOLIDAYS_LOO.TITLE | replace('"','\"') | html %]", description:"[% HOLIDAYS_LOO.DESCRIPTION | replace('"','\"') | html %]"}; [% END %] [% FOREACH EXCEPTION_HOLIDAYS_LOO IN EXCEPTION_HOLIDAYS_LOOP %] - exception_holidays["[% EXCEPTION_HOLIDAYS_LOO.KEY | html %]"] = {title:"[% EXCEPTION_HOLIDAYS_LOO.TITLE | replace('"','\"') | html %]", description:"[% EXCEPTION_HOLIDAYS_LOO.DESCRIPTION | replace('"','\"') | html %]"}; + exception_holidays["[% EXCEPTION_HOLIDAYS_LOO.KEY | html %]"] = {title:"[% EXCEPTION_HOLIDAYS_LOO.TITLE | replace('"','\"') | html %]", description:"[% EXCEPTION_HOLIDAYS_LOO.DESCRIPTION | replace('"','\"') | html %]"}; [% END %] [% FOREACH DAY_MONTH_HOLIDAYS_LOO IN DAY_MONTH_HOLIDAYS_LOOP %] - day_month_holidays["[% DAY_MONTH_HOLIDAYS_LOO.KEY | html %]"] = {title:"[% DAY_MONTH_HOLIDAYS_LOO.TITLE | replace('"','\"') | html %]", description:"[% DAY_MONTH_HOLIDAYS_LOO.DESCRIPTION | replace('"','\"') | html %]"}; + day_month_holidays["[% DAY_MONTH_HOLIDAYS_LOO.KEY | html %]"] = {title:"[% DAY_MONTH_HOLIDAYS_LOO.TITLE | replace('"','\"') | html %]", description:"[% DAY_MONTH_HOLIDAYS_LOO.DESCRIPTION | replace('"','\"') | html %]"}; [% END %] function holidayOperation(formObject, opType) { @@ -499,33 +533,33 @@ var dayName = weekdays[weekDay]; var dayMonth = month + '/' + day; var dateString = year + '/' + month + '/' + day; - if (holidays[dateString] != null) { - showHoliday(0, dayName, day, month, year, weekDay, holidays[dateString].title, holidays[dateString].description, 'ymd'); - } else if (exception_holidays[dateString] != null) { - showHoliday(0, dayName, day, month, year, weekDay, exception_holidays[dateString].title, exception_holidays[dateString].description, 'exception'); - } else if (week_days[weekDay] != null) { - showHoliday(1, dayName, day, month, year, weekDay, week_days[weekDay].title, week_days[weekDay].description, 'weekday'); - } else if (day_month_holidays[dayMonth] != null) { - showHoliday(1, dayName, day, month, year, weekDay, day_month_holidays[dayMonth].title, day_month_holidays[dayMonth].description, 'daymonth'); - } else { - newHoliday(dayName, day, month, year, weekDay); - } + if (holidays[dateString] != null) { + showHoliday(0, dayName, day, month, year, weekDay, holidays[dateString].title, holidays[dateString].description, 'ymd'); + } else if (exception_holidays[dateString] != null) { + showHoliday(0, dayName, day, month, year, weekDay, exception_holidays[dateString].title, exception_holidays[dateString].description, 'exception'); + } else if (week_days[weekDay] != null) { + showHoliday(1, dayName, day, month, year, weekDay, week_days[weekDay].title, week_days[weekDay].description, 'weekday'); + } else if (day_month_holidays[dayMonth] != null) { + showHoliday(1, dayName, day, month, year, weekDay, day_month_holidays[dayMonth].title, day_month_holidays[dayMonth].description, 'daymonth'); + } else { + newHoliday(dayName, day, month, year, weekDay); + } }; - /* Custom table search configuration: If a table row - has an "expired" class, hide it UNLESS the - show_expired checkbox is checked */ - $.fn.dataTable.ext.search.push( - function( settings, searchData, index, rowData, counter ) { - var table = settings.nTable.id; - var row = $(settings.aoData[index].nTr); - if( row.hasClass("date_past") && !$("#show_past_" + table ).prop("checked") ){ - return false; - } else { - return true; - } + /* Custom table search configuration: If a table row + has an "expired" class, hide it UNLESS the + show_expired checkbox is checked */ + $.fn.dataTable.ext.search.push( + function( settings, searchData, index, rowData, counter ) { + var table = settings.nTable.id; + var row = $(settings.aoData[index].nTr); + if( row.hasClass("date_past") && !$("#show_past_" + table ).prop("checked") ){ + return false; + } else { + return true; } - ); + } + ); // Create current date variable var date = new Date(); -- 2.39.5