Merge branch 'MDL-60374-master' of git://github.com/andrewnicols/moodle
[moodle.git] / calendar / templates / month_detailed.mustache
index 2a0b06b..3ebebaa 100644 (file)
                         data-region="day"
                         data-new-event-timestamp="{{neweventtimestamp}}">
                         <div class="hidden-sm-down text-xs-center">
-                            {{#events.0}}
+                            {{#hasevents}}
                                 <a data-action="view-day-link" href="{{viewdaylink}}" class="day" title="{{viewdaylinktitle}}">{{mday}}</a>
-                            {{/events.0}}
-                            {{^events.0}}
+                            {{/hasevents}}
+                            {{^hasevents}}
                                 {{mday}}
-                            {{/events.0}}
-                            {{#events.0}}
+                            {{/hasevents}}
+                            {{#hasevents}}
                                 <div data-region="day-content">
                                     <ul>
                                         {{#events}}
                                             <li class="events-underway">[{{name}}]</li>
                                         {{/underway}}
                                         {{^underway}}
-                                            <li class="calendar_event_{{calendareventtype}}"
-                                                data-region="event-item"
+                                            <li data-region="event-item"
                                                 data-eventtype-{{calendareventtype}}="1"
                                                 {{#canedit}}
                                                     draggable="true"
                                                     data-drag-type="move"
+                                                    {{#mindaytimestamp}}
+                                                        data-min-day-timestamp="{{.}}"
+                                                    {{/mindaytimestamp}}
+                                                    {{#mindayerror}}
+                                                        data-min-day-error="{{.}}"
+                                                    {{/mindayerror}}
+                                                    {{#maxdaytimestamp}}
+                                                        data-max-day-timestamp="{{.}}"
+                                                    {{/maxdaytimestamp}}
+                                                    {{#maxdayerror}}
+                                                        data-max-day-error="{{.}}"
+                                                    {{/maxdayerror}}
                                                 {{/canedit}}>
 
-                                                <a data-action="view-event" data-event-id="{{id}}" href="{{url}}">{{name}}</a>
+                                                <a data-action="view-event" data-event-id="{{id}}" href="{{url}}" title="{{name}}">
+                                                    <span class="badge badge-circle calendar_event_{{calendareventtype}}">
+                                                        &nbsp;
+                                                    </span>
+                                                    {{> core_calendar/event_icon}}
+                                                    {{name}}
+                                                </a>
                                             </li>
                                         {{/underway}}
                                         {{/events}}
                                     </ul>
                                 </div>
-                            {{/events.0}}
+                            {{/hasevents}}
                         </div>
                         <div class="hidden-md-up hidden-desktop">
-                            {{#events.0}}
+                            {{#hasevents}}
                                 <a href="{{viewdaylink}}" class="day" title="{{viewdaylinktitle}}">{{mday}}</a>
-                            {{/events.0}}
-                            {{^events.0}}
+                            {{/hasevents}}
+                            {{^hasevents}}
                                 <div data-region="day-content">
                                     {{mday}}
                                 </div>
-                            {{/events.0}}
+                            {{/hasevents}}
                         </div>
                     </td>
                 {{/days}}