From b6d785bda00eab0e786a26278de19c8cc4fee739 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Fri, 13 Nov 2015 19:10:44 +0800 Subject: [PATCH 01/39] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E7=BB=84=E7=BB=87=E6=96=87=E7=AB=A0=E6=A0=B7=E5=BC=8F=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/org_document_comments/edit.html.erb | 14 +++++++++----- app/views/organizations/new.html.erb | 2 +- public/images/org_default.jpg | Bin 1897 -> 0 bytes public/images/org_default.png | Bin 0 -> 4471 bytes 4 files changed, 10 insertions(+), 6 deletions(-) delete mode 100644 public/images/org_default.jpg create mode 100644 public/images/org_default.png diff --git a/app/views/org_document_comments/edit.html.erb b/app/views/org_document_comments/edit.html.erb index ffb04a4f9..498ac46a6 100644 --- a/app/views/org_document_comments/edit.html.erb +++ b/app/views/org_document_comments/edit.html.erb @@ -12,18 +12,21 @@ } } -
+
编辑文章
+
+
<%= form_tag url_for(:controller => 'org_document_comments',:action => 'update', :id => @org_document.id),:method => 'put', :id => 'new_org_document_form' do |f| %>
- +
-
+
+
- <%= kindeditor_tag 'org_document_comment[content]',@org_document.content, :editor_id => 'org_document_description_editor', :height => "150px" %> + <%= kindeditor_tag 'org_document_comment[content]',@org_document.content, :editor_id => 'org1_document_description_editor', :height => "150px" %>
@@ -40,4 +43,5 @@
-<% end %> \ No newline at end of file +<% end %> +
\ No newline at end of file diff --git a/app/views/organizations/new.html.erb b/app/views/organizations/new.html.erb index 08311d51b..1ab3ad933 100644 --- a/app/views/organizations/new.html.erb +++ b/app/views/organizations/new.html.erb @@ -31,7 +31,7 @@
  • - (打钩为公开,不打钩则不公开,若不公开,仅项目成员可见该项目。) + (打钩为公开,不打钩则不公开,若不公开,仅组织成员可见该组织。)
  • diff --git a/public/images/org_default.jpg b/public/images/org_default.jpg deleted file mode 100644 index ad1b4f007d0c6141a10715ce46f447630e3ce376..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1897 zcmbVMdr%W+5WmYoMM0Bb02^w&UPJ^Xm&=PJ8X+Wsq6GvLL9G~)10p6DFNY-9VzFw` zYN=8jTkErfD5%6LP{vk}D)_)^3yRP2i8ETo(V|wdq?ZUjW*q8M%0Kjz(B62CpszgzXO`tatS-8MJ zm{GgliedsG3QUZ$TlI!KoPx9P9Fs+b+&|EWz$T*#nITOOCRjCiuIZyf5>G8moMtG@ zGboHm)FgPKU1>L4%{Zlp?dJIwo6@dAJm5-t?N*}*>@lJ8REXNm3a2Mbg*60;!%~4b z!XU&jSSAx-5~)mvjfX`-OoR&QR~CUulv0^e6bbhWLbH*^Y-Nfzwx5gsQz89H6%-T* z3d90}%t0}QLgB^`i6Ur=2%Ez~>Fp5~8-D;ni`xvO$x4|B3+zVJXA$|73ZWx?k%HNp zknj@tt<^G{-FbPeZBz>WDvY;U+on0JIGTdnhGpR#=lNgU8M=S&T%1EzEs9FS6C*q-h~;j3o&(?5VHP^cH@NRES9> zLa|QxB5%1gMjIm$V;ZqGRv{EikbYm||EU>D2ZOqs>r9%I)9zz+gxVu%ey0ln!Z zpO=)dGiz&hfep<$&O7nXmnQFvZC+RLTk)0CrALpCd%%n!degg(6frLE?P)^~f7-lp z_JXTLWFt{iUz5vSzy{eYw)+$AP|n+z(vt7JCO-9!pZ$1sO=6u6+^Ei)P^NmAxT1nU z28F;m9qS+Lsi~OZKP+evZ)tRGzpsD9>Xo%svJ2K9>l-FDs~4BIZ~gB5r^+Wo#GMyK zBWGq79y(C_MY;4sP>a{n^U8@W2kT^3kAk$HrLBpj-8q&$hNK zKAAMPXj?*DdHb);;{vkpjxf~J&7ECRGWf{WlZnIchuiz)wQn9e+i|}k z&Z8#oLcfssGt%O^RN&ljyIgs1+ry3E-Y&=8!wwp+8Z;}=IIFXOM}J&)Q- zuNJ1QYnTED2B+Qx9**Xa86B+Z&2u)Yw*PSb)K^f~ja5Bet8)G>W`5n(x4d!UL+MV% OokfMWGD?bF=l=tIZIm|v diff --git a/public/images/org_default.png b/public/images/org_default.png new file mode 100644 index 0000000000000000000000000000000000000000..3f3cfc575550c44e2261bc7aa9affdd3f5bb6506 GIT binary patch literal 4471 zcmaJ_c|25Y`zIwkB_&j2645Yb%wjNvktkyuV~=45W0_%QWGP!n)Fe~Lo-JFElqEu0 zvP&T(WlKc1Bx}F%JoWtEKc4qJpL5Q=oa=k-*M07DqD`>+f_xHu92^{i24^v5>=wIo z@$6#XIa?|W+09{wo)yEK>ca3N&`2EGM5+@BVBke?C7F>3!~maGk_HC{mkSwZ#jr9u zujWkkQX=foDEWJNv(X$J8e0C|1ZNKt1K>n*B~#GA`RY0#fJ{UKE#XGWM&7z4H}cs) z8p%8mi*pY2a7GbFA(FA{?Q@b~hh(AE6Wz`yvavHLsIU?AWx5{3sF__tD4 zMkWAVDvbnyE2$_tD?=av1VRY{gCh_S5CEzSfr6FUCqfYdQ-dSaph&>)1IU&}Bf6-W zVb1)P#U7!7ZVZOE8W`;7=cnYSqC};+f*~jrYKI3Ds>r5Lqz6zK1b;;e{rDda7!uu? zM)qcqsT9BtM}ia8mw^VdHT~NJFK;8Ge;8Bfza7PP8Q7oT4TdNwgT1_V?D~tE&M+hW zzZ(BaO~(azlfY&qI@Oov%#Mf4@jqa;@BX)-9YVG?YQ{7&J17KC4At4!i$q}er=qR%hsVER;RvX*G903!iaNuN zgdQA)($iK&s-RR55TvrMs`ekO0fo*WP@GAB8jec!{F4DD zZd3-9?nd8AV#K_rt~%XBTDTr$~M>x-Oc>{ln(5RZAd#{4qYwi=$cynR2 z!7+H8iL{g6oU8cQ+i@47%S@>+K854hHWyP?=H+$t77`YAUg|#Fk(!i8T>R3LJy_=Y zPE5fO@IoY4kZd|WjA@7yUQR{P%^c37fB*4g`}#j;B*F?{)D>TTg2P*$@Eq?yMW;8Xy)`r@1rD8h*qF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8=E6=80=81=E4=B8=AD=E7=9A=84=E9=A1=B9=E7=9B=AE=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E7=9A=84=E5=9B=9E=E5=A4=8D=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/issues_controller.rb | 21 +++++++++++++++++-- .../org_document_comments_controller.rb | 1 + app/views/issues/add_journal_in_org.js.erb | 3 +++ .../org_document_comments/add_reply.js.erb | 4 ++-- .../organizations/_org_activities.html.erb | 12 +++++------ .../organizations/_org_project_issue.html.erb | 18 +++++++++++++++- .../organizations/_show_org_document.html.erb | 14 ++++++------- app/views/organizations/show.html.erb | 3 ++- config/routes.rb | 1 + 9 files changed, 58 insertions(+), 19 deletions(-) create mode 100644 app/views/issues/add_journal_in_org.js.erb diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index e529dd3b9..edf055370 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -20,11 +20,11 @@ class IssuesController < ApplicationController default_search_scope :issues before_filter :authorize1, :only => [:show] - before_filter :find_issue, :only => [:show, :edit, :update,:add_journal] + before_filter :find_issue, :only => [:show, :edit, :update,:add_journal, :add_journal_in_org] before_filter :find_issues, :only => [:bulk_edit, :bulk_update, :destroy] before_filter :find_project, :only => [:new, :create, :update_form] #before_filter :authorize, :except => [:index, :show] - before_filter :authorize, :except => [:index,:add_journal] + before_filter :authorize, :except => [:index,:add_journal, :add_journal_in_org] before_filter :find_optional_project, :only => [:index] before_filter :check_for_default_issue_status, :only => [:new, :create] @@ -397,6 +397,23 @@ class IssuesController < ApplicationController end end + def add_journal_in_org + if User.current.logged? + jour = Journal.new + jour.user_id = User.current.id + jour.notes = params[:notes] + jour.journalized = @issue + jour.save + org_activity = OrgActivity.where("org_act_type='Issue' and org_act_id =#{@issue.id}").first + org_activity.updated_at = jour.created_on + org_activity.save + @user_activity_id = params[:user_activity_id] + respond_to do |format| + format.js + end + end + end + private def find_project diff --git a/app/controllers/org_document_comments_controller.rb b/app/controllers/org_document_comments_controller.rb index 60522dc3f..13a188e72 100644 --- a/app/controllers/org_document_comments_controller.rb +++ b/app/controllers/org_document_comments_controller.rb @@ -41,6 +41,7 @@ class OrgDocumentCommentsController < ApplicationController def add_reply @document = OrgDocumentComment.find(params[:id]).root + @act = OrgActivity.find(params[:id]) @comment = OrgDocumentComment.new(:organization_id => @document.organization_id, :creator_id => User.current.id, :reply_id => params[:id]) @comment.content = params[:org_content] @document.children << @comment diff --git a/app/views/issues/add_journal_in_org.js.erb b/app/views/issues/add_journal_in_org.js.erb new file mode 100644 index 000000000..ad7a85540 --- /dev/null +++ b/app/views/issues/add_journal_in_org.js.erb @@ -0,0 +1,3 @@ +$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'organizations/org_project_issue', :locals => {:activity => @issue,:user_activity_id =>@user_activity_id}) %>"); + +init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%"); \ No newline at end of file diff --git a/app/views/org_document_comments/add_reply.js.erb b/app/views/org_document_comments/add_reply.js.erb index 5d54af2bf..40ed2eeb2 100644 --- a/app/views/org_document_comments/add_reply.js.erb +++ b/app/views/org_document_comments/add_reply.js.erb @@ -1,3 +1,3 @@ -$("#organization_document_<%= @document.id %>").replaceWith("<%= escape_javascript(render :partial => 'organizations/show_org_document', :locals => {:document => @document}) %>"); -init_activity_KindEditor_data(<%= @document.id %>,"","87%"); \ No newline at end of file +$("#organization_document_<%= @act.id %>").replaceWith("<%= escape_javascript(render :partial => 'organizations/show_org_document', :locals => {:document => @document, :act => @act}) %>"); +init_activity_KindEditor_data(<%= @act.id %>,"","87%"); \ No newline at end of file diff --git a/app/views/organizations/_org_activities.html.erb b/app/views/organizations/_org_activities.html.erb index cb69738b6..148bb9efe 100644 --- a/app/views/organizations/_org_activities.html.erb +++ b/app/views/organizations/_org_activities.html.erb @@ -1,5 +1,10 @@ <% unless org_activities.nil? %> <% org_activities.each do |act| %> + <% if act.container_type == 'Organization' %> <% if act.org_act_type == 'CreateOrganization' %>
    @@ -17,12 +22,7 @@
    <% end %> <% if act.org_act_type == 'OrgDocumentComment' && act.org_act_id != @organization.home_id %> - - <%= render :partial => 'show_org_document', :locals => {:document => act.org_act} %> + <%= render :partial => 'show_org_document', :locals => {:document => act.org_act, :act => act} %> <% end %> <% end %> <% if act.container_type == 'Project' %> diff --git a/app/views/organizations/_org_project_issue.html.erb b/app/views/organizations/_org_project_issue.html.erb index 573429752..e29994967 100644 --- a/app/views/organizations/_org_project_issue.html.erb +++ b/app/views/organizations/_org_project_issue.html.erb @@ -130,7 +130,23 @@
  • <% end %> - +
    +
    <%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(activity.author_id), :alt => "用户头像" %>
    +
    +
    + <%= form_for('new_form',:url => add_journal_in_org_issue_path(activity.id),:method => "post", :remote => true) do |f|%> + + +
    + +
    +

    + <% end%> +
    +
    +
    +
    +
    diff --git a/app/views/organizations/_show_org_document.html.erb b/app/views/organizations/_show_org_document.html.erb index 4177c3688..e352288ab 100644 --- a/app/views/organizations/_show_org_document.html.erb +++ b/app/views/organizations/_show_org_document.html.erb @@ -91,16 +91,16 @@ <%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33", :alt => "用户头像"), user_path(User.current) %>
    -
    - <%= form_for('new_form', :url => add_reply_org_document_comment_path(:id => document.id), :method => "post", :remote => true) do |f| %> - - +
    + <%= form_for('new_form', :url => add_reply_org_document_comment_path(:id => document.id, :act_id => act.id), :method => "post", :remote => true) do |f| %> + + -
    - +
    +
    -

    +

    <% end %>
    diff --git a/app/views/organizations/show.html.erb b/app/views/organizations/show.html.erb index a85ffa687..1ccb2f0e5 100644 --- a/app/views/organizations/show.html.erb +++ b/app/views/organizations/show.html.erb @@ -30,7 +30,8 @@ init_activity_KindEditor_data(<%= @organization.home_id%>, null, "87%"); }); - <%= render :partial => 'show_org_document', :locals => {:document => OrgDocumentComment.find(@organization.home_id), :home_id => @organization.home_id} %> + <% act = OrgActivity.where("org_act_type = 'OrgDocumentComment' and org_act_id =?", @organization.home_id).first %> + <%= render :partial => 'show_org_document', :locals => {:document => OrgDocumentComment.find(@organization.home_id), :home_id => @organization.home_id, :act => act} %> <% end %> <%= render :partial => 'organizations/org_activities', diff --git a/config/routes.rb b/config/routes.rb index 69134e666..24d159f04 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -634,6 +634,7 @@ RedmineApp::Application.routes.draw do end member do post 'add_journal' + post 'add_journal_in_org' end resources :time_entries, :controller => 'timelog' do collection do From fba461f94a62d405c1632eea14902508ec2082bc Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Tue, 17 Nov 2015 09:51:16 +0800 Subject: [PATCH 03/39] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=BB=84=E7=BB=87?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E4=B8=AD=E9=A1=B9=E7=9B=AE=E8=AE=A8=E8=AE=BA?= =?UTF-8?q?=E5=8C=BA=E7=9A=84=E5=9B=9E=E5=A4=8D=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/messages_controller.rb | 5 +++++ app/controllers/organizations_controller.rb | 6 +++--- .../organizations/_org_activities.html.erb | 4 ++-- .../organizations/_project_create.html.erb | 2 +- .../organizations/_project_message.html.erb | 18 ++++++++++++++++++ app/views/organizations/show.html.erb | 9 ++++++--- 6 files changed, 35 insertions(+), 9 deletions(-) diff --git a/app/controllers/messages_controller.rb b/app/controllers/messages_controller.rb index 4f78d61f5..9b090de9a 100644 --- a/app/controllers/messages_controller.rb +++ b/app/controllers/messages_controller.rb @@ -174,6 +174,11 @@ class MessagesController < ApplicationController user_activity.updated_at = Time.now user_activity.save end + org_activity = OrgActivity.where("org_act_type='Message' and org_act_id =#{@topic.id}").first + if org_activity + org_activity.updated_at = Time.now + org_activity.save + end #@topic.update_attribute(:updated_on, Time.now) if !@reply.new_record? if params[:asset_id] diff --git a/app/controllers/organizations_controller.rb b/app/controllers/organizations_controller.rb index 6a1030adc..392966d68 100644 --- a/app/controllers/organizations_controller.rb +++ b/app/controllers/organizations_controller.rb @@ -56,10 +56,10 @@ class OrganizationsController < ApplicationController if @organization.is_public? || User.current.admin? || User.current.member_of_org?(@organization) @organization = Organization.find(params[:id]) project_ids = @organization.projects.map(&:id) << 0 - @org_activities = OrgActivity.where("(container_id =? and container_type =?) or (container_type ='Project' and container_id in (#{project_ids.join(',')}))", + @org_activities = OrgActivity.where("(container_id =? and container_type =?) or (container_type ='Project' and org_act_type in ('Issue','Message','ProjectCreateInfo') and container_id in (#{project_ids.join(',')}))", @organization.id, 'Organization').order('updated_at desc').page(params[:page] || 1).per(10) - @org_activities_count = OrgActivity.where("(container_id =? and container_type =?) or (container_type ='Project' and container_id in (#{project_ids.join(',')}))" , - @organization.id, 'Organization ').count + # @org_activities_count = OrgActivity.where("(container_id =? and container_type =?) or (container_type ='Project' and container_id in (#{project_ids.join(',')}))" , + # @organization.id, 'Organization ').count # @org_project_activties = ForgeActivity.where("project_id in (#{project_ids.join(',')}) and forge_act_type in('Issue','Message','ProjectCreateInfo')").order("updated_at desc").page(params[:page] || 1).per(10) # @org_project_activties_count = ForgeActivity.where('project_id in (?)',project_ids.join(',')).count #@org_activities = paginateHelper @org_activities, 10 diff --git a/app/views/organizations/_org_activities.html.erb b/app/views/organizations/_org_activities.html.erb index 148bb9efe..9523a0a15 100644 --- a/app/views/organizations/_org_activities.html.erb +++ b/app/views/organizations/_org_activities.html.erb @@ -31,8 +31,8 @@ <%= render :partial => 'organizations/org_project_issue', :locals => {:activity => Issue.find(act.org_act_id),:user_activity_id =>act.id} %> <% when 'Message' %> <%= render :partial => 'organizations/project_message', :locals => {:activity => Message.find(act.org_act_id),:user_activity_id =>act.id} %> - <%# when 'ProjectCreateInfo'%> - <%#= render :partial => 'organizations/project_create', :locals => {:activity => act,:user_activity_id =>act.id} %> + <% when 'ProjectCreateInfo'%> + <%= render :partial => 'organizations/project_create', :locals => {:activity => act,:user_activity_id =>act.id} %> <% end %> <% end %> <% end %> diff --git a/app/views/organizations/_project_create.html.erb b/app/views/organizations/_project_create.html.erb index d966d8e18..607c14a45 100644 --- a/app/views/organizations/_project_create.html.erb +++ b/app/views/organizations/_project_create.html.erb @@ -1,4 +1,4 @@ -<% project = Project.find(activity.project_id) %> +<% project = Project.find(activity.org_act_id) %> <% user = User.find(project.user_id)%>
    diff --git a/app/views/organizations/_project_message.html.erb b/app/views/organizations/_project_message.html.erb index 85ed08f2f..2708bb546 100644 --- a/app/views/organizations/_project_message.html.erb +++ b/app/views/organizations/_project_message.html.erb @@ -95,6 +95,24 @@
    <% end %> +
    +
    <%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(activity.author_id), :alt => "用户头像" %>
    +
    +
    + <%= form_for('new_form',:url => {:controller=>'messages',:action => 'reply', :id => activity.id, :board_id => activity.board_id, :is_board => 'true'},:method => "post", :remote => true) do |f|%> + + + +
    + +
    +

    + <% end%> +
    +
    +
    +
    +
    \ No newline at end of file diff --git a/app/views/organizations/show.html.erb b/app/views/organizations/show.html.erb index 1ccb2f0e5..36cc24225 100644 --- a/app/views/organizations/show.html.erb +++ b/app/views/organizations/show.html.erb @@ -14,14 +14,17 @@
    最新动态
    - + +
    <% if !@organization.home_id.nil? and OrgDocumentComment.where("id = ?", @organization.home_id).count > 0 %> From 6f5cb8f1426a0935690266fcdfa0777a615abab4 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Tue, 17 Nov 2015 10:17:07 +0800 Subject: [PATCH 04/39] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=BB=84=E7=BB=87?= =?UTF-8?q?=E5=8A=A8=E6=80=81=E7=9A=84=E8=BF=87=E6=BB=A4=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=EF=BC=8C=E7=BB=84=E7=BB=87=E5=8A=A8=E6=80=81=E5=8C=85=E6=8B=AC?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=8A=A8=E6=80=81=E5=92=8C=E7=BB=84=E7=BB=87?= =?UTF-8?q?=E7=9A=84=E5=8A=A8=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/organizations_controller.rb | 18 +++++++++++------- app/views/organizations/show.html.erb | 20 ++++++++++++++++---- 2 files changed, 27 insertions(+), 11 deletions(-) diff --git a/app/controllers/organizations_controller.rb b/app/controllers/organizations_controller.rb index 392966d68..b35d7f3db 100644 --- a/app/controllers/organizations_controller.rb +++ b/app/controllers/organizations_controller.rb @@ -56,13 +56,17 @@ class OrganizationsController < ApplicationController if @organization.is_public? || User.current.admin? || User.current.member_of_org?(@organization) @organization = Organization.find(params[:id]) project_ids = @organization.projects.map(&:id) << 0 - @org_activities = OrgActivity.where("(container_id =? and container_type =?) or (container_type ='Project' and org_act_type in ('Issue','Message','ProjectCreateInfo') and container_id in (#{project_ids.join(',')}))", - @organization.id, 'Organization').order('updated_at desc').page(params[:page] || 1).per(10) - # @org_activities_count = OrgActivity.where("(container_id =? and container_type =?) or (container_type ='Project' and container_id in (#{project_ids.join(',')}))" , - # @organization.id, 'Organization ').count - # @org_project_activties = ForgeActivity.where("project_id in (#{project_ids.join(',')}) and forge_act_type in('Issue','Message','ProjectCreateInfo')").order("updated_at desc").page(params[:page] || 1).per(10) - # @org_project_activties_count = ForgeActivity.where('project_id in (?)',project_ids.join(',')).count - #@org_activities = paginateHelper @org_activities, 10 + case params[:type] + when nil + @org_activities = OrgActivity.where("(container_id =? and container_type =?) or (container_type ='Project' and org_act_type in ('Issue','Message','ProjectCreateInfo') and container_id in (#{project_ids.join(',')}))", + @organization.id, 'Organization').order('updated_at desc').page(params[:page] || 1).per(10) + when 'project_issue' + @org_activities = OrgActivity.where("container_type = 'Project' and org_act_type = 'Issue' and container_id in (#{project_ids.join(',')})").order('updated_at desc').page(params[:page] || 1).per(10) + when 'project_message' + @org_activities = OrgActivity.where("container_type = 'Project' and org_act_type = 'Message' and container_id in (#{project_ids.join(',')})").order('updated_at desc').page(params[:page] || 1).per(10) + when 'org' + @org_activities = OrgActivity.where("container_id =? and container_type =?",@organization.id, 'Organization').order('updated_at desc').page(params[:page] || 1).per(10) + end @page = params[:page] respond_to do |format| format.html diff --git a/app/views/organizations/show.html.erb b/app/views/organizations/show.html.erb index 36cc24225..e62a66913 100644 --- a/app/views/organizations/show.html.erb +++ b/app/views/organizations/show.html.erb @@ -16,10 +16,22 @@
    最新动态