Merge pull request #378 from ZeusWPI/correct-frontpage-order
Fix correct front-page order of events
This commit is contained in:
commit
d1e898f341
2 changed files with 6 additions and 2 deletions
|
@ -17,7 +17,7 @@
|
||||||
<%= if studytime? then render '/tiles/blokmap.*'end %>
|
<%= if studytime? then render '/tiles/blokmap.*'end %>
|
||||||
<!--next event -->
|
<!--next event -->
|
||||||
<div class="tile is-parent">
|
<div class="tile is-parent">
|
||||||
<%= render '/partials/_events_tile.*', event: upcoming_events[0] || all_events[-1] %>
|
<%= render '/partials/_events_tile.*', event: front_page_events[0] %>
|
||||||
</div>
|
</div>
|
||||||
<div class="tile">
|
<div class="tile">
|
||||||
<!--top coders -->
|
<!--top coders -->
|
||||||
|
@ -44,7 +44,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="tile">
|
<div class="tile">
|
||||||
<div class="tile is-vertical">
|
<div class="tile is-vertical">
|
||||||
<% all_events.reject { |x| x == (upcoming_events[0] || all_events[-1]) }.reverse[0..2].each do |event| %>
|
<% front_page_events[1..3].each do |event| %>
|
||||||
<div class="tile is-parent ">
|
<div class="tile is-parent ">
|
||||||
<%= render '/partials/_events_tile.*', event: event %>
|
<%= render '/partials/_events_tile.*', event: event %>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -33,6 +33,10 @@ module EventsHelper
|
||||||
@items.find_all('/events/*/*/main.md')
|
@items.find_all('/events/*/*/main.md')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def front_page_events
|
||||||
|
upcoming_events + all_events.reverse
|
||||||
|
end
|
||||||
|
|
||||||
def sub_events(grouped_event)
|
def sub_events(grouped_event)
|
||||||
if grouped_event.identifier =~ /main.md/
|
if grouped_event.identifier =~ /main.md/
|
||||||
query = grouped_event.identifier.to_s.split('/')[0..-2].join('/') + '/*'
|
query = grouped_event.identifier.to_s.split('/')[0..-2].join('/') + '/*'
|
||||||
|
|
Loading…
Reference in a new issue