From 15ab0113c95740d9a7a8246070cd6096e7851606 Mon Sep 17 00:00:00 2001 From: Lorin Werthen Date: Wed, 8 Feb 2017 13:50:59 +0100 Subject: [PATCH] more ruby-esque stuff --- content/assets/stylesheets/includes/tiles.scss | 2 +- content/index.erb | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/content/assets/stylesheets/includes/tiles.scss b/content/assets/stylesheets/includes/tiles.scss index 6ac2b59..bd43fe4 100644 --- a/content/assets/stylesheets/includes/tiles.scss +++ b/content/assets/stylesheets/includes/tiles.scss @@ -122,5 +122,5 @@ a.box { } .backgroundimg{ - Background-position: center; + background-position: center; } diff --git a/content/index.erb b/content/index.erb index 4ab94a8..3f14787 100644 --- a/content/index.erb +++ b/content/index.erb @@ -36,20 +36,20 @@
- <% for i in [0,1,2] do event = upcoming_events[1+i] || all_events[-2-i] %> + <% all_events.reverse[1..3].each do |event| %>
<%= render '/partials/_tile.*', - article: event, - small_text: if upcoming_events[1] then "Upcoming event" else "Past event" end, - htmlclass:"highlighted"%> + article: event, + small_text: upcoming_events.include?(event) ? "Upcoming event" : "Past event", + htmlclass:"highlighted" %>
<%end%>
- <% for i in [1,2,3] do post = sorted_articles[i] %> + <% sorted_articles[1..3].each do |post| %>
<%= render '/partials/_tile.*', - article: post, + article: post, small_text: "blogpost"%>
<%end%> @@ -60,7 +60,7 @@
<%= asset :js, :gamification %> <%= asset :js, :quote %> -