view.rhtml
3.48 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<h1>
<%= _('Content management') %>
</h1>
<% button_bar(:style => 'margin-bottom: 1em;') do %>
<% parent_id = ((@article && @article.allow_children?) ? @article : nil) %>
<% if !@article or !@article.blog? %>
<%= button :newfolder, _('New folder'), :action => 'new', :type => 'Folder', :parent_id => parent_id %>
<%= button('upload-file', _('Upload files'), :action => 'upload_files', :parent_id => parent_id) %>
<% end %>
<%= lightbox_button('new', label_for_new_article(@article), :action => 'new', :parent_id => parent_id) %>
<%= button(:back, _('Back to control panel'), :controller => 'profile_editor', :action => "index") %>
<% end %>
<% if @article %>
<div id='article-full-path'>
<strong><%= _('Current folder: ') %></strong>
<%= link_to profile.identifier, :action => 'index' %>
<%= @article.hierarchy.map {|item| " / " + ((item == @article) ? item.name : link_to(item.slug, :id => item.id)) } %>
</div>
<% end %>
<table class='cms-articles'>
<%# header %>
<tr>
<th><%= _('Name') %></th>
<th><%= _('Type') %></th>
<th><%= _('Actions') %></th>
</tr>
<% if @article %>
<tr>
<td>
<%= image_tag 'icons-mime/gnome-folder.png' %>
<% if @article.parent %>
<%= link_to '.. (parent folder)', :action => 'view', :id => @article.parent.id %>
<% else %>
<%= link_to '.. (parent folder)', :action => 'index' %>
<% end %>
</td>
<td><%= Folder.short_description %></td>
<td> </td>
</tr>
<% end %>
<%# folders %>
<% for folder in @folders %>
<tr>
<td>
<%= image_tag(icon_for_article(folder)) %>
<%= link_to folder.name, :action => 'view', :id => folder.id %>
</td>
<td>
<%= folder.class.short_description %>
</td>
<td class="article-controls">
<%= button_without_text :edit, _('Properties'), :action => 'edit', :id => folder.id %>
<%= button_without_text :eyes, _('Public view'), folder.url %>
<% if !environment.enabled?('cant_change_homepage') %>
<%= button_without_text :home, _('Use as homepage'), { :action => 'set_home_page', :id => folder.id }, :method => :post %>
<% end %>
<%= button_without_text :delete, _('Delete'), { :action => 'destroy', :id => folder.id }, :method => :post, :confirm => _('Are you sure that you want to remove this folder? Note that all the items inside it will also be removed!') %>
</td>
</tr>
<% end %>
<%# non-folder subitems %>
<% for item in @subitems %>
<tr>
<td>
<%= image_tag(icon_for_article(item)) %>
<%= link_to item.name, :action => 'edit', :id => item.id %>
</td>
<td>
<%= item.class.short_description %>
</td>
<td class="article-controls">
<%= button_without_text :edit, _('Edit'), :action => 'edit', :id => item.id %>
<%= button_without_text :eyes, _('Public view'), item.url %>
<% if profile.person? %>
<%= button_without_text :spread, _('Spread this'), :action => 'publish', :id => item.id %>
<% end %>
<% if !environment.enabled?('cant_change_homepage') %>
<%= button_without_text :home, _('Use as homepage'), { :action => 'set_home_page', :id => item.id }, :method => :post %>
<% end %>
<%= button_without_text :delete, _('Delete'), { :action => 'destroy', :id => item.id }, :method => :post, :confirm => _('Are you sure that you want to remove this item?') %>
</td>
</tr>
<% end %>
</table>