generalize events more

This commit is contained in:
Lorin Werthen 2017-02-16 16:04:00 +01:00
parent b00603ae26
commit 324fb0989c
No known key found for this signature in database
GPG key ID: F11FFC921E0E08E0
3 changed files with 34 additions and 70 deletions

View file

@ -3,59 +3,32 @@ navigable: true
title: Events title: Events
order: 20 order: 20
--- ---
<div class="container">
<div>
<div class="content"> <div class="content">
<h1>Upcoming events</h1> <h1>Upcoming events</h1>
</div> </div>
<div class="container">
<% upcoming_events.each_slice(2) do |slice| %> <% upcoming_events.each_slice(2) do |slice| %>
<!-- <hr class="divider"> --> <div class="columns">
<div class="columns"> <% slice.each do |event| %>
<% slice.each do |event| %> <div class="tile is-parent ">
<% if (sub_events(event)).empty? %> <%= render '/partials/_events_tile.*', event: event %>
<div class="tile is-parent ">
<%= render '/partials/_events_tile.*',
article: event,
small_text: event[:time].strftime('%A %d %B %Y %H:%M'),
location: event[:location],
color: event[:color] %>
</div>
<!-- Render old event_preview when using subevent, for now not used
<% else %>
<% sub_events(event).each do |sub_event| %>
<%= render '/partials/_event_preview.*', event: sub_event, main_event: event %>
<% end %>
<% end %>
-->
<% end %>
</div> </div>
<% end %>
</div>
<% end %> <% end %>
</div> </div>
<div class="content ">
<div class="container">
<div class="content">
<h1>Past events</h1> <h1>Past events</h1>
</div> </div>
<% past_events.each_slice(2) do |slice| %> <% past_events.each_slice(2) do |slice| %>
<!-- <hr class="divider"> --> <div class="columns">
<div class="columns"> <% slice.each do |event| %>
<% slice.each do |event| %> <div class="tile is-parent ">
<% if (sub_events(event)).empty? %> <%= render '/partials/_events_tile.*', event: event %>
<div class="tile is-parent ">
<%= render '/partials/_events_tile.*',
article: event,
small_text: event[:time].strftime('%A %d %B %Y %H:%M'),
location: event[:location],
color: event[:color] %>
</div>
<!-- Render old event_preview when using subevent, for now not used
<% else %>
<% sub_events(event).each do |sub_event| %>
<%= render '/partials/_event_preview.*', event: sub_event, main_event: event %>
<% end %>
<% end %>
-->
<% end %>
</div> </div>
<%end%> <% end %>
</div>
<% end %>
</div> </div>

View file

@ -24,10 +24,8 @@
</div> </div>
</div> </div>
<!--next event --> <!--next event -->
<div class="tile is-parent is-4" > <div class="tile is-parent is-4">
<%= render '/partials/_tile.*', <%= render '/partials/_events_tile.*', event: upcoming_events[0] || all_events[-1] %>
article: upcoming_events[0] || all_events[-1],
small_text: if upcoming_events[0] then "Upcoming event" else "Past event" end%>
</div> </div>
<!-- latest blogpost --> <!-- latest blogpost -->
@ -41,13 +39,10 @@
<div class="tile"> <div class="tile">
<div class="tile is-vertical"> <div class="tile is-vertical">
<% all_events.reject { |x| x == upcoming_events[0] }.reverse[0..2].each do |event| %> <% all_events.reject { |x| x == upcoming_events[0] }.reverse[0..2].each do |event| %>
<div class="tile is-parent "> <div class="tile is-parent ">
<%= render '/partials/_tile.*', <%= render '/partials/_events_tile.*', event: event %>
article: event,
small_text: upcoming_events.include?(event) ? "Upcoming event" : "Past event",
htmlclass:"highlighted" %>
</div> </div>
<%end%> <%end%>
</div> </div>
<div class="tile is-vertical"> <div class="tile is-vertical">
<% sorted_articles[1..3].each do |post| %> <% sorted_articles[1..3].each do |post| %>

View file

@ -1,36 +1,32 @@
<% if @article[:banner] %> <% if @event[:banner] %>
<a href="<%= @article.path %>" class="tile is-child box backgroundimg highlighted" <a href="<%= @event.path %>" class="tile is-child box backgroundimg highlighted"
style="background-image:url('<%= @article[:banner] %>');"> style="background-image:url('<%= @event[:banner] %>');">
<% elsif @article[:color] %> <% elsif @event[:color] %>
<a href="<%= @article.path %>" class="tile is-child box backgroundimg highlighted" <a href="<%= @event.path %>" class="tile is-child box backgroundimg highlighted"
style="background-image: linear-gradient(to top right,rgba(255,255,255,0),rgba(0,0,0,.60)); background-color:<%= @article[:color] %>;"> style="background-image: linear-gradient(to top right,rgba(255,255,255,0),rgba(0,0,0,.60)); background-color:<%= @event[:color] %>;">
<% else %> <% else %>
<a href="<%= @article.path %>" class="tile is-child box backgroundimg"> <a href="<%= @event.path %>" class="tile is-child box backgroundimg">
<% end %> <% end %>
<div class="content"> <div class="content">
<div class="columns"> <div class="columns">
<div class="column"> <div class="column">
<h2> <h2>
<%= @article[:title] %> <%= @event[:title] %>
</h2> </h2>
</div> </div>
<div class="column is-narrow"> <div class="column is-narrow">
<small> <small>
<%= @small_text %> <%= @event[:time].strftime('%A %d %B %Y %H:%M') %>
<br> <br>
<%= @location %> <%= @event[:location] %>
</small> </small>
</div>
<div class="column is-narrow">
</div> </div>
</div> </div>
<div class="description"> <div class="description">
<%= @article[:description] %> <%= @event[:description] %>
</div> </div>
<div class="teaser"> <div class="teaser">
<%= get_teaser(@article) %> <%= get_teaser(@event) %>
</div> </div>
</div> </div>
</a> </a>