From 3b17f71a1e091e04f00e90a7f1189ce4e07c04ff Mon Sep 17 00:00:00 2001 From: Shi Yao Wang Date: Fri, 26 Aug 2022 17:26:05 -0400 Subject: [PATCH] Bug 17015: DatePicker/TimePicker to Flatpickr Changed all datepicker/timepicker to flatpickr + some small fixes --- .../prog/css/discretecalendar.css | 213 ------------------ .../intranet-tmpl/prog/css/src/calendar.scss | 31 +++ .../en/modules/tools/discrete_calendar.tt | 144 ++++++------ 3 files changed, 104 insertions(+), 284 deletions(-) delete mode 100644 koha-tmpl/intranet-tmpl/prog/css/discretecalendar.css diff --git a/koha-tmpl/intranet-tmpl/prog/css/discretecalendar.css b/koha-tmpl/intranet-tmpl/prog/css/discretecalendar.css deleted file mode 100644 index 1be90a5959..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/css/discretecalendar.css +++ /dev/null @@ -1,213 +0,0 @@ -#jcalendar-container .ui-datepicker { - float: left; - font-size: 185%; -} - -#holidayweeklyrepeatable, -#holidaysyearlyrepeatable, -#holidaysunique, -#holidayexceptions { - font-size: 90%; - margin-bottom: 1em; -} - -#showHoliday { - margin: .5em 0; -} - -.key { - padding: 3px; - white-space: nowrap; - line-height: 230%; -} - -.ui-datepicker { - font-size: 150%; -} - -.ui-datepicker th, -.ui-datepicker .ui-datepicker-title select { - font-size: 80%; -} - -.ui-datepicker td a { - padding: .5em; -} - -.ui-datepicker td span { - padding: .5em; - border: 1px solid #BCBCBC; -} - -.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { - font-size: 80%; -} - -.key { - padding: 3px; - white-space: nowrap; - line-height: 230%; -} - -.normalday { - background-color: #EDEDED; - color: #000; - border: 1px solid #BCBCBC; -} - -.ui-datepicker-unselectable { - padding: .5em; - white-space: nowrap; -} - -.ui-state-disabled { - padding: .5em; - white-space: nowrap; -} - -.exception { - background-color: #b3d4ff; - color: #000; - border: 1px solid #BCBCBC; -} - -.past-date { - background-color: #e6e6e6; - color: #555; - border: 1px solid #BCBCBC; -} - -td.past-date a.ui-state-default { - background: #e6e6e6; - color: #555; -} - -.float { - background-color: #6f3; - color: #000; - border: 1px solid #BCBCBC; -} - -.holiday { - background-color: #ffaeae; - color: #000; - border: 1px solid #BCBCBC; -} - -.repeatableweekly { - background-color: #FF9; - color: #000; - border: 1px solid #BCBCBC; -} - -.repeatableyearly { - background-color: #FC6; - color: #000; - border: 1px solid #BCBCBC; -} - -td.exception a.ui-state-default { - background: #b3d4ff none; - color: #000; - border: 1px solid #BCBCBC; -} - -td.float a.ui-state-default { - background: #6f3 none; - color: #000; - border: 1px solid #BCBCBC; -} - -td.holiday a.ui-state-default { - background: #ffaeae none; - color: #000; - border: 1px solid #BCBCBC; -} - -td.repeatableweekly a.ui-state-default { - background: #FF9 none; - color: #000; - border: 1px solid #BCBCBC; -} - -td.repeatableyearly a.ui-state-default { - background: #FC6 none; - color: #000; - border: 1px solid #BCBCBC; -} - -.information { - background-color: #DCD2F1; - width: 300px; - display: none; - border: 1px solid #000; - color: #000; - font-size: 8pt; - font-weight: 700; - background-color: #FFD700; - cursor: pointer; - padding: 2px; -} - -.panel { - z-index: 1; - display: none; - float: left; - border: 3px solid #CCC; - padding: 3px; - margin-top: .3em; - margin-left: 15px; - background-color: #FEFEFE; -} - -fieldset.brief { - border: 0; - margin: 0; -} - -h1 select { - width: 20em; -} - -fieldset.brief ol { - font-size: 100%; -} - -fieldset.brief li, -fieldset.brief li.radio { - padding: .2em 0; -} - -.CopyDatePanel { - margin-left: 15px; -} - -.help { - margin: .3em 0; - border: 1px solid #EEE; - padding: .3em .7em; - font-size: 90%; -} - -.calendar td, -.calendar th, -.calendar .button, -.calendar tbody .day { - padding: .7em; - font-size: 110%; -} - -.calendar { - width: auto; - border: 0; -} - -.copyHoliday form li { - display: table-row; -} - -.copyHoliday form li b, -.copyHoliday form li input { - display: table-cell; - margin-bottom: 2px; -} \ No newline at end of file diff --git a/koha-tmpl/intranet-tmpl/prog/css/src/calendar.scss b/koha-tmpl/intranet-tmpl/prog/css/src/calendar.scss index 910130b338..aaaa0adb6d 100644 --- a/koha-tmpl/intranet-tmpl/prog/css/src/calendar.scss +++ b/koha-tmpl/intranet-tmpl/prog/css/src/calendar.scss @@ -1,8 +1,11 @@ $daySize: 45px; +$pastdate_bg: #E6E6E6; +$normalday_bg: #F4F8F9; $exception_bg: #B3D4FF; $holiday_bg: #FFAEAE; $repeatableweekly_bg: #FFFF99; $repeatableyearly_bg: #FFCC66; +$float_bg: #66FF33; $selected: #B9DB88; @import "flatpickr"; @@ -32,6 +35,10 @@ $selected: #B9DB88; &.repeatableyearly { background-color: $repeatableyearly_bg; } + + &.float { + background-color: $float_bg; + } } .flatpickr-day { @@ -40,6 +47,18 @@ $selected: #B9DB88; border: 0; } + &.past-date { + background-color: $pastdate_bg; + + &.selected { + border:3px solid $selected; + } + + &:hover { + background-color: #CCC; + } + } + &.exception { background-color: $exception_bg; @@ -71,6 +90,14 @@ $selected: #B9DB88; border: 3px solid $selected; } } + + &.float { + background-color: $float_bg; + + .selected { + border: 3px solid $selected; + } + } } #holidayexceptions th.exception { @@ -93,6 +120,10 @@ $selected: #B9DB88; background-color: $repeatableyearly_bg; } +#holidaysfloat th.float { + background-color: $float_bg; +} + .panel { border: 1px solid #8AC363; box-shadow: none; 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 4169af3d69..3918ac0205 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 @@ -5,7 +5,7 @@ [% INCLUDE 'doc-head-open.inc' %] [% Branches.GetName( branch ) | html %] calendar; Tools › Koha &rsaquo [% INCLUDE 'doc-head-close.inc' %] -[% Asset.css("css/discretecalendar.css") | $raw %] +[% Asset.css("css/calendar.css") | $raw %] @@ -80,7 +80,7 @@

Calendar information

-
+
@@ -110,7 +110,7 @@
  • To date: - +
  • @@ -162,9 +162,9 @@
  • - + - +
  • @@ -214,11 +214,11 @@
    [% IF ( NEED_VALIDATION_HOLIDAYS ) %]

    Need validation holidays

    - +
    - - + + @@ -302,7 +302,7 @@ [% IF ( FLOAT_HOLIDAYS ) %]

    Floating holidays

    -
    DateTitleDateTitle
    +
    @@ -336,7 +336,6 @@ [% MACRO jsinclude BLOCK %] [% INCLUDE 'calendar.inc' %] [% INCLUDE 'datatables.inc' %] - [% Asset.js("lib/jquery/plugins/jquery-ui-timepicker-addon.min.js") | $raw %] [% Asset.js("js/tools-menu.js") | $raw %]
    Date