##// END OF EJS Templates
Make the project files list sortable (#997)....
Jean-Philippe Lang -
r1315:fe74ab8c0644
parent child
Show More
@@ -1,428 +1,431
1 1 # redMine - project management software
2 2 # Copyright (C) 2006-2007 Jean-Philippe Lang
3 3 #
4 4 # This program is free software; you can redistribute it and/or
5 5 # modify it under the terms of the GNU General Public License
6 6 # as published by the Free Software Foundation; either version 2
7 7 # of the License, or (at your option) any later version.
8 8 #
9 9 # This program is distributed in the hope that it will be useful,
10 10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 12 # GNU General Public License for more details.
13 13 #
14 14 # You should have received a copy of the GNU General Public License
15 15 # along with this program; if not, write to the Free Software
16 16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 17
18 18 class ProjectsController < ApplicationController
19 19 layout 'base'
20 20 menu_item :overview
21 21 menu_item :activity, :only => :activity
22 22 menu_item :roadmap, :only => :roadmap
23 23 menu_item :files, :only => [:list_files, :add_file]
24 24 menu_item :settings, :only => :settings
25 25 menu_item :issues, :only => [:changelog]
26 26
27 27 before_filter :find_project, :except => [ :index, :list, :add, :activity ]
28 28 before_filter :find_optional_project, :only => :activity
29 29 before_filter :authorize, :except => [ :index, :list, :add, :archive, :unarchive, :destroy, :activity ]
30 30 before_filter :require_admin, :only => [ :add, :archive, :unarchive, :destroy ]
31 31 accept_key_auth :activity, :calendar
32 32
33 33 helper :sort
34 34 include SortHelper
35 35 helper :custom_fields
36 36 include CustomFieldsHelper
37 37 helper :ifpdf
38 38 include IfpdfHelper
39 39 helper :issues
40 40 helper IssuesHelper
41 41 helper :queries
42 42 include QueriesHelper
43 43 helper :repositories
44 44 include RepositoriesHelper
45 45 include ProjectsHelper
46 46
47 47 def index
48 48 list
49 49 render :action => 'list' unless request.xhr?
50 50 end
51 51
52 52 # Lists visible projects
53 53 def list
54 54 projects = Project.find :all,
55 55 :conditions => Project.visible_by(User.current),
56 56 :include => :parent
57 57 @project_tree = projects.group_by {|p| p.parent || p}
58 58 @project_tree.each_key {|p| @project_tree[p] -= [p]}
59 59 end
60 60
61 61 # Add a new project
62 62 def add
63 63 @custom_fields = IssueCustomField.find(:all, :order => "#{CustomField.table_name}.position")
64 64 @trackers = Tracker.all
65 65 @root_projects = Project.find(:all,
66 66 :conditions => "parent_id IS NULL AND status = #{Project::STATUS_ACTIVE}",
67 67 :order => 'name')
68 68 @project = Project.new(params[:project])
69 69 @project.enabled_module_names = Redmine::AccessControl.available_project_modules
70 70 if request.get?
71 71 @custom_values = ProjectCustomField.find(:all, :order => "#{CustomField.table_name}.position").collect { |x| CustomValue.new(:custom_field => x, :customized => @project) }
72 72 @project.trackers = Tracker.all
73 73 @project.is_public = Setting.default_projects_public?
74 74 else
75 75 @project.custom_fields = CustomField.find(params[:custom_field_ids]) if params[:custom_field_ids]
76 76 @custom_values = ProjectCustomField.find(:all, :order => "#{CustomField.table_name}.position").collect { |x| CustomValue.new(:custom_field => x, :customized => @project, :value => (params[:custom_fields] ? params["custom_fields"][x.id.to_s] : nil)) }
77 77 @project.custom_values = @custom_values
78 78 if @project.save
79 79 @project.enabled_module_names = params[:enabled_modules]
80 80 flash[:notice] = l(:notice_successful_create)
81 81 redirect_to :controller => 'admin', :action => 'projects'
82 82 end
83 83 end
84 84 end
85 85
86 86 # Show @project
87 87 def show
88 88 @custom_values = @project.custom_values.find(:all, :include => :custom_field, :order => "#{CustomField.table_name}.position")
89 89 @members_by_role = @project.members.find(:all, :include => [:user, :role], :order => 'position').group_by {|m| m.role}
90 90 @subprojects = @project.active_children
91 91 @news = @project.news.find(:all, :limit => 5, :include => [ :author, :project ], :order => "#{News.table_name}.created_on DESC")
92 92 @trackers = @project.rolled_up_trackers
93 93
94 94 cond = @project.project_condition(Setting.display_subprojects_issues?)
95 95 Issue.visible_by(User.current) do
96 96 @open_issues_by_tracker = Issue.count(:group => :tracker,
97 97 :include => [:project, :status, :tracker],
98 98 :conditions => ["(#{cond}) AND #{IssueStatus.table_name}.is_closed=?", false])
99 99 @total_issues_by_tracker = Issue.count(:group => :tracker,
100 100 :include => [:project, :status, :tracker],
101 101 :conditions => cond)
102 102 end
103 103 TimeEntry.visible_by(User.current) do
104 104 @total_hours = TimeEntry.sum(:hours,
105 105 :include => :project,
106 106 :conditions => cond).to_f
107 107 end
108 108 @key = User.current.rss_key
109 109 end
110 110
111 111 def settings
112 112 @root_projects = Project.find(:all,
113 113 :conditions => ["parent_id IS NULL AND status = #{Project::STATUS_ACTIVE} AND id <> ?", @project.id],
114 114 :order => 'name')
115 115 @custom_fields = IssueCustomField.find(:all)
116 116 @issue_category ||= IssueCategory.new
117 117 @member ||= @project.members.new
118 118 @trackers = Tracker.all
119 119 @custom_values ||= ProjectCustomField.find(:all, :order => "#{CustomField.table_name}.position").collect { |x| @project.custom_values.find_by_custom_field_id(x.id) || CustomValue.new(:custom_field => x) }
120 120 @repository ||= @project.repository
121 121 @wiki ||= @project.wiki
122 122 end
123 123
124 124 # Edit @project
125 125 def edit
126 126 if request.post?
127 127 if params[:custom_fields]
128 128 @custom_values = ProjectCustomField.find(:all, :order => "#{CustomField.table_name}.position").collect { |x| CustomValue.new(:custom_field => x, :customized => @project, :value => params["custom_fields"][x.id.to_s]) }
129 129 @project.custom_values = @custom_values
130 130 end
131 131 @project.attributes = params[:project]
132 132 if @project.save
133 133 flash[:notice] = l(:notice_successful_update)
134 134 redirect_to :action => 'settings', :id => @project
135 135 else
136 136 settings
137 137 render :action => 'settings'
138 138 end
139 139 end
140 140 end
141 141
142 142 def modules
143 143 @project.enabled_module_names = params[:enabled_modules]
144 144 redirect_to :action => 'settings', :id => @project, :tab => 'modules'
145 145 end
146 146
147 147 def archive
148 148 @project.archive if request.post? && @project.active?
149 149 redirect_to :controller => 'admin', :action => 'projects'
150 150 end
151 151
152 152 def unarchive
153 153 @project.unarchive if request.post? && !@project.active?
154 154 redirect_to :controller => 'admin', :action => 'projects'
155 155 end
156 156
157 157 # Delete @project
158 158 def destroy
159 159 @project_to_destroy = @project
160 160 if request.post? and params[:confirm]
161 161 @project_to_destroy.destroy
162 162 redirect_to :controller => 'admin', :action => 'projects'
163 163 end
164 164 # hide project in layout
165 165 @project = nil
166 166 end
167 167
168 168 # Add a new issue category to @project
169 169 def add_issue_category
170 170 @category = @project.issue_categories.build(params[:category])
171 171 if request.post? and @category.save
172 172 respond_to do |format|
173 173 format.html do
174 174 flash[:notice] = l(:notice_successful_create)
175 175 redirect_to :action => 'settings', :tab => 'categories', :id => @project
176 176 end
177 177 format.js do
178 178 # IE doesn't support the replace_html rjs method for select box options
179 179 render(:update) {|page| page.replace "issue_category_id",
180 180 content_tag('select', '<option></option>' + options_from_collection_for_select(@project.issue_categories, 'id', 'name', @category.id), :id => 'issue_category_id', :name => 'issue[category_id]')
181 181 }
182 182 end
183 183 end
184 184 end
185 185 end
186 186
187 187 # Add a new version to @project
188 188 def add_version
189 189 @version = @project.versions.build(params[:version])
190 190 if request.post? and @version.save
191 191 flash[:notice] = l(:notice_successful_create)
192 192 redirect_to :action => 'settings', :tab => 'versions', :id => @project
193 193 end
194 194 end
195 195
196 196 def add_file
197 197 if request.post?
198 198 @version = @project.versions.find_by_id(params[:version_id])
199 199 attachments = attach_files(@version, params[:attachments])
200 200 Mailer.deliver_attachments_added(attachments) if !attachments.empty? && Setting.notified_events.include?('file_added')
201 201 redirect_to :controller => 'projects', :action => 'list_files', :id => @project
202 202 end
203 203 @versions = @project.versions.sort
204 204 end
205 205
206 206 def list_files
207 @versions = @project.versions.sort.reverse
207 sort_init "#{Attachment.table_name}.filename", "asc"
208 sort_update
209 @versions = @project.versions.find(:all, :include => :attachments, :order => sort_clause).sort.reverse
210 render :layout => !request.xhr?
208 211 end
209 212
210 213 # Show changelog for @project
211 214 def changelog
212 215 @trackers = @project.trackers.find(:all, :conditions => ["is_in_chlog=?", true], :order => 'position')
213 216 retrieve_selected_tracker_ids(@trackers)
214 217 @versions = @project.versions.sort
215 218 end
216 219
217 220 def roadmap
218 221 @trackers = @project.trackers.find(:all, :conditions => ["is_in_roadmap=?", true])
219 222 retrieve_selected_tracker_ids(@trackers)
220 223 @versions = @project.versions.sort
221 224 @versions = @versions.select {|v| !v.completed? } unless params[:completed]
222 225 end
223 226
224 227 def activity
225 228 @days = Setting.activity_days_default.to_i
226 229
227 230 if params[:from]
228 231 begin; @date_to = params[:from].to_date; rescue; end
229 232 end
230 233
231 234 @date_to ||= Date.today + 1
232 235 @date_from = @date_to - @days
233 236
234 237 @event_types = %w(issues news files documents changesets wiki_pages messages)
235 238 if @project
236 239 @event_types.delete('wiki_pages') unless @project.wiki
237 240 @event_types.delete('changesets') unless @project.repository
238 241 @event_types.delete('messages') unless @project.boards.any?
239 242 # only show what the user is allowed to view
240 243 @event_types = @event_types.select {|o| User.current.allowed_to?("view_#{o}".to_sym, @project)}
241 244 @with_subprojects = params[:with_subprojects].nil? ? Setting.display_subprojects_issues? : (params[:with_subprojects] == '1')
242 245 end
243 246 @scope = @event_types.select {|t| params["show_#{t}"]}
244 247 # default events if none is specified in parameters
245 248 @scope = (@event_types - %w(wiki_pages messages))if @scope.empty?
246 249
247 250 @events = []
248 251
249 252 if @scope.include?('issues')
250 253 cond = ARCondition.new(Project.allowed_to_condition(User.current, :view_issues, :project => @project, :with_subprojects => @with_subprojects))
251 254 cond.add(["#{Issue.table_name}.created_on BETWEEN ? AND ?", @date_from, @date_to])
252 255 @events += Issue.find(:all, :include => [:project, :author, :tracker], :conditions => cond.conditions)
253 256
254 257 cond = ARCondition.new(Project.allowed_to_condition(User.current, :view_issues, :project => @project, :with_subprojects => @with_subprojects))
255 258 cond.add(["#{Journal.table_name}.journalized_type = 'Issue' AND #{JournalDetail.table_name}.prop_key = 'status_id' AND #{Journal.table_name}.created_on BETWEEN ? AND ?", @date_from, @date_to])
256 259 @events += Journal.find(:all, :include => [{:issue => :project}, :details, :user], :conditions => cond.conditions)
257 260 end
258 261
259 262 if @scope.include?('news')
260 263 cond = ARCondition.new(Project.allowed_to_condition(User.current, :view_news, :project => @project, :with_subprojects => @with_subprojects))
261 264 cond.add(["#{News.table_name}.created_on BETWEEN ? AND ?", @date_from, @date_to])
262 265 @events += News.find(:all, :include => [:project, :author], :conditions => cond.conditions)
263 266 end
264 267
265 268 if @scope.include?('files')
266 269 cond = ARCondition.new(Project.allowed_to_condition(User.current, :view_files, :project => @project, :with_subprojects => @with_subprojects))
267 270 cond.add(["#{Attachment.table_name}.created_on BETWEEN ? AND ?", @date_from, @date_to])
268 271 @events += Attachment.find(:all, :select => "#{Attachment.table_name}.*",
269 272 :joins => "LEFT JOIN #{Version.table_name} ON #{Attachment.table_name}.container_type='Version' AND #{Version.table_name}.id = #{Attachment.table_name}.container_id " +
270 273 "LEFT JOIN #{Project.table_name} ON #{Version.table_name}.project_id = #{Project.table_name}.id",
271 274 :conditions => cond.conditions)
272 275 end
273 276
274 277 if @scope.include?('documents')
275 278 cond = ARCondition.new(Project.allowed_to_condition(User.current, :view_documents, :project => @project, :with_subprojects => @with_subprojects))
276 279 cond.add(["#{Document.table_name}.created_on BETWEEN ? AND ?", @date_from, @date_to])
277 280 @events += Document.find(:all, :include => :project, :conditions => cond.conditions)
278 281
279 282 cond = ARCondition.new(Project.allowed_to_condition(User.current, :view_documents, :project => @project, :with_subprojects => @with_subprojects))
280 283 cond.add(["#{Attachment.table_name}.created_on BETWEEN ? AND ?", @date_from, @date_to])
281 284 @events += Attachment.find(:all, :select => "#{Attachment.table_name}.*",
282 285 :joins => "LEFT JOIN #{Document.table_name} ON #{Attachment.table_name}.container_type='Document' AND #{Document.table_name}.id = #{Attachment.table_name}.container_id " +
283 286 "LEFT JOIN #{Project.table_name} ON #{Document.table_name}.project_id = #{Project.table_name}.id",
284 287 :conditions => cond.conditions)
285 288 end
286 289
287 290 if @scope.include?('wiki_pages')
288 291 select = "#{WikiContent.versioned_table_name}.updated_on, #{WikiContent.versioned_table_name}.comments, " +
289 292 "#{WikiContent.versioned_table_name}.#{WikiContent.version_column}, #{WikiPage.table_name}.title, " +
290 293 "#{WikiContent.versioned_table_name}.page_id, #{WikiContent.versioned_table_name}.author_id, " +
291 294 "#{WikiContent.versioned_table_name}.id"
292 295 joins = "LEFT JOIN #{WikiPage.table_name} ON #{WikiPage.table_name}.id = #{WikiContent.versioned_table_name}.page_id " +
293 296 "LEFT JOIN #{Wiki.table_name} ON #{Wiki.table_name}.id = #{WikiPage.table_name}.wiki_id " +
294 297 "LEFT JOIN #{Project.table_name} ON #{Project.table_name}.id = #{Wiki.table_name}.project_id"
295 298
296 299 cond = ARCondition.new(Project.allowed_to_condition(User.current, :view_wiki_pages, :project => @project, :with_subprojects => @with_subprojects))
297 300 cond.add(["#{WikiContent.versioned_table_name}.updated_on BETWEEN ? AND ?", @date_from, @date_to])
298 301 @events += WikiContent.versioned_class.find(:all, :select => select, :joins => joins, :conditions => cond.conditions)
299 302 end
300 303
301 304 if @scope.include?('changesets')
302 305 cond = ARCondition.new(Project.allowed_to_condition(User.current, :view_changesets, :project => @project, :with_subprojects => @with_subprojects))
303 306 cond.add(["#{Changeset.table_name}.committed_on BETWEEN ? AND ?", @date_from, @date_to])
304 307 @events += Changeset.find(:all, :include => {:repository => :project}, :conditions => cond.conditions)
305 308 end
306 309
307 310 if @scope.include?('messages')
308 311 cond = ARCondition.new(Project.allowed_to_condition(User.current, :view_messages, :project => @project, :with_subprojects => @with_subprojects))
309 312 cond.add(["#{Message.table_name}.created_on BETWEEN ? AND ?", @date_from, @date_to])
310 313 @events += Message.find(:all, :include => [{:board => :project}, :author], :conditions => cond.conditions)
311 314 end
312 315
313 316 @events_by_day = @events.group_by(&:event_date)
314 317
315 318 respond_to do |format|
316 319 format.html { render :layout => false if request.xhr? }
317 320 format.atom { render_feed(@events, :title => "#{@project || Setting.app_title}: #{l(:label_activity)}") }
318 321 end
319 322 end
320 323
321 324 def calendar
322 325 @trackers = @project.rolled_up_trackers
323 326 retrieve_selected_tracker_ids(@trackers)
324 327
325 328 if params[:year] and params[:year].to_i > 1900
326 329 @year = params[:year].to_i
327 330 if params[:month] and params[:month].to_i > 0 and params[:month].to_i < 13
328 331 @month = params[:month].to_i
329 332 end
330 333 end
331 334 @year ||= Date.today.year
332 335 @month ||= Date.today.month
333 336 @calendar = Redmine::Helpers::Calendar.new(Date.civil(@year, @month, 1), current_language, :month)
334 337 @with_subprojects = params[:with_subprojects].nil? ? Setting.display_subprojects_issues? : (params[:with_subprojects] == '1')
335 338 events = []
336 339 @project.issues_with_subprojects(@with_subprojects) do
337 340 events += Issue.find(:all,
338 341 :include => [:tracker, :status, :assigned_to, :priority, :project],
339 342 :conditions => ["((start_date BETWEEN ? AND ?) OR (due_date BETWEEN ? AND ?)) AND #{Issue.table_name}.tracker_id IN (#{@selected_tracker_ids.join(',')})", @calendar.startdt, @calendar.enddt, @calendar.startdt, @calendar.enddt]
340 343 ) unless @selected_tracker_ids.empty?
341 344 end
342 345 events += @project.versions.find(:all, :conditions => ["effective_date BETWEEN ? AND ?", @calendar.startdt, @calendar.enddt])
343 346 @calendar.events = events
344 347
345 348 render :layout => false if request.xhr?
346 349 end
347 350
348 351 def gantt
349 352 @trackers = @project.rolled_up_trackers
350 353 retrieve_selected_tracker_ids(@trackers)
351 354
352 355 if params[:year] and params[:year].to_i >0
353 356 @year_from = params[:year].to_i
354 357 if params[:month] and params[:month].to_i >=1 and params[:month].to_i <= 12
355 358 @month_from = params[:month].to_i
356 359 else
357 360 @month_from = 1
358 361 end
359 362 else
360 363 @month_from ||= Date.today.month
361 364 @year_from ||= Date.today.year
362 365 end
363 366
364 367 zoom = (params[:zoom] || User.current.pref[:gantt_zoom]).to_i
365 368 @zoom = (zoom > 0 && zoom < 5) ? zoom : 2
366 369 months = (params[:months] || User.current.pref[:gantt_months]).to_i
367 370 @months = (months > 0 && months < 25) ? months : 6
368 371
369 372 # Save gantt paramters as user preference (zoom and months count)
370 373 if (User.current.logged? && (@zoom != User.current.pref[:gantt_zoom] || @months != User.current.pref[:gantt_months]))
371 374 User.current.pref[:gantt_zoom], User.current.pref[:gantt_months] = @zoom, @months
372 375 User.current.preference.save
373 376 end
374 377
375 378 @date_from = Date.civil(@year_from, @month_from, 1)
376 379 @date_to = (@date_from >> @months) - 1
377 380 @with_subprojects = params[:with_subprojects].nil? ? Setting.display_subprojects_issues? : (params[:with_subprojects] == '1')
378 381
379 382 @events = []
380 383 @project.issues_with_subprojects(@with_subprojects) do
381 384 @events += Issue.find(:all,
382 385 :order => "start_date, due_date",
383 386 :include => [:tracker, :status, :assigned_to, :priority, :project],
384 387 :conditions => ["(((start_date>=? and start_date<=?) or (due_date>=? and due_date<=?) or (start_date<? and due_date>?)) and start_date is not null and due_date is not null and #{Issue.table_name}.tracker_id in (#{@selected_tracker_ids.join(',')}))", @date_from, @date_to, @date_from, @date_to, @date_from, @date_to]
385 388 ) unless @selected_tracker_ids.empty?
386 389 end
387 390 @events += @project.versions.find(:all, :conditions => ["effective_date BETWEEN ? AND ?", @date_from, @date_to])
388 391 @events.sort! {|x,y| x.start_date <=> y.start_date }
389 392
390 393 if params[:format]=='pdf'
391 394 @options_for_rfpdf ||= {}
392 395 @options_for_rfpdf[:file_name] = "#{@project.identifier}-gantt.pdf"
393 396 render :template => "projects/gantt.rfpdf", :layout => false
394 397 elsif params[:format]=='png' && respond_to?('gantt_image')
395 398 image = gantt_image(@events, @date_from, @months, @zoom)
396 399 image.format = 'PNG'
397 400 send_data(image.to_blob, :disposition => 'inline', :type => 'image/png', :filename => "#{@project.identifier}-gantt.png")
398 401 else
399 402 render :template => "projects/gantt.rhtml"
400 403 end
401 404 end
402 405
403 406 private
404 407 # Find project of id params[:id]
405 408 # if not found, redirect to project list
406 409 # Used as a before_filter
407 410 def find_project
408 411 @project = Project.find(params[:id])
409 412 rescue ActiveRecord::RecordNotFound
410 413 render_404
411 414 end
412 415
413 416 def find_optional_project
414 417 return true unless params[:id]
415 418 @project = Project.find(params[:id])
416 419 authorize
417 420 rescue ActiveRecord::RecordNotFound
418 421 render_404
419 422 end
420 423
421 424 def retrieve_selected_tracker_ids(selectable_trackers)
422 425 if ids = params[:tracker_ids]
423 426 @selected_tracker_ids = (ids.is_a? Array) ? ids.collect { |id| id.to_i.to_s } : ids.split('/').collect { |id| id.to_i.to_s }
424 427 else
425 428 @selected_tracker_ids = selectable_trackers.collect {|t| t.id.to_s }
426 429 end
427 430 end
428 431 end
@@ -1,45 +1,45
1 1 <div class="contextual">
2 2 <%= link_to_if_authorized l(:label_attachment_new), {:controller => 'projects', :action => 'add_file', :id => @project}, :class => 'icon icon-add' %>
3 3 </div>
4 4
5 5 <h2><%=l(:label_attachment_plural)%></h2>
6 6
7 7 <% delete_allowed = authorize_for('versions', 'destroy_file') %>
8 8
9 9 <table class="list">
10 10 <thead><tr>
11 11 <th><%=l(:field_version)%></th>
12 <th><%=l(:field_filename)%></th>
13 <th><%=l(:label_date)%></th>
14 <th><%=l(:field_filesize)%></th>
15 <th><%=l(:label_downloads_abbr)%></th>
12 <%= sort_header_tag("#{Attachment.table_name}.filename", :caption => l(:field_filename)) %>
13 <%= sort_header_tag("#{Attachment.table_name}.created_on", :caption => l(:label_date), :default_order => 'desc') %>
14 <%= sort_header_tag("#{Attachment.table_name}.filesize", :caption => l(:field_filesize), :default_order => 'desc') %>
15 <%= sort_header_tag("#{Attachment.table_name}.downloads", :caption => l(:label_downloads_abbr), :default_order => 'desc') %>
16 16 <th>MD5</th>
17 17 <% if delete_allowed %><th></th><% end %>
18 18 </tr></thead>
19 19 <tbody>
20 20 <% for version in @versions %>
21 21 <% unless version.attachments.empty? %>
22 22 <tr><th colspan="7" align="left"><span class="icon icon-package"><b><%= version.name %></b></span></th></tr>
23 23 <% for file in version.attachments %>
24 24 <tr class="<%= cycle("odd", "even") %>">
25 25 <td></td>
26 26 <td><%= link_to(file.filename, {:controller => 'versions', :action => 'download', :id => version, :attachment_id => file},
27 27 :title => file.description) %></td>
28 28 <td align="center"><%= format_time(file.created_on) %></td>
29 29 <td align="center"><%= number_to_human_size(file.filesize) %></td>
30 30 <td align="center"><%= file.downloads %></td>
31 31 <td align="center"><small><%= file.digest %></small></td>
32 32 <% if delete_allowed %>
33 33 <td align="center">
34 34 <%= link_to_if_authorized image_tag('delete.png'), {:controller => 'versions', :action => 'destroy_file', :id => version, :attachment_id => file}, :confirm => l(:text_are_you_sure), :method => :post %>
35 35 </td>
36 36 <% end %>
37 37 </tr>
38 38 <% end
39 39 reset_cycle %>
40 40 <% end %>
41 41 <% end %>
42 42 </tbody>
43 43 </table>
44 44
45 45 <% html_title(l(:label_attachment_plural)) -%>
General Comments 0
You need to be logged in to leave comments. Login now