view.rhtml
993 Bytes
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
<% if @article %>
<h2>
<%= link_to profile.identifier, :action => 'index' %>
<%= @article.hierarchy.map {|item| " / " + ((item == @article) ? item.name : link_to(item.name, :id => item.id)) } %>
</h2>
<% end %>
<%# list the children %>
<div class='article-children'>
<div class='file-manager-small'>
<ul>
<% @subitems.each do |item| %>
<li>
<%= file_manager_button(item.name, "icons-mime/#{item.icon_name}", :action => 'view', :id => item.id) %>
</li>
<% end %>
</ul>
</div>
<% if @article %>
<%= link_to _('New subitem'), :action => 'new', :parent_id => @article.id %>
<% else %>
<%= link_to _('New article'), :action => 'new' %>
<% end %>
</div>
<%# display the article content %>
<% if @article %>
<%= link_to_edit_article(@article) %>
<%= link_to _('Use as homepage'), { :action => 'set_home_page', :id => @article }, { :method => :post } %>
<h2><%= @article.name %></h2>
<%= @article.to_html %>
<% end %>