修复项目配置中首页显示问题

This commit is contained in:
huang 2015-04-22 09:22:52 +08:00
parent 8b77079f44
commit 729d11ebaf
2 changed files with 31 additions and 15 deletions

View File

@ -392,4 +392,19 @@ module ProjectsHelper
type
end
#显示项目配置菜单
def show_project_memu user
if user.allowed_to?(:edit_project, @project)
result = "edit_project"
elsif user.allowed_to?(:select_project_modules, @project)
result = "select_project_modules"
elsif user.allowed_to?(:manage_members, @project)
result = "manage_members"
elsif user.allowed_to?(:manage_versions, @project)
result = "manage_versions"
elsif user.allowed_to?(:manage_repository, @project)
result = "manage_repository"
end
result
end
end

View File

@ -24,21 +24,22 @@
<div class=" pro_setting">
<div id="pro_st_tb_" class="pro_st_tb_">
<ul>
<% show_memu = show_project_memu User.current%>
<% if User.current.allowed_to?(:edit_project, @project) %>
<li id="pro_st_tb_1" class="pro_st_hovertab" onclick="project_setting(1);">信息</li>
<li id="pro_st_tb_1" class="<%= show_memu == 'edit_project' ? 'pro_st_hovertab' : 'pro_st_normaltab'%>" onclick="project_setting(1);">信息</li>
<% end %>
<% if User.current.allowed_to?(:select_project_modules, @project) %>
<li id="pro_st_tb_2" class="pro_st_normaltab" onclick="project_setting(2);">模块</li>
<li id="pro_st_tb_2" class="<%= show_memu == 'select_project_modules' ? 'pro_st_hovertab' : 'pro_st_normaltab'%>" onclick="project_setting(2);">模块</li>
<% end %>
<% if User.current.allowed_to?(:manage_members, @project) %>
<li id="pro_st_tb_3" class="pro_st_normaltab" onclick="project_setting(3);">成员</li>
<li id="pro_st_tb_3" class="<%= show_memu == 'manage_members' ? 'pro_st_hovertab' : 'pro_st_normaltab'%>" onclick="project_setting(3);">成员</li>
<% end %>
<% if User.current.allowed_to?(:manage_versions, @project) %>
<li id="pro_st_tb_4" class="pro_st_normaltab" onclick="project_setting(4);">版本</li>
<li id="pro_st_tb_4" class="<%= show_memu == 'manage_versions' ? 'pro_st_hovertab' : 'pro_st_normaltab'%>" onclick="project_setting(4);">版本</li>
<% end %>
<!--<li id="pro_st_tb_5" class="pro_st_normaltab" onclick="project_setting(5);">问题类别</li>-->
<% if User.current.allowed_to?(:manage_repository, @project) %>
<li id="pro_st_tb_6" class="pro_st_normaltab" onclick="project_setting(6);">版本库</li>
<li id="pro_st_tb_6" class="<%= show_memu == 'manage_repository' ? 'pro_st_hovertab' : 'pro_st_normaltab'%>" onclick="project_setting(6);">版本库</li>
<% end %>
<!--<li id="pro_st_tb_7" class="pro_st_normaltab" onclick="project_setting(7);">活动(时间跟踪)</li>-->
<!--<li id="pro_st_tb_8" class="pro_st_normaltab" onclick="project_setting(8);">代码评审</li>-->
@ -48,28 +49,28 @@
<div class="cl"></div>
<div class="pro_st_ctt">
<div class="pro_st_dis" id="pro_st_tbc_01">
<%= render :partial=>"projects/settings/new_edit" %>
<div class="<%= show_memu == 'edit_project' ? 'pro_st_dis' : 'pro_st_undis'%>" id="pro_st_tbc_01">
<%= render :partial=>"projects/settings/new_edit" if User.current.allowed_to?(:edit_project, @project)%>
</div><!--tbc_01 end-->
<div class="pro_st_undis" id="pro_st_tbc_02">
<%= render :partial=>"projects/settings/new_modules" %>
<div class="<%= show_memu == 'select_project_modules' ? 'pro_st_dis' : 'pro_st_undis'%>" id="pro_st_tbc_02">
<%= render :partial=>"projects/settings/new_modules" if User.current.allowed_to?(:select_project_modules, @project)%>
</div><!--tbc_02 end-->
<div class="pro_st_undis" id="pro_st_tbc_03">
<%= render :partial=>"projects/settings/new_members" %>
<div class="<%= show_memu == 'manage_members' ? 'pro_st_dis' : 'pro_st_undis'%>" id="pro_st_tbc_03">
<%= render :partial=>"projects/settings/new_members" if User.current.allowed_to?(:manage_members, @project)%>
</div><!--tbc_03 end-->
<div class="pro_st_undis" id="pro_st_tbc_04">
<%= render :partial=>"projects/settings/new_versions" %>
<div class="<%= show_memu == 'manage_versions' ? 'pro_st_dis' : 'pro_st_undis'%>" id="pro_st_tbc_04">
<%= render :partial=>"projects/settings/new_versions" if User.current.allowed_to?(:manage_versions, @project)%>
</div><!--tbc_04 end-->
<!--<div class="pro_st_undis" id="pro_st_tbc_05">-->
<!--<%#= render :partial=>"projects/settings/new_issue_categories" %>-->
<!--</div>&lt;!&ndash;tbc_05 end&ndash;&gt;-->
<div class="pro_st_undis" id="pro_st_tbc_06">
<%= render :partial=>"projects/settings/new_repositories" %>
<div class="<%= show_memu == 'manage_repository' ? 'pro_st_dis' : 'pro_st_undis'%>" id="pro_st_tbc_06">
<%= render :partial=>"projects/settings/new_repositories" if User.current.allowed_to?(:manage_repository, @project)%>
</div><!--tbc_06 end-->
<!--<div class="pro_st_undis" id="pro_st_tbc_07">-->