From 59f42bb54fcd95608091ea90275a7ecf97928191 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Thu, 24 Dec 2015 11:09:57 +0800 Subject: [PATCH] =?UTF-8?q?1.=E5=B0=86=E6=B7=BB=E5=8A=A0=E9=99=84=E5=8A=A0?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E5=8A=A0=E5=85=A5=E5=88=B0=E7=BB=84=E7=BB=87?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E4=B8=AD=E7=9A=84=E6=96=B0=E5=BB=BA=E7=BB=84?= =?UTF-8?q?=E7=BB=87=E6=96=87=E7=AB=A0=EF=BC=9B=202.=E8=A7=A3=E5=86=B3?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E6=96=87=E7=AB=A0=E9=99=84=E4=BB=B6=E4=B8=8D?= =?UTF-8?q?=E8=83=BD=E4=B8=8A=E4=BC=A0=E7=9A=84=E9=97=AE=E9=A2=98=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/org_document_comments_controller.rb | 5 ++++- app/views/attachments/_form_course.html.erb | 3 +-- app/views/org_document_comments/_attachment.html.erb | 2 +- app/views/org_document_comments/_new.html.erb | 8 ++++++-- app/views/organizations/_project_message.html.erb | 4 ++-- 5 files changed, 14 insertions(+), 8 deletions(-) diff --git a/app/controllers/org_document_comments_controller.rb b/app/controllers/org_document_comments_controller.rb index 67d3b247a..7685b77a8 100644 --- a/app/controllers/org_document_comments_controller.rb +++ b/app/controllers/org_document_comments_controller.rb @@ -28,6 +28,7 @@ class OrgDocumentCommentsController < ApplicationController redirect_to new_org_document_comment_path(:organization_id => @organization.id) end end + def show @document = OrgDocumentComment.find(params[:id]) end @@ -39,10 +40,12 @@ class OrgDocumentCommentsController < ApplicationController render_403 end end + def update @org_document = OrgDocumentComment.find(params[:id]) @org_document.update_attributes(:title => params[:org_document_comment][:title], :content => params[:org_document_comment][:content]) - @org_document.save_attachments(params[:attachments]) + Attachment.attach_files(@org_document, params[:attachments]) + # @org_document.save_attachments(params[:attachments]) if @org_document.parent.nil? act = OrgActivity.where("org_act_type='OrgDocumentComment' and org_act_id =?", @org_document.id).first act.update_attributes(:updated_at => @org_document.updated_at) diff --git a/app/views/attachments/_form_course.html.erb b/app/views/attachments/_form_course.html.erb index ef5385647..348c5339d 100644 --- a/app/views/attachments/_form_course.html.erb +++ b/app/views/attachments/_form_course.html.erb @@ -61,8 +61,7 @@ :are_you_sure => l(:text_are_you_sure), :file_count => l(:label_file_count), :delete_all_files => l(:text_are_you_sure_all), - :lebel_file_uploding => l(:lebel_file_uploding), - :containerid => "#{container.id}" + :lebel_file_uploding => l(:lebel_file_uploding) } %> <% if container.nil? %> <%= l(:label_no_file_uploaded)%> diff --git a/app/views/org_document_comments/_attachment.html.erb b/app/views/org_document_comments/_attachment.html.erb index 86298a330..5cdcfa041 100644 --- a/app/views/org_document_comments/_attachment.html.erb +++ b/app/views/org_document_comments/_attachment.html.erb @@ -63,7 +63,7 @@ :are_you_sure => l(:text_are_you_sure), :file_count => l(:label_file_count), :lebel_file_uploding => l(:lebel_file_uploding), - :delete_all_files => l(:text_are_you_sure_all) + :containerid => "#{container.id}" } %> <%= l(:label_no_file_uploaded) %> diff --git a/app/views/org_document_comments/_new.html.erb b/app/views/org_document_comments/_new.html.erb index 8d9eb6b02..3d8e8bc23 100644 --- a/app/views/org_document_comments/_new.html.erb +++ b/app/views/org_document_comments/_new.html.erb @@ -45,10 +45,14 @@
-

- +
+
+ <%= render :partial => 'org_document_comments/attachment', :locals => {:container => nil} %> +
+
+
确定 diff --git a/app/views/organizations/_project_message.html.erb b/app/views/organizations/_project_message.html.erb index 2708bb546..037dfe61b 100644 --- a/app/views/organizations/_project_message.html.erb +++ b/app/views/organizations/_project_message.html.erb @@ -16,10 +16,10 @@
<% if activity.parent_id.nil? %> - <%= link_to activity.subject.to_s.html_safe, project_boards_path(activity.project,:parent_id =>activity.id, :topic_id => activity.id), :class=> "postGrey" + <%= link_to activity.subject.to_s.html_safe, board_message_path(activity.board,activity), :class=> "postGrey" %> <% else %> - <%= link_to activity.parent.subject.to_s.html_safe, project_boards_path(activity.project,:parent_id =>activity.parent_id, :topic_id => activity.id), :class=> "postGrey" + <%= link_to activity.parent.subject.to_s.html_safe, board_message_path(activity.board,activity), :class=> "postGrey" %> <% end %>