view.rhtml
2.33 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<% if @article %>
<h2 id='article-full-path'>
<%= icon('cms') %>
<%= link_to profile.identifier, :action => 'index' %>
<%= @article.hierarchy.map {|item| " / " + ((item == @article) ? item.name : link_to(item.name, :id => item.id)) } %>
</h2>
<% else %>
<h2>
<%= icon('cms') %>
<%= _('Content management') %>
</h2>
<% button_bar(:style => 'margin-bottom: 1em;') do %>
<%= button('new', _('New article'), :action => 'new') %>
<% end %>
<% end %>
<%# subitem %>
<% if !@subitems.empty? && @article %>
<%= toggle_panel(_('Hide subitems'), _('Show subitems'), 'article-subitems') %>
<% end %>
<div id='article-subitems'>
<div class='file-manager-title'><%= @article ? _('Subitems') : _('Articles') %></div>
<div class='file-manager-small'>
<% unless @subitems.empty? %>
<ul>
<% @subitems.each do |item| %>
<li>
<%= file_manager_button(item.name, "icons-mime/#{item.icon_name}", :action => 'view', :id => item.id) %>
</li>
<% end %>
</ul>
<% end %>
<% if @article %>
<% button_bar(:class => 'file-manager-controls') do %>
<%= button('new', _('New subitem'), :action => 'new', :parent_id => @article.id) %>
<%= button('up', _('Go up one level'), :action => (@article.parent ? 'view' : 'index'), :id => @article.parent) %>
<% end %>
<% end %>
</div>
</div> <!-- article-children -->
<%# display the article content %>
<div id='article-contents' style='clear: left;'>
<% if @article %>
<h2><%= @article.name %></h2>
<% button_bar(:id => 'article-controls') do %>
<ul>
<li>
<%= _('"%{article}", last changed by %{author}') % { :article => @article.name, :author => (@article.last_changed_by ? @article.last_changed_by.name : _('Unknown User')) } %>
</li>
<li>
<%= _('Public address of this article: %s') % (@article.public_path) %>
</li>
</ul>
<%= button('edit', _('Edit'), { :action => 'edit', :id => @article}) %>
<%= button('home', _('Use as homepage'), { :action => 'set_home_page', :id => @article }, { :method => :post }) %>
<%= button('delete', _('Delete'), { :action => 'destroy', :id => @article }, :method => :post, :confirm => _('Are you sure you wan to remove this article?')) %>
<% end %>
<%= @article.to_html %>
<% end %>
</div>