diff --git a/app/helpers/courses_helper.rb b/app/helpers/courses_helper.rb index 3bdd074b8..fac4f5b68 100644 --- a/app/helpers/courses_helper.rb +++ b/app/helpers/courses_helper.rb @@ -17,12 +17,18 @@ module CoursesHelper # 根据角色查询 def searchCountByRoles project, roles_id - count = -1 + people = searchPeopleByRoles project, roles_id + people.count + end + + # 根据角色查人 + def searchPeopleByRoles project, roles_id + people = [] begin - count = project.members.joins(:member_roles).where("member_roles.role_id = :role_id", {:role_id => roles_id }).count + people = project.members.joins(:member_roles).where("member_roles.role_id = :role_id", {:role_id => roles_id }) rescue Exception => e logger.error "[CoursesHelper] ===> #{e}" end - count + people end end diff --git a/app/views/layouts/base_courses.html.erb b/app/views/layouts/base_courses.html.erb index 7c83ce275..711d47e96 100644 --- a/app/views/layouts/base_courses.html.erb +++ b/app/views/layouts/base_courses.html.erb @@ -2,6 +2,7 @@
+<%= l(:label_project_plural)%> | - -<%= link_to(l(:label_project_new), {:controller => 'projects', :action => 'new', :course => 0, :project_type => @project_type}, :class => 'icon icon-add') if User.current.allowed_to?(:add_project, nil, :global => true) %> | - -
-
- <%= text_field_tag 'name', params[:name], :size => 30 %>
- <%= hidden_field_tag 'project_type', params[:project_type] %>
- <%= submit_tag l(:label_search), :class => "small", :name => nil %>
- |
-
- <%= l(:label_my_projects) %> -
-<% end %> - -<% other_formats_links do |f| %> -<%= f.link_to 'Atom', :url => {:key => User.current.rss_key} %> -<% end %> - -<% content_for :sidebar do %> - -<%= form_tag({}, :method => :get) do %> -- <%= submit_tag l(:button_apply), :class => 'button-small', :name => nil %> -
-<% end %> -<% end %> - -<% html_title(l(:label_project_plural)) -%> +<% content_for :header_tags do %> +<%= auto_discovery_link_tag(:atom, {:action => 'index', :format => 'atom', :key => User.current.rss_key}) %> +<% end %> + +<%= form_tag(:controller => 'projects', :action => "search", :method => :get) do %> +<%= l(:label_project_plural)%> | + +<%= link_to(l(:label_project_new), {:controller => 'projects', :action => 'new', :course => 0, :project_type => @project_type}, :class => 'icon icon-add') if User.current.allowed_to?(:add_project, nil, :global => true) %> | + +
+
+ <%= text_field_tag 'name', params[:name], :size => 30 %>
+ <%= hidden_field_tag 'project_type', params[:project_type] %>
+ <%= submit_tag l(:label_search), :class => "small", :name => nil %>
+ |
+
+ <%= l(:label_my_projects) %> +
+<% end %> + +<% other_formats_links do |f| %> +<%= f.link_to 'Atom', :url => {:key => User.current.rss_key} %> +<% end %> + +<% content_for :sidebar do %> + +<%= form_tag({}, :method => :get) do %> ++ <%= submit_tag l(:button_apply), :class => 'button-small', :name => nil %> +
+<% end %> +<% end %> + +<% html_title(l(:label_project_plural)) -%> diff --git a/app/views/projects/member.html.erb b/app/views/projects/member.html.erb index 944fa33be..d70831279 100644 --- a/app/views/projects/member.html.erb +++ b/app/views/projects/member.html.erb @@ -5,8 +5,10 @@- <% if @events_by_day.size >0 %> -
- <%= l(:label_date_from_to, :start => format_date(@date_to - @days), :end => format_date(@date_to-1)) %> -
-<%= image_tag(url_to_avatar(e.event_author), :class => "avatar")%> | -
-
|
-
-
<%= link_to image_tag(url_to_avatar(@user), :class => "avatar"), user_path(@user)%> | -
-
|
-
+ <% if @events_by_day.size >0 %> +
+ <%= l(:label_date_from_to, :start => format_date(@date_to - @days), :end => format_date(@date_to-1)) %> +
+<%= image_tag(url_to_avatar(e.event_author), :class => "avatar")%> | +
+
|
+
+
<%= link_to image_tag(url_to_avatar(@user), :class => "avatar"), user_path(@user)%> | +
+
|
+