issue#509,#510

This commit is contained in:
yanxd 2014-03-30 17:03:15 +08:00
parent f7eca26770
commit 850ff6194f
4 changed files with 19 additions and 5 deletions

View File

@ -638,7 +638,7 @@ class ProjectsController < ApplicationController
## 有角色参数的才是课程,没有的就是项目
@render_file = 'member_list'
# 判断是否课程
if @project.project_type == 1
if @project.project_type == Project::ProjectType_course
case params[:role]
when '1'
@subPage_title = l :label_teacher_list
@ -650,7 +650,7 @@ class ProjectsController < ApplicationController
@subPage_title = ''
@members = @project.member_principals.includes(:roles, :principal).all.sort
end
else
else # @project.project_type == Project::ProjectType_project
roles = Role.find_all_givable
@subPage_title = l :label_member_list
@members = @project.member_principals.includes(:roles, :principal).all

View File

@ -258,6 +258,21 @@ module ProjectsHelper
end
end
def rolesToLanguage rolesArray
rolesArray.map{ |roleName|
case roleName
when "Manager"
l :default_role_manager
when "Developer"
l :default_role_developer
when "Reporter"
l :default_role_reporter
else
'Unkown'
end
}
end
def sort_project_by_hot
return sort_project_by_hot_rails
@projects_status = ProjectStatus.visible.where("project_statuses.project_type <> ? or project_statuses.project_type is null", 1)

View File

@ -4,7 +4,7 @@
:html => { :accesskey => Redmine::AccessKeys.key_for(:new_issue) }, :class => 'icon icon-add' %>
<%= link_to l(:label_query), '#', :class => 'icon icon-help',
:onclick => '$("#custom_query").slideToggle(400); ' if User.current.logged? %>
:onclick => '$("#custom_query").slideToggle(400); ' if true || User.current.logged? %>
</div>
</div>

View File

@ -21,8 +21,7 @@
</p>
</div>
<% else%>
<!-- TODO: member.roles unsafe #nyan -->
<%= content_tag "div", content_tag("p", member.roles.sort.collect(&:to_s).join(', ')), :class => "clear avatar_name" %>
<%= content_tag "div", content_tag("p", rolesToLanguage(member.roles.sort.collect(&:to_s)).join(', ')), :class => "clear avatar_name" %>
<div class="clear avatar_user">
<p>
<%= l(:label_user_for_project_grade) %>: <span style="color:#ec6300"><%= UserGrade.find_by_user_id_and_project_id(member[:user_id], @project.id).grade %></span>