<%= link_to image_tag(url_to_avatar(User.find(document.creator_id)), :width => 45, :heigth => 45), user_path(document.creator_id) %>
diff --git a/app/views/organizations/show.html.erb b/app/views/organizations/show.html.erb
index e77cc7d09..55d296cd1 100644
--- a/app/views/organizations/show.html.erb
+++ b/app/views/organizations/show.html.erb
@@ -30,9 +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} %>
-
<% end %>
<% unless @activities.nil? %>
@@ -58,9 +57,7 @@
init_activity_KindEditor_data(<%= act.org_act.id%>, null, "87%");
});
-
<%= render :partial => 'show_org_document', :locals => {:document => act.org_act} %>
-
<% end %>
<% end %>
diff --git a/db/schema.rb b/db/schema.rb
index 1f48eaf02..73924d83c 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
-ActiveRecord::Schema.define(:version => 20151110011003) do
+ActiveRecord::Schema.define(:version => 20151112072948) do
create_table "activities", :force => true do |t|
t.integer "act_id", :null => false
@@ -960,6 +960,7 @@ ActiveRecord::Schema.define(:version => 20151110011003) do
t.datetime "created_on"
t.integer "comments_count", :default => 0, :null => false
t.integer "course_id"
+ t.integer "sticky", :default => 0
end
add_index "news", ["author_id"], :name => "index_news_on_author_id"
From e1a88dedbbe20cc0511cec88274da90763d71788 Mon Sep 17 00:00:00 2001
From: lizanle <491823689@qq.com>
Date: Sat, 14 Nov 2015 09:58:53 +0800
Subject: [PATCH 08/16] =?UTF-8?q?=20=E9=A6=96=E9=A1=B5=E5=9B=9E=E5=A4=8D?=
=?UTF-8?q?=20=E4=BC=9A=E5=8F=98=E6=88=90=E7=BB=84=E7=BB=87?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/organizations/_show_org_document.html.erb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/views/organizations/_show_org_document.html.erb b/app/views/organizations/_show_org_document.html.erb
index 700db0eeb..b9c8c19aa 100644
--- a/app/views/organizations/_show_org_document.html.erb
+++ b/app/views/organizations/_show_org_document.html.erb
@@ -7,7 +7,7 @@
<%= link_to User.find(document.creator_id), user_path(document.creator.id), :class => "newsBlue mr15" %>
TO <%= link_to document.organization.name, organization_path(document.organization), :class => "newsBlue" %> |
- <% if defined?(home_id) %>
+ <% if document.organization.home_id == document.id %>
首页
<% else %>
组织
From f313509d991a170db68c27c4350cbe63b9ae965c Mon Sep 17 00:00:00 2001
From: ouyangxuhua
Date: Sat, 14 Nov 2015 10:01:30 +0800
Subject: [PATCH 09/16] =?UTF-8?q?=E7=BB=84=E7=BB=87id=E7=9A=84=E4=BD=8D?=
=?UTF-8?q?=E7=BD=AE=E6=98=BE=E7=A4=BA=E7=BB=84=E7=BB=87=E5=90=8D=E7=A7=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/layouts/base_org.html.erb | 23 ++++++++++++++++-------
1 file changed, 16 insertions(+), 7 deletions(-)
diff --git a/app/views/layouts/base_org.html.erb b/app/views/layouts/base_org.html.erb
index 32ada4729..b1434bb0f 100644
--- a/app/views/layouts/base_org.html.erb
+++ b/app/views/layouts/base_org.html.erb
@@ -50,13 +50,9 @@
<% end %>
<% end%>
- 组织id:<%= @organization.id %>
- <% if User.current.admin_of_org?(@organization) %>
- 配置
- <% end %>
-
-
- <%= link_to l(:label_org_name)+"#{@organization.name}", organization_path(@organization.id), :class=>"pr_info_name fl c_dark fb break_word" %>
+
+
+ <%= link_to @organization.name, organization_path(@organization.id), :class=>"pr_info_name fl c_dark fb break_word" %>
<% if @organization.is_public? %>
<%= l(:label_public)%>
<% else %>
@@ -64,6 +60,19 @@
<% end %>
+ <% if User.current.admin_of_org?(@organization) %>
+
配置
+ <% end %>
+
+
+
+
+
+
+
+
+
+
<%= link_to '文章', organization_org_document_comments_path(@organization) %> (
From 9bf8f6058faeb2d43af2588d537d6bcf22d59f60 Mon Sep 17 00:00:00 2001
From: ouyangxuhua
Date: Sat, 14 Nov 2015 10:25:51 +0800
Subject: [PATCH 10/16] =?UTF-8?q?=E5=8A=A8=E6=80=81=E5=92=8C=E6=96=87?=
=?UTF-8?q?=E7=AB=A0=E6=A0=B7=E5=BC=8F=E9=97=AE=E9=A2=98=E8=A7=A3=E5=86=B3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../organizations/_show_org_document.html.erb | 141 +++++++++---------
1 file changed, 71 insertions(+), 70 deletions(-)
diff --git a/app/views/organizations/_show_org_document.html.erb b/app/views/organizations/_show_org_document.html.erb
index b9c8c19aa..4177c3688 100644
--- a/app/views/organizations/_show_org_document.html.erb
+++ b/app/views/organizations/_show_org_document.html.erb
@@ -1,75 +1,76 @@
-
-
- <%= link_to image_tag(url_to_avatar(User.find(document.creator_id)), :width => 45, :heigth => 45), user_path(document.creator_id) %>
-
-
-
- <%= link_to User.find(document.creator_id), user_path(document.creator.id), :class => "newsBlue mr15" %>
- TO <%= link_to document.organization.name, organization_path(document.organization), :class => "newsBlue" %> |
- <% if document.organization.home_id == document.id %>
-
首页
- <% else %>
-
组织
- <% end %>
+
+
+ <%= link_to image_tag(url_to_avatar(User.find(document.creator_id)), :width => 45, :heigth => 45), user_path(document.creator_id) %>
-
<%= document.title %>
-
- 发布时间:<%= format_activity_day(document.created_at) %> <%= format_time(document.created_at, false) %>
- <% unless document.content.blank? %>
-
- <%= document.content.html_safe %>
-
- <% end %>
-
- <% if User.current.admin? || User.current.admin_of_org?(Organization.find(document.organization_id) || User.current.id == document.creator_id) %>
-
-
-
-
-
- <%= form_for('new_form',:url => {:controller => 'organizations',:action => 'set_homepage',:id => document.organization_id, :home_id => document.id},:method => "put",:remote => true) do |f|%>
- 设为首页
- <% end %>
-
-
- <%= link_to "编辑文章", edit_org_document_comment_path(:id => document.id, :organization_id => document.organization_id), :class => "postOptionLink" %>
-
-
- <%= link_to "删除文章", org_document_comment_path(:id => document.id, :organization_id => document.organization_id), :method => 'delete',
- :data => {:confirm => l(:text_are_you_sure)},
- :remote => true, :class => 'postOptionLink' %>
-
-
-
-
-
-
-
-
- <% end %>
-<% comments_for_doc = document.children.reorder("created_at desc") %>
-<% count = document.children.count() %>
-
-
-
-
回复(<%= count %>)
- <% if count > 3 %>
-
- <% end %>
+ <% if User.current.admin? || User.current.admin_of_org?(Organization.find(document.organization_id) || User.current.id == document.creator_id) %>
+
+
+
+
+
+ <%= form_for('new_form', :url => {:controller => 'organizations', :action => 'set_homepage', :id => document.organization_id, :home_id => document.id}, :method => "put", :remote => true) do |f| %>
+ 设为首页
+ <% end %>
+
+
+ <%= link_to "编辑文章", edit_org_document_comment_path(:id => document.id, :organization_id => document.organization_id), :class => "postOptionLink" %>
+
+
+ <%= link_to "删除文章", org_document_comment_path(:id => document.id, :organization_id => document.organization_id), :method => 'delete',
+ :data => {:confirm => l(:text_are_you_sure)},
+ :remote => true, :class => 'postOptionLink' %>
+
+
+
+
+
+
+ <% end %>
+
-
+ <% comments_for_doc = document.children.reorder("created_at desc") %>
+ <% count = document.children.count() %>
+
+
+
+
回复(<%= count %>)
+ <% if count > 3 %>
+
+ <% end %>
+
+
<% reply_id = 0 %>
<% comments_for_doc.each do |comment| %>
<% reply_id += 1 %>
-
+
<%= link_to image_tag(url_to_avatar(User.find(comment.creator_id)), :width => 33, :height => 33, :alt => "用户头像"), user_path(comment.creator_id) %>
@@ -87,12 +88,12 @@
- <%=link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33", :alt => "用户头像"), user_path(User.current) %>
+ <%= 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| %>
-
+
@@ -110,15 +111,15 @@
+
diff --git a/app/views/organizations/_org_project_issue.html.erb b/app/views/organizations/_org_project_issue.html.erb
new file mode 100644
index 000000000..ed80ba7b1
--- /dev/null
+++ b/app/views/organizations/_org_project_issue.html.erb
@@ -0,0 +1,136 @@
+
+
+
+ <%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id), :alt => "用户头像" %>
+
+
+
+ <% if activity.try(:author).try(:realname) == ' ' %>
+ <%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %>
+ <% else %>
+ <%= link_to activity.try(:author).try(:realname), user_path(activity.author_id), :class => "newsBlue mr15" %>
+ <% end %> TO
+ <%= link_to activity.project.name.to_s+" | 项目问题", project_issues_path(activity.project), :class => "newsBlue ml15"%>
+
+
+ <%= link_to activity.subject.to_s, issue_path(activity), :class => "postGrey" %>
+
+ <%#= get_issue_priority(activity.priority_id)[1] %>
+
+
+
+
指派给
+ <% unless activity.assigned_to_id.nil? %>
+ <% if activity.try(:assigned_to).try(:realname) == ' ' %>
+ <%= link_to activity.try(:assigned_to), user_path(activity.assigned_to_id), :class => "newsBlue mr15" %>
+ <% else %>
+ <%= link_to activity.try(:assigned_to).try(:realname), user_path(activity.assigned_to_id), :class => "newsBlue mr15" %>
+ <% end %>
+ <% end %>
+
+
+ 时间:
+ <%=format_time(activity.created_on) %>
+
+
+
+
+ <% if activity.description? %>
+ <%= textAreailizable activity, :description, :attachments => activity.attachments %>
+ <% end %>
+
+
+
+
+
+
+
+ <% if activity.attachments.any? %>
+ <% activity.attachments.each do |attachment| %>
+
+
+
+ <%= link_to_short_attachment attachment,:length=> 58, :class => 'link_file_a fl newsBlue', :download => true -%>
+
+ <% if attachment.is_text? %>
+ <%= link_to image_tag('magnifier.png'),
+ :controller => 'attachments',
+ :action => 'show',
+ :id => attachment,
+ :class => 'fl',
+ :filename => attachment.filename %>
+ <% end %>
+
+ (
+ <%= number_to_human_size attachment.filesize %>)
+
+
+ <%= link_to h(truncate(attachment.author.name, length: 10, omission: '...')),user_path(attachment.author),:class => "c_orange" %>,
+ <%= format_time(attachment.created_on) %>
+
+
+ <% end %>
+ <% end %>
+
+
+
+
+ <% count = activity.journals.count %>
+
+
+
+
回复(<%= count %>)
+
<%#= format_date(activity.updated_on) %>
+ <% if count > 3 %>
+
+ <% end %>
+
+
+ <% replies_all_i = 0 %>
+ <% if count > 0 %>
+
+
+ <% activity.journals.reorder("created_on desc").each do |reply| %>
+
+ <% replies_all_i=replies_all_i + 1 %>
+
+
+ <%= link_to image_tag(url_to_avatar(reply.user), :width => "33", :height => "33"), user_path(reply.user_id), :alt => "用户头像" %>
+
+
+
+ <% if reply.try(:user).try(:realname) == ' ' %>
+ <%= link_to reply.try(:user), user_path(reply.user_id), :class => "newsBlue mr10 f14" %>
+ <% else %>
+ <%= link_to reply.try(:user).try(:realname), user_path(reply.user_id), :class => "newsBlue mr10 f14" %>
+ <% end %>
+ <%= format_time(reply.created_on) %>
+
+
+ <% if reply.details.any? %>
+ <% details_to_strings(reply.details).each do |string| %>
+
<%= string %>
+ <% end %>
+ <% end %>
+
<%= reply.notes %>
+
+
+
+
+ <% end %>
+
+
+ <% end %>
+
+
+
+
+
diff --git a/app/views/organizations/show.html.erb b/app/views/organizations/show.html.erb
index deaec4437..0b624d479 100644
--- a/app/views/organizations/show.html.erb
+++ b/app/views/organizations/show.html.erb
@@ -34,8 +34,8 @@
<%= render :partial => 'show_org_document', :locals => {:document => OrgDocumentComment.find(@organization.home_id), :home_id => @organization.home_id} %>
<% end %>
- <% unless @activities.nil? %>
- <% @activities.each do |act| %>
+ <% unless @org_activities.nil? %>
+ <% @org_activities.each do |act| %>
<% if act.org_act_type == 'CreateOrganization' %>
@@ -60,10 +60,20 @@
<%= render :partial => 'show_org_document', :locals => {:document => act.org_act} %>
<% end %>
<% end %>
-
- <%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
-
+
+ <%#= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
+
<% end %>
+ <%# @org_project_activties.each do |org_act|%>
+ <%= render :partial => 'organizations/org_project_activities',
+ :locals => {:org_project_activties =>@org_project_activties,
+ :page=>@page,
+ :org => @organization,
+ :org_act_count=>@org_activities.count,
+ :pro_act_count=>@org_project_activties.count}%>
+ <%# end %>
+
+
diff --git a/app/views/organizations/show.js.erb b/app/views/organizations/show.js.erb
new file mode 100644
index 000000000..b0a447910
--- /dev/null
+++ b/app/views/organizations/show.js.erb
@@ -0,0 +1,7 @@
+$("#show_more_activities").replaceWith("<%= escape_javascript( render :partial => 'organizations/org_project_activities',
+ :locals => {:org_project_activties =>@org_project_activties,
+ :page=>@page,
+ :org => @organization,
+ :org_act_count=>@org_activities.count,
+ :pro_act_count=>@org_project_activties.count} )%>");
+
From 1e1c2109396bdcd00c092e7efc9da3b2d7bce42b Mon Sep 17 00:00:00 2001
From: ouyangxuhua
Date: Sat, 14 Nov 2015 14:57:49 +0800
Subject: [PATCH 14/16] =?UTF-8?q?=E7=BB=84=E7=BB=87=E5=8A=A8=E6=80=81?=
=?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=A1=B9=E7=9B=AE=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 | 2 +-
.../_org_project_activities.html.erb | 8 +-
.../organizations/_org_project_issue.html.erb | 2 +-
.../organizations/_project_create.html.erb | 38 +++++++
.../organizations/_project_message.html.erb | 100 ++++++++++++++++++
5 files changed, 143 insertions(+), 7 deletions(-)
create mode 100644 app/views/organizations/_project_create.html.erb
create mode 100644 app/views/organizations/_project_message.html.erb
diff --git a/app/controllers/organizations_controller.rb b/app/controllers/organizations_controller.rb
index daf443d07..cad617e47 100644
--- a/app/controllers/organizations_controller.rb
+++ b/app/controllers/organizations_controller.rb
@@ -60,7 +60,7 @@ class OrganizationsController < ApplicationController
@org_activities_count = OrgActivity.where('container_id =? and container_type =? ',
@organization.id, 'Organization ').order('updated_at desc').count
project_ids = @organization.projects.map(&:id)
- @org_project_activties = ForgeActivity.where('project_id in (?)',project_ids.join(',')).page(params[:page]).per(10)
+ @org_project_activties = ForgeActivity.where('project_id in (?) and forge_act_type in("Issue","Message","ProjectCreateInfo")',project_ids.join(',')).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
@page = params[:page]
diff --git a/app/views/organizations/_org_project_activities.html.erb b/app/views/organizations/_org_project_activities.html.erb
index 0a6a8fae4..b46996661 100644
--- a/app/views/organizations/_org_project_activities.html.erb
+++ b/app/views/organizations/_org_project_activities.html.erb
@@ -1,17 +1,15 @@
<% org_project_activties.each do |act|%>
<% if act %>
-
- <% unless act.forge_act_type == "ProjectCreateInfo" %>
<% if act %>
<% case act.forge_act_type.to_s %>
<% when 'Issue' %>
<%= render :partial => 'organizations/org_project_issue', :locals => {:activity => act.forge_act,:user_activity_id =>act.id} %>
<% when 'Message' %>
- <%= render :partial => 'users/project_message', :locals => {:activity => act.forge_act,:user_activity_id =>act.id} %>
+ <%= render :partial => 'organizations/project_message', :locals => {:activity => act.forge_act,:user_activity_id =>act.id} %>
<% when 'ProjectCreateInfo'%>
- <%= render :partial => 'users/project_create', :locals => {:activity => act.forge_act,:user_activity_id =>act.id} %>
+ <%= render :partial => 'organizations/project_create', :locals => {:activity => act,:user_activity_id =>act.id} %>
<% end %>
- <% end %><% end %>
+ <% end %>
<% end %>
<% end %>
<% if org_act_count == 10 || pro_act_count == 10 %>
diff --git a/app/views/organizations/_org_project_issue.html.erb b/app/views/organizations/_org_project_issue.html.erb
index ed80ba7b1..573429752 100644
--- a/app/views/organizations/_org_project_issue.html.erb
+++ b/app/views/organizations/_org_project_issue.html.erb
@@ -120,7 +120,7 @@
<%= string %>
<% end %>
<% end %>
- <%= reply.notes %>
+ <%= reply.notes.nil? ? "" : reply.notes.html_safe %>
diff --git a/app/views/organizations/_project_create.html.erb b/app/views/organizations/_project_create.html.erb
new file mode 100644
index 000000000..d966d8e18
--- /dev/null
+++ b/app/views/organizations/_project_create.html.erb
@@ -0,0 +1,38 @@
+<% project = Project.find(activity.project_id) %>
+<% user = User.find(project.user_id)%>
+
+
+
+ <%= link_to image_tag(url_to_avatar(user), :width => "50", :height => "50"), user_path(user), :alt => "用户头像" %>
+
+
+
+ <% if user.try(:realname) == ' ' %>
+ <%= link_to user, user_path(user), :class => "newsBlue mr15" %>
+ <% else %>
+ <%= link_to user.try(:realname), user_path(user), :class => "newsBlue mr15" %>
+ <% end %>
+ TO
+ <%= link_to project.to_s+" | 项目", project_path(project.id,:host=>Setting.host_course), :class => "newsBlue ml15" %>
+
+
+ <%= link_to project.name, project_path(project.id,:host=>Setting.host_course), :class => "postGrey" %>
+
+
+ 创建时间:<%= format_time(project.created_on) %>
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/views/organizations/_project_message.html.erb b/app/views/organizations/_project_message.html.erb
new file mode 100644
index 000000000..85ed08f2f
--- /dev/null
+++ b/app/views/organizations/_project_message.html.erb
@@ -0,0 +1,100 @@
+
+
+
+ <%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id), :alt => "用户头像" %>
+
+
+
+ <% if activity.try(:author).try(:realname) == ' ' %>
+ <%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %>
+ <% else %>
+ <%= link_to activity.try(:author).try(:realname), user_path(activity.author_id), :class => "newsBlue mr15" %>
+ <% end %>
+ TO
+ <%= link_to activity.project.name.to_s+" | 项目讨论区",project_boards_path(activity.project), :class => "newsBlue ml15 mr5"%>
+
+
+
+ <% 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"
+ %>
+ <% 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"
+ %>
+ <% end %>
+
+
+ 时间:<%= format_time(activity.created_on) %>
+
+
+
+ <% if activity.parent_id.nil? %>
+ <%= activity.content.to_s.html_safe%>
+ <% else %>
+ <%= activity.parent.content.to_s.html_safe%>
+ <% end %>
+
+
+
+
+
+
+
+
+
+ <% count = 0 %>
+ <% if activity.parent %>
+ <% count=activity.parent.children.count%>
+ <% else %>
+ <% count=activity.children.count%>
+ <% end %>
+
+
+
+
回复(
+ <%=count %>
+ )
+
<%#=format_date(activity.updated_on)%>
+ <%if count>3 %>
+
+ <% end %>
+
+
+ <% activity= activity.parent_id.nil? ? activity : activity.parent %>
+ <% replies_all_i = 0 %>
+ <% if count > 0 %>
+
+
+ <% activity.children.reorder("created_on desc").each do |reply| %>
+
+ <% replies_all_i=replies_all_i+1 %>
+
+
+ <%= link_to image_tag(url_to_avatar(reply.author), :width => "33", :height => "33"), user_path(reply.author_id), :alt => "用户头像" %>
+
+
+
+ <% if reply.try(:author).try(:realname) == ' ' %>
+ <%= link_to reply.try(:author), user_path(reply.author_id), :class => "newsBlue mr10 f14" %>
+ <% else %>
+ <%= link_to reply.try(:author).try(:realname), user_path(reply.author_id), :class => "newsBlue mr10 f14" %>
+ <% end %>
+ <%= format_time(reply.created_on) %>
+
+
+ <%= reply.content.html_safe %>
+
+
+
+ <% end %>
+
+
+ <% end %>
+
+
+
+
\ No newline at end of file
From c9a7a9476708916f5836309640f4ea82b3c6e863 Mon Sep 17 00:00:00 2001
From: ouyangxuhua
Date: Sat, 14 Nov 2015 15:15:54 +0800
Subject: [PATCH 15/16] =?UTF-8?q?=E7=BB=84=E7=BB=87=E5=8A=A8=E6=80=81?=
=?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=A1=B9=E7=9B=AE=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 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/controllers/organizations_controller.rb b/app/controllers/organizations_controller.rb
index cad617e47..774cde02d 100644
--- a/app/controllers/organizations_controller.rb
+++ b/app/controllers/organizations_controller.rb
@@ -60,7 +60,7 @@ class OrganizationsController < ApplicationController
@org_activities_count = OrgActivity.where('container_id =? and container_type =? ',
@organization.id, 'Organization ').order('updated_at desc').count
project_ids = @organization.projects.map(&:id)
- @org_project_activties = ForgeActivity.where('project_id in (?) and forge_act_type in("Issue","Message","ProjectCreateInfo")',project_ids.join(',')).order("updated_at desc").page(params[:page] || 1).per(10)
+ @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
@page = params[:page]
From f5460d11264d67a19809f229928f1dd02207efae Mon Sep 17 00:00:00 2001
From: ouyangxuhua
Date: Sat, 14 Nov 2015 15:19:49 +0800
Subject: [PATCH 16/16] =?UTF-8?q?=E7=BB=84=E7=BB=87=E5=8A=A8=E6=80=81?=
=?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=A1=B9=E7=9B=AE=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 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/controllers/organizations_controller.rb b/app/controllers/organizations_controller.rb
index 774cde02d..b75742164 100644
--- a/app/controllers/organizations_controller.rb
+++ b/app/controllers/organizations_controller.rb
@@ -59,7 +59,7 @@ class OrganizationsController < ApplicationController
@organization.id, 'Organization ').order('updated_at desc').page(params[:page]).per(10)
@org_activities_count = OrgActivity.where('container_id =? and container_type =? ',
@organization.id, 'Organization ').order('updated_at desc').count
- project_ids = @organization.projects.map(&:id)
+ project_ids = @organization.projects.map(&:id) << 0
@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