Render next event on start page

This commit is contained in:
Stefan Schlott 2013-08-25 13:49:25 +02:00
parent 5dad6d53a1
commit 70b59ef67a
3 changed files with 10 additions and 23 deletions

View file

@ -29,38 +29,24 @@ feed:
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<% upcomingEvents = get_events().select { |e| e[:startdate] > Time.now }
if (upcomingEvents.size>0)
upcomingEvents.sort! { |a,b| a[:startdate] <=> b[:startdate] }
%>
<div class="span6"> <div class="span6">
<div class="well well-large"> <div class="well well-large">
<article itemscope itemtype="http://schema.org/EducationEvent"> <article itemscope itemtype="http://schema.org/EducationEvent">
<h1><a href="#">Nächster Vortrag</a></h1> <h1><a href="#">Nächster Vortrag</a></h1>
<%= render 'event_header', :item => upcomingEvents[0], :heading => false %>
<p> <p>
<strong>Termin:</strong> <a itemprop="url" href="<%= upcomingEvents[0].path() %>">Weitere Informationen</a> -
<span itemprop="startDate" content="2013-02-14T19:30">Donnerstag, 14. Februar 2013, 19:30 Uhr</span>
</p>
<p>
<strong>Thema:</strong>
<span itemprop="name">Über die besonderen Anforderungen beim Sammeln von historischen Großrechnern</span>
</p>
<p>
<strong>Referent:</strong>
<span itemprop="performer" itemscope itemtype="http://schema.org/Person">
<span itemprop="name">Wolfgang Stief</span>, GUUG München
</span>
</p>
<p>
<strong>Ort:</strong>
<span itemprop="location" itemscope itemtype="http://schema.org/Location">
<span itemprop="name">Stadtbibliothek am Mailänder Platz</span>, Max-Bense-Forum (UG)
</span>
</p>
<p>
<a itemprop="url" href="#">Weitere Informationen</a> -
<a href="#">Flyer (PDF)</a> - <a href="#">Flyer (PDF)</a> -
<a href="#">Aushang (PDF)</a> <a href="#">Aushang (PDF)</a>
</p> </p>
</article> </article>
</div> </div>
</div> </div>
<% end %>
<div class="span6"> <div class="span6">
<div class="well well-large"> <div class="well well-large">
<article itemscope itemtype="http://schema.org/SocialEvent"> <article itemscope itemtype="http://schema.org/SocialEvent">

View file

@ -3,7 +3,7 @@
<div class="row"> <div class="row">
<div class="span8"> <div class="span8">
<article itemscope itemtype="http://schema.org/EducationEvent"> <article itemscope itemtype="http://schema.org/EducationEvent">
<%= render 'event_header', :item => item %> <%= render 'event_header', :item => item, :heading => true %>
<hr> <hr>
<section itemprop="description"> <section itemprop="description">
<%= yield %> <%= yield %>

View file

@ -1,8 +1,9 @@
<header> <header>
<h1 itemprop="name"><a itemprop="url" href="<%= item.path %>"><%= item[:title] %></a></h1> <% if heading %><h1 itemprop="name"><%= item[:title] %></h1><% end %>
<strong>Termin:</strong> <strong>Termin:</strong>
<span itemprop="startDate" content="<%= @item[:startdate].strftime("%Y-%m-%d") %>T19:30"><%= @item[:startdate].strftime("%d.%m.%Y") %>, 19:30 Uhr</span> <span itemprop="startDate" content="<%= @item[:startdate].strftime("%Y-%m-%d") %>T19:30"><%= @item[:startdate].strftime("%d.%m.%Y") %>, 19:30 Uhr</span>
<br /> <br />
<% if !heading %><strong>Thema:</strong><span itemprop="name"><%= item[:title] %></span><br /><% end %>
<div class="commaseparated"> <div class="commaseparated">
<strong>Referent:</strong> <strong>Referent:</strong>
<ul> <ul>