recent_content_block.html.erb
1.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<% unless root.nil? %>
<div id="recent-content-block">
<% children = block.articles_of_folder(root, block.total_items)%>
<div class="recent-content">
<%= block_title(block.title.blank? ? c_("Recent content") : block.title ) %>
<% if block.show_blog_picture and !root.image.nil? %>
<div class="recent-content-cover">
<%= image_tag(root.image.public_filename(:big)) %>
</div>
<% end %>
</div>
<% if block.mode?('title_only') %>
<div class="recent-content-title">
<ul>
<% children.each do |item| %>
<li> <%= link_to(h(item.title), item.url)%></li>
<% end %>
</ul>
</div>
<% elsif block.mode?('title_and_abstract') %>
<div class="recent-content-abstract">
<% children.each do |item| %>
<h2><%= link_to(item.title,item.url, :class => 'post-title')%></h2>
<span class="post-date"><%= show_date(item.published_at, true)%></span>
<div class="headline"><%=item.lead%></div>
<p class="highlighted-news-read-more"><%= link_to(_('Read more'), item.url) %></p>
<% end %>
</div>
<% else %>
<div class="recent-content-full">
<% children.each do |item| %>
<h2><%= link_to(item.title,item.url, :class => 'post-title')%></h2>
<span class="post-date"><%= show_date(item.published_at, true)%></span>
<div class="headline"><%=item.body%></div>
<p class="highlighted-news-read-more"><%= link_to(_('Read more'), item.url) %></p>
<% end %>
</div>
<% end %>
<%= link_to _('View All'), :profile => profile.identifier, :controller => 'content_viewer', :action => 'view_page', :page => block.root.path %>
</div>
<% else %>
<span class="alert-block">
<%= _('This is the recent content block. Please edit it to show the content you want.') %>
</span>
<% end %>