From c0c184d8bf319787c10e012890b30594b29f23db Mon Sep 17 00:00:00 2001 From: nwb Date: Wed, 14 May 2014 15:16:11 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=BF=AE=E6=AD=A3=E9=94=99=E8=AF=AF=202.?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=85=A8=E9=83=A8=E8=B5=84=E6=BA=90=E8=A7=86?= =?UTF-8?q?=E5=9B=BE=E6=97=B6=E7=9A=84=E5=AF=B9=E8=B5=84=E6=BA=90=E5=88=86?= =?UTF-8?q?=E7=B1=BB=E7=9A=84=E7=BC=96=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/files/_show_all_attachment.html.erb | 11 ++++++++++- app/views/files/_sort_by_attachtypel.html.erb | 1 - config/routes.rb | 6 +++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/app/views/files/_show_all_attachment.html.erb b/app/views/files/_show_all_attachment.html.erb index 98e31f874..ad207adf2 100644 --- a/app/views/files/_show_all_attachment.html.erb +++ b/app/views/files/_show_all_attachment.html.erb @@ -1,3 +1,5 @@ +<% selAttachType =@attachtype %> +<% selContentType =@contenttype %> <% attachmenttypes = @project.attachmenttypes %> <% delete_allowed = User.current.allowed_to?(:manage_files, @project) %> <% edit_allowed = User.current.allowed_to?(:manage_files, @project) %> @@ -35,7 +37,14 @@ <%= link_to_attachment file, :download => true, :title => file.filename+"\n"+file.description.to_s, :style => "width: 230px; overflow: hidden; white-space: nowrap;text-overflow: ellipsis;" %> <%= format_time(file.created_on) %> <%= number_to_human_size(file.filesize) %> - <%= file.attachmentstype.typeName %> + +
<%= file.attachmentstype.typeName %>
+   +
+ <%= render :partial => 'attachments/type_edit', :locals => {:attachmenttypes => attachmenttypes, + :attachment => file,:contentype=>selContentType} %> +
+ <%= file.show_suffix_type %> <%= file.downloads %> diff --git a/app/views/files/_sort_by_attachtypel.html.erb b/app/views/files/_sort_by_attachtypel.html.erb index 852502501..06aae4044 100644 --- a/app/views/files/_sort_by_attachtypel.html.erb +++ b/app/views/files/_sort_by_attachtypel.html.erb @@ -41,7 +41,6 @@ <%= render :partial => 'attachments/type_edit', :locals => {:attachmenttypes => attachmenttypes, :attachment => file,:contentype=>selContentType} %> - <%= file.show_suffix_type %> <%= file.downloads %> diff --git a/config/routes.rb b/config/routes.rb index b7e6dcebc..c743c2151 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -457,7 +457,11 @@ RedmineApp::Application.routes.draw do match 'attachments/autocomplete', :to => 'attachments#autocomplete', via: [:post] post 'attachments/relationfile', to: 'attachments#add_exist_file_to_project', as: 'attach_relation' post 'attachments/updateType/:attachmentid/:newtype' ,:to => 'attachments#updateType', :attachmentid => /\d+/, :newtype => /.*/ - resources :attachments, :only => [:show, :destroy] + resources :attachments, :only => [:show, :destroy] do + collection do + match "updateType" , via: [:get, :post] + end + end resources :groups do member do