fix homepage for blogpost previews

This commit is contained in:
Lorin Werthen 2021-02-25 12:55:30 +01:00
parent dc2794bb98
commit 584184da7a
No known key found for this signature in database
GPG key ID: F11FFC921E0E08E0
2 changed files with 47 additions and 46 deletions

View file

@ -17,11 +17,11 @@
<%= 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: front_page_events[0] %> <%= render '/partials/_events_tile.*', event: front_page_events.first %>
</div> </div>
<div class="tile"> <div class="tile">
<!--top coders --> <!--top coders -->
<div class="tile is-parent is-6"> <div class="tile is-parent">
<div class="tile is-child box gamification-tile"> <div class="tile is-child box gamification-tile">
<div class="content"> <div class="content">
<div class="tile-header"> <div class="tile-header">
@ -37,13 +37,12 @@
</div> </div>
</div> </div>
</div> </div>
<!-- latest blogpost -->
<div class="tile is-6 is-parent">
<%= render '/partials/_blog_preview.*', post: sorted_articles.first %>
</div>
</div> </div>
<div class="tile"> <div class="tile">
<div class="tile is-vertical"> <div class="tile is-vertical">
<div class="tile is-parent">
<h2 class="title">Events</h2>
</div>
<% front_page_events[1..3].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 %>
@ -51,12 +50,14 @@
<%end%> <%end%>
</div> </div>
<div class="tile is-vertical"> <div class="tile is-vertical">
<% sorted_articles[1..3].each do |post| %> <div class="tile is-parent">
<h2 class="title">Blogposts</h2>
</div>
<% sorted_articles[0..3].each do |post| %>
<div class="tile is-parent "> <div class="tile is-parent ">
<%= render '/partials/_blog_preview.*', post: post %> <%= render '/partials/_blog_preview.*', post: post %>
</div> </div>
<%end%> <%end%>
</div> </div>
</div> </div>
</div> </div>

View file

@ -17,5 +17,5 @@
<p> <p>
<%= excerptize(post.reps[:text].compiled_content, length: 500).tr("\n", ' ')%> <%= excerptize(post.reps[:text].compiled_content, length: 500).tr("\n", ' ')%>
</p> </p>
</div>
<hr> <hr>
</div>