From 59f42bb54fcd95608091ea90275a7ecf97928191 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Thu, 24 Dec 2015 11:09:57 +0800 Subject: [PATCH 1/2] =?UTF-8?q?1.=E5=B0=86=E6=B7=BB=E5=8A=A0=E9=99=84?= =?UTF-8?q?=E5=8A=A0=E5=8A=9F=E8=83=BD=E5=8A=A0=E5=85=A5=E5=88=B0=E7=BB=84?= =?UTF-8?q?=E7=BB=87=E5=88=97=E8=A1=A8=E4=B8=AD=E7=9A=84=E6=96=B0=E5=BB=BA?= =?UTF-8?q?=E7=BB=84=E7=BB=87=E6=96=87=E7=AB=A0=EF=BC=9B=202.=E8=A7=A3?= =?UTF-8?q?=E5=86=B3=E7=BC=96=E8=BE=91=E6=96=87=E7=AB=A0=E9=99=84=E4=BB=B6?= =?UTF-8?q?=E4=B8=8D=E8=83=BD=E4=B8=8A=E4=BC=A0=E7=9A=84=E9=97=AE=E9=A2=98?= =?UTF-8?q?=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 %>
From 7d7d9b77b53ca1a172dd5473e52e1387b69a2e7e Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Thu, 24 Dec 2015 11:58:00 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E7=BC=96=E8=BE=91=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E5=B8=96=E5=AD=90=E6=A0=B7=E5=BC=8F=E6=94=B9=E6=88=90=E6=96=B9?= =?UTF-8?q?=E5=9D=97=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../boards/_project_message_edit.html.erb | 16 ++++++++++++++ app/views/messages/edit.html.erb | 21 +++++-------------- 2 files changed, 21 insertions(+), 16 deletions(-) create mode 100644 app/views/boards/_project_message_edit.html.erb diff --git a/app/views/boards/_project_message_edit.html.erb b/app/views/boards/_project_message_edit.html.erb new file mode 100644 index 000000000..88297bd79 --- /dev/null +++ b/app/views/boards/_project_message_edit.html.erb @@ -0,0 +1,16 @@ + +
+
+
+ 编辑帖子 +
+
+ <%= render :partial => 'boards/project_new_topic', + :locals => {:f => f, :edit_mode => edit_mode, :topic => topic, :project => project} %> +
\ No newline at end of file diff --git a/app/views/messages/edit.html.erb b/app/views/messages/edit.html.erb index 624174b14..7543e16e2 100644 --- a/app/views/messages/edit.html.erb +++ b/app/views/messages/edit.html.erb @@ -1,26 +1,16 @@ <% if @message.project %> -
-

<%= l(:label_course_board) %>

-
- - - <%#= board_breadcrumb(@message) %> - -
-
    <%= form_for @message, {:as => :message, :url => {:action => 'edit'}, :html => {:multipart => true, :id => 'message-form', :method => :post} } do |f| %> - <%= render :partial => 'form_project', - :locals => {:f => f, :replying => !@message.parent.nil?} %> - <%= l(:button_submit) %> - <%= link_to l(:button_cancel), board_message_url(@message.board, @message.root, :r => (@message.parent_id && @message.id)), :class => "blue_btn grey_btn fl c_white" %> -
-
+ <%= render :partial => 'boards/project_message_edit', + :locals => {:f => f, :edit_mode => true, :topic => @message, :project => @message.project} %> + + <%#= link_to l(:button_cancel), board_message_url(@message.board, @message.root, :r => (@message.parent_id && @message.id)), :class => "blue_btn grey_btn fl c_white" %> <% end %> + <% elsif @message.course %> <%= form_for @message, { :as => :message, @@ -31,7 +21,6 @@ } do |f| %> <%= render :partial => 'boards/course_message_edit', :locals => {:f => f, :edit_mode => true, :topic => @message, :course => @message.course} %> - <% end %> <% end %>