Moodle
  1. Moodle
  2. MDL-32264

Multi-day calendar events are not highlighted in the calendar block

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1.5, 2.2.2
    • Fix Version/s: 2.1.6, 2.2.3
    • Component/s: Themes
    • Labels:
    • Testing Instructions:
      Hide
      1. Log in as an admin
      2. Purge your caches
      3. Switch to the standard theme
      4. Add the calendar block to the front page if you don't have it already
      5. Click on the current month title in the calendar block
      6. Create a new user event, make it start on the 7th of the month and go until the 14th.
      7. Check on the calendar page in the block on the right has the 7th highlighted, and the 8th - 14th has a border on the top and bottom
      8. Browse to the course page and check the calendar block is the same
      Show
      Log in as an admin Purge your caches Switch to the standard theme Add the calendar block to the front page if you don't have it already Click on the current month title in the calendar block Create a new user event, make it start on the 7th of the month and go until the 14th. Check on the calendar page in the block on the right has the 7th highlighted, and the 8th - 14th has a border on the top and bottom Browse to the course page and check the calendar block is the same
    • Workaround:
      Hide

      Add the CSS from the description to your theme

      Show
      Add the CSS from the description to your theme
    • Affected Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE
    • Fixed Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE
    • Pull Master Branch:
      wip-MDL-32264-m23
    • Rank:
      39053

      Description

      This is a regression since Moodle 1.9.
      Multi-day calendar events used to be highlighted in the mini calendar by giving days after the first a top and bottom border the same colour as the highlighting on the first day.

      I've had a quick look into this and the required classes are still being added and the border-color CSS is still there, the regression is caused because border-width is now 0.

      The solution for the standard theme is very simple, apply the following patch:

      diff --git a/theme/standard/style/calendar.css b/theme/standard/style/calendar.css
      index d9e070b..2ea84e8 100644
      --- a/theme/standard/style/calendar.css
      +++ b/theme/standard/style/calendar.css
      @@ -50,6 +50,7 @@
       .calendartable .eventnone a {text-decoration:none;color:black;cursor:text;}
       
       .block .minicalendar {font-size:0.85em;border:1px solid #DDDDDD;margin: 10px 0;border-collapse:separate;border-spacing:1px;}
      +.block .minicalendar .duration {border-width:1px 0;}
       .block .calendar_filters.filters {background-color: #EEEEEE;}
       .block .calendar_filters.filters table {width:100%;}
      

      For those who want to get highlighting working in other theme's it will depend on the CSS that is there.
      Hopefully the following will work for you:

      .calendartable.minicalendar .duration {border-width:1px 0;border-style:solid;}
      .calendartable.minicalendar .duration.duration_global {border-top-color:#66D14D; border-bottom-color:#66D14D;}
      .calendartable.minicalendar .duration.duration_course {border-top-color:#FF9966; border-bottom-color:#FF9966;}
      .calendartable.minicalendar .duration.duration_course0 {border-top-color:#FF9966; border-bottom-color:#FF9966;}
      .calendartable.minicalendar .duration.duration_course1 {border-top-color:#0099FF; border-bottom-color:#0099FF;}
      .calendartable.minicalendar .duration.duration_course2 {border-top-color:#FFFF00; border-bottom-color:#FFFF00;}
      .calendartable.minicalendar .duration.duration_group {border-top-color:#FBBB23; border-bottom-color:#FBBB23;}
      .calendartable.minicalendar .duration.duration_user {border-top-color:#A1BECB; border-bottom-color:#A1BECB;}
      

      I'll create branches and put this up for integration shortly.

      Cheers
      Sam

        Activity

        Hide
        Sam Hemelryk added a comment -

        Up for peer-review now

        Show
        Sam Hemelryk added a comment - Up for peer-review now
        Hide
        Sam Hemelryk added a comment -

        Putting this up for integration now. I've heard back from Laura who created the forum discussion and the changes work.

        Cheers
        Sam

        Show
        Sam Hemelryk added a comment - Putting this up for integration now. I've heard back from Laura who created the forum discussion and the changes work. Cheers Sam
        Hide
        Dan Poltawski added a comment -

        Thanks Sam - this has been integrated now

        Show
        Dan Poltawski added a comment - Thanks Sam - this has been integrated now
        Hide
        Adrian Greeve added a comment -

        tested in 2.1, 2.2 and master. Highlighting is now present for multi-day events in the calendar.
        Thanks.

        Show
        Adrian Greeve added a comment - tested in 2.1, 2.2 and master. Highlighting is now present for multi-day events in the calendar. Thanks.
        Hide
        Aparup Banerjee added a comment -

        The code here has been spread to upstream moodle repositories and mirrors for anyone to use .

        Closing, have a good weekend!

        Show
        Aparup Banerjee added a comment - The code here has been spread to upstream moodle repositories and mirrors for anyone to use . Closing, have a good weekend!

          People

          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: