mirror of
https://github.com/ENSL/ensl.org.git
synced 2025-01-14 22:01:28 +00:00
Check for upcoming matches before showing the calendar
This commit is contained in:
parent
eee3c1c905
commit
68b6c15b4f
1 changed files with 18 additions and 16 deletions
|
@ -1,19 +1,21 @@
|
||||||
<div class="widget calendar">
|
<% if upcoming_matches.size > 0 %>
|
||||||
<h4><%= t('widget.schedule') %></h4>
|
<div class="widget calendar">
|
||||||
|
<h4><%= t('widget.schedule') %></h4>
|
||||||
|
|
||||||
<div class="widget-content-wrapper">
|
<div class="widget-content-wrapper">
|
||||||
<% upcoming_matches.group_by{ |e| e.start.month }.each do |month, events| %>
|
<% upcoming_matches.group_by{ |e| e.start.month }.each do |month, events| %>
|
||||||
<% events.group_by { |e| e.start.day }.each do |day, day_events| %>
|
<% events.group_by { |e| e.start.day }.each do |day, day_events| %>
|
||||||
<div class="separator"><%= day_events.first.start.strftime("%A, %e %B") %></div>
|
<div class="separator"><%= day_events.first.start.strftime("%A, %e %B") %></div>
|
||||||
<% day_events.each do |event| %>
|
<% day_events.each do |event| %>
|
||||||
<div class="entry">
|
<div class="entry">
|
||||||
<p class="summary">
|
<p class="summary">
|
||||||
<span class="time"><%= event.start.strftime("%H:%M %Z") %></span>
|
<span class="time"><%= event.start.strftime("%H:%M %Z") %></span>
|
||||||
<%= event.formatted_summary %>
|
<%= event.formatted_summary %>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<% end %>
|
||||||
|
|
Loading…
Reference in a new issue