Kalender als Snippet
This commit is contained in:
parent
d4307c711c
commit
940111d12a
2 changed files with 26 additions and 22 deletions
|
|
@ -6,28 +6,8 @@ if (upcomingEvents.size>0)
|
||||||
upcomingEvents.sort! { |a,b| a[:startdate].to_datetime <=> b[:startdate].to_datetime }
|
upcomingEvents.sort! { |a,b| a[:startdate].to_datetime <=> b[:startdate].to_datetime }
|
||||||
%>
|
%>
|
||||||
<h1>Kalender</h1>
|
<h1>Kalender</h1>
|
||||||
<ul>
|
<p>
|
||||||
<% upcomingEvents[0..9].each do |e| %>
|
<%= render 'calendar_list', :events => upcomingEvents.first(10) %>
|
||||||
<li>
|
|
||||||
<% if e[:startdate].instance_of?(Date) %>
|
|
||||||
<% if e[:startdate]<e[:enddate] %>
|
|
||||||
<%= e[:startdate].strftime("%d.%m.") %> - <%= e[:enddate].strftime("%d.%m.") %>:
|
|
||||||
<% else %>
|
|
||||||
<%= e[:startdate].strftime("%d.%m.") %>:
|
|
||||||
<% end %>
|
|
||||||
<% else %>
|
|
||||||
<%= e[:startdate].strftime("%d.%m., %H:%M") %>:
|
|
||||||
<% end %>
|
|
||||||
<% if e[:url] %>
|
|
||||||
<a href="<%= e[:url] %>"><%= e[:title] %></a>
|
|
||||||
<% elsif e.identifier.start_with?("/events") %>
|
|
||||||
<a href="<%= e.path %>"><%= e[:title] %></a>
|
|
||||||
<% else %>
|
|
||||||
<%= e[:title] %>
|
|
||||||
<% end %>
|
|
||||||
</li>
|
|
||||||
<% end %>
|
|
||||||
</ul>
|
|
||||||
<% end %>
|
<% end %>
|
||||||
<h1>Letzte Tweets</h1>
|
<h1>Letzte Tweets</h1>
|
||||||
<p>
|
<p>
|
||||||
|
|
|
||||||
24
layouts/calendar_list.erb
Normal file
24
layouts/calendar_list.erb
Normal file
|
|
@ -0,0 +1,24 @@
|
||||||
|
-----
|
||||||
|
filter: erb
|
||||||
|
-----
|
||||||
|
<ul><% @events.each do |e| %>
|
||||||
|
<li>
|
||||||
|
<% if e[:startdate].instance_of?(Date) %>
|
||||||
|
<% if e[:startdate]<e[:enddate] %>
|
||||||
|
<%= e[:startdate].strftime("%d.%m.") %> - <%= e[:enddate].strftime("%d.%m.") %>:
|
||||||
|
<% else %>
|
||||||
|
<%= e[:startdate].strftime("%d.%m.") %>:
|
||||||
|
<% end %>
|
||||||
|
<% else %>
|
||||||
|
<%= e[:startdate].strftime("%d.%m., %H:%M") %>:
|
||||||
|
<% end %>
|
||||||
|
<% if e[:url] %>
|
||||||
|
<a href="<%= e[:url] %>"><%= e[:title] %></a>
|
||||||
|
<% elsif e.identifier.start_with?("/events") %>
|
||||||
|
<a href="<%= e.path %>"><%= e[:title] %></a>
|
||||||
|
<% else %>
|
||||||
|
<%= e[:title] %>
|
||||||
|
<% end %>
|
||||||
|
</li>
|
||||||
|
<% end %></ul>
|
||||||
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue