diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index d341f0f6e..900487364 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -62,6 +62,17 @@ class AttachmentsController < ApplicationController end end + #更新资源文件类型 + def updateType + @attachment = Attachment.find(params[:attachmentid]) + if @attachment != nil + @attachment.attachtype = params[:newtype] + @attachment.save + render :text =>'success' + else + render :text=>'error' + end + end def thumbnail if @attachment.thumbnailable? && thumbnail = @attachment.thumbnail(:size => params[:size]) diff --git a/app/views/attachments/_type_edit.html.erb b/app/views/attachments/_type_edit.html.erb new file mode 100644 index 000000000..79d0da0bb --- /dev/null +++ b/app/views/attachments/_type_edit.html.erb @@ -0,0 +1,14 @@ +<% edit_allowed = User.current.allowed_to?(:manage_files, @project) %> +<% if attachmenttypes.any? %> +