Files
fetsite/app/views/neuigkeiten/_compact.html.erb
Andreas Stephanides b76239c850 neuigkeit relevant date
2015-03-08 22:33:50 +01:00

29 lines
1.5 KiB
Plaintext

<div class="media" itemscope itemtype="http://schema.org/Article">
<meta itemprop="sameAs" content="<%= rubrik_neuigkeit_path(neuigkeit.rubrik,neuigkeit, {theme: nil,locale: nil})%>"/>
<div class="pull-left" href="#">
<p><br>
<% unless neuigkeit.picture.url.nil? %><%= image_tag neuigkeit.picture.thumb.url %> <meta imageprop="thumbnailUrl" content="<%= neuigkeit.picture.thumb.url%>"/>
<% end %> </p>
</div>
<div class="media-body">
<div>
<small><%= ff_icon(neuigkeit.rubrik.icon) unless neuigkeit.rubrik.icon.nil? or neuigkeit.rubrik.icon.empty? %>&nbsp;<span itemprop="articleSection"><%= neuigkeit.rubrik.name %></span></small>
<% unless neuigkeit.has_calentries? %> <small class="pull-right"><% unless neuigkeit.try(:datum).try(:to_date).nil? %>
<%= I18n.t("neuigkeit.am") %>
<span itemprop="datePublished" datetime="<%= neuigkeit.try(:datum).to_formatted_s(:iso8601) unless neuigkeit.try(:datum).nil? %>"> <%= I18n.l(neuigkeit.try(:datum).try(:to_date))%> </span>
<% end %> </small> <% else %> <meta itemprop="datePublished" content="<%= neuigkeit.try(:datum).to_formatted_s(:iso8601) unless neuigkeit.try(:datum).nil? %>"/> <% end %>
</div>
<h1 itemprop="name">
<%= neuigkeit.title%>
</h1><div itemprop="description">
<%= raw(neuigkeit.text_first_words) unless neuigkeit.text.nil?%></div>
</div>
<% if neuigkeit.has_calentries? %>
<div class="pull-right" href="#">
<%= fa_icon("calendar 2x") %>
<%= neuigkeit.calentries.min{|c| c.days_to_today * ((c.is_past?)? 2:1)}.text %>
</div>
<% end %>
</div>