initial import boxroom 0.6.2
[boxroom-stian.git] / app / views / folder / list.rhtml
blob2b36e9cda1d68b2d27207259ab1131c29f709356
1 <p class="title">\r
2     <%= path(@folder, false) %>\r
3     &nbsp;\r
4 <% if @logged_in_user.is_admin? %>\r
5     <a href="#" onclick="ShowProperties();" class="small" id="rights_link">permissions</a>\r
6     <a href="#" onclick="ShowList();" class="small" id="list_link" style="display:none;">back to folder</a>\r
7 <% end %>\r
8     <%= link_to 'RSS', { :controller => 'folder', :action => 'feed', :id => controller.folder_id, :access_key => @logged_in_user.rss_access_key }, { :class => 'small' } %><%= link_to '(!)', { :controller => 'folder', :action => 'feed_warning' }, { :class => 'small', :style => 'margin-left:1px;' } %>\r
9 </p>\r
11 <div id="list" style="position:relative;"><div>\r
13 <% if flash[:folder_error] %>\r
14     <div id="error"><%= flash[:folder_error] %></div>\r
15 <% end %>\r
17     <table class="grid">\r
18         <tr>\r
19             <th></th>\r
20             <th width="239"><%= link_order 'Name', 'name' %></th>\r
21             <th width="82"><%= link_order 'Size', 'filesize' %></th>\r
22             <th><%= link_order 'Date Modified', 'date_modified' %></th>\r
23             <th></th>\r
24             <th></th>\r
25             <th></th>\r
26         </tr>\r
27 <% if @folder_up %>\r
28         <tr class="<%= cycle('even', 'odd') %>">\r
29             <td><%= image_tag('folder.png') %></td>\r
30             <td><%= @folder_up %></td>\r
31             <td>--</td>\r
32             <td>--</td>\r
33             <td></td>\r
34             <td></td>\r
35             <td></td>\r
36         </tr>\r
37 <% end %>\r
38 <% @folders.each do |folder| %>\r
39         <tr class="<%= cycle('even', 'odd') %>">\r
40             <td><%= image_tag('folder.png') %></td>\r
41             <td><%= link_to h(folder.name), :action => 'list', :id => folder %></td>\r
42             <td>--</td>\r
43             <td><%= folder.date_modified %></td>\r
44             <td>\r
45     <% if @can_update %>\r
46                 <%= link_to image_tag('edit.png'), { :action => 'rename', :id => folder}, { :title => 'Rename this folder' } %>\r
47     <% end %>\r
48             </td>\r
49             <td>\r
50     <% if @can_delete %>\r
51                 <%= link_to image_tag('delete.png'), {:action => 'destroy', :id => folder}, { :title => 'Delete this folder', :confirm => "All files and subfolders will be deleted!\nAre you sure?" } %>\r
52     <% end %>\r
53             </td>\r
54             <td></td>\r
55         </tr>\r
56 <% end %>\r
57 <% @myfiles.each do |myfile| %>\r
58         <tr class="<%= cycle('even', 'odd') %>">\r
59             <td><%= image_tag('file.png') %></td>\r
60             <td><%= link_to h(myfile.filename), :controller => 'file', :action => 'download', :id => myfile %></td>\r
61             <td><%= myfile.filesize %> KB</td>\r
62             <td><%= myfile.date_modified %></td>\r
63             <td>\r
64     <% if @can_update %>\r
65                 <%= link_to image_tag('edit.png'), { :controller => 'file', :action => 'rename', :id => myfile }, { :title => 'Rename this file' } %>\r
66     <% end %>\r
67             </td>\r
68             <td>\r
69     <% if @can_delete %>\r
70                 <%= link_to image_tag('delete.png'), { :controller => 'file', :action => 'destroy', :id => myfile }, { :title => 'Delete this file', :confirm => 'Are you sure?' } %>\r
71     <% end %>\r
72             </td>\r
73             <td>\r
74     <% if myfile.indexed %>\r
75                 <%= link_to image_tag('zoom.png'), { :controller => 'file', :action => 'preview', :id => myfile }, { :title => 'Preview', :class => 'noBackground' } %>\r
76     <% end %>\r
77             </td>\r
78         </tr>\r
79 <% end %>\r
80     </table>\r
81 </div></div>\r
83 <% reset_cycle %>\r
84 <% if @logged_in_user.is_admin? %>\r
85 <div id="folder_rights" style="display:none;position:relative;"><div>\r
86     <% form_tag :action => 'update_permissions', :id => params[:id] do %>\r
87         <table>\r
88             <tr>\r
89                 <th></th>\r
90                 <th></th>\r
91                 <th class="rights">Create</th>\r
92                 <th class="rights">Read</th>\r
93                 <th class="rights">Update</th>\r
94                 <th class="rights">Delete</th>\r
95             </tr>\r
96     <% Group.find(:all, :order => 'name').each do |group| %>\r
97             <tr class="<%= cycle('even', 'odd') %>">\r
98         <% disabled = group.is_the_administrators_group? %>\r
99         <% if disabled %>\r
100                 <td><%= image_tag('group_grey.png') %></td>\r
101                 <td style="color:#818181;"><%= h(group.name) %></td>\r
102         <% else %>\r
103                 <td><%= image_tag('group.png') %></td>\r
104                 <td><%= h(group.name) %></td>\r
105         <% end %>\r
106                 <td class="rights"><%= CRUD_check_box('create', group.id, controller.folder_id, disabled) %></td>\r
107                 <td class="rights"><%= CRUD_check_box('read', group.id, controller.folder_id, disabled) %></td>\r
108                 <td class="rights"><%= CRUD_check_box('update', group.id, controller.folder_id, disabled) %></td>\r
109                 <td class="rights"><%= CRUD_check_box('delete', group.id, controller.folder_id, disabled) %></td>\r
110             </tr>\r
111     <% end %>\r
112         </table>\r
113         <br>\r
114         <%= submit_tag 'Save' %> <%= check_box('update_recursively', 'checked', {}, 'yes', 'no') %> Apply changes to subfolders\r
115     <% end %>\r
116 </div></div>\r
117 <% end %>