diff --git a/app/controllers/organizations_controller.rb b/app/controllers/organizations_controller.rb index fdd12030f..daf443d07 100644 --- a/app/controllers/organizations_controller.rb +++ b/app/controllers/organizations_controller.rb @@ -1,5 +1,33 @@ # encoding: utf-8 class OrganizationsController < ApplicationController + + + helper :sort + include SortHelper + helper :custom_fields + include CustomFieldsHelper + include AvatarHelper + include WordsHelper + include GitlabHelper + include UserScoreHelper + + include PollHelper + helper :user_score + helper :journals + + # added by liuping 关注 + + helper :watchers + helper :activities + + ### added by william + include ActsAsTaggableOn::TagsHelper + + # fq + helper :words + helper :project_score + helper :issues + include UsersHelper before_filter :find_organization, :only => [:show, :members] layout 'base_org' def index @@ -27,13 +55,22 @@ class OrganizationsController < ApplicationController def show if @organization.is_public? || User.current.admin? || User.current.member_of_org?(@organization) @organization = Organization.find(params[:id]) - @activities = OrgActivity.where('container_id =? and container_type =? ', - @organization.id, 'Organization ').order('updated_at desc') - - @activities = paginateHelper @activities, 10 + @org_activities = OrgActivity.where('container_id =? and container_type =? ', + @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) + @org_project_activties = ForgeActivity.where('project_id in (?)',project_ids.join(',')).page(params[:page]).per(10) + @org_project_activties_count = ForgeActivity.where('project_id in (?)',project_ids.join(',')).count + #@org_activities = paginateHelper @org_activities, 10 + @page = params[:page] else render_403 end + respond_to do |format| + format.html + format.js + end end def update diff --git a/app/helpers/organizations_helper.rb b/app/helpers/organizations_helper.rb index 55a7a5d42..607d2af5c 100644 --- a/app/helpers/organizations_helper.rb +++ b/app/helpers/organizations_helper.rb @@ -17,4 +17,6 @@ module OrganizationsHelper s + content_tag('ul', links,:class => 'wlist',:style=>'float:left !important', :id => "org_member_pagination_links" ) end + + end diff --git a/app/views/organizations/_org_project_activities.html.erb b/app/views/organizations/_org_project_activities.html.erb new file mode 100644 index 000000000..0a6a8fae4 --- /dev/null +++ b/app/views/organizations/_org_project_activities.html.erb @@ -0,0 +1,30 @@ +<% 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} %> + <% when 'ProjectCreateInfo'%> + <%= render :partial => 'users/project_create', :locals => {:activity => act.forge_act,:user_activity_id =>act.id} %> + <% end %> + <% end %><% end %> +<% end %> +<% end %> +<% if org_act_count == 10 || pro_act_count == 10 %> +
<%= string %>
+ <% end %> + <% end %> +<%= reply.notes %>
+