修改项目配置、关注、加入、类型等不同角色显示

This commit is contained in:
huang 2015-04-27 16:54:46 +08:00
parent 9cb31d75de
commit e7d85aad27
1 changed files with 6 additions and 5 deletions

View File

@ -1,10 +1,10 @@
<div class="pr_info_join fl">
<!--关注项目-->
<% if ( !(User.current.member_of? @project) && User.current.login?) && !User.current.admin %> <!--added by linchun-->
<!--关注:非项目成员-->
<% if !User.current.member_of?(@project) && User.current.login? && !User.current.admin %>
<span><%= watcher_link_for_project(@project, User.current) %></span>
<% end %>
<!--加入项目 -->
<% if ( !(User.current.member_of? @project) && User.current.login?) && !User.current.admin %>
<% if !User.current.member_of?(@project) && User.current.login? && !User.current.admin %>
<%= join_in_project_link(@project, User.current) %>
<% end %>
<!--配置项目-->
@ -12,12 +12,13 @@
<%= link_to "<span class='pr_setting'></span>#{l(:button_configure)}".html_safe, settings_project_path(@project), :class => "pr_join_a" %>
<% end %>
<!--项目类型-->
<% if Member.where(:project_id => @project.id).first.roles.first.to_s.include?("Manager") || User.current.admin? %>
<% if (User.current.login? && User.current.member_of?(@project) && Member.where(:user_id => User.current.id, :project_id => @project.id).first.roles.first.to_s.include?("Manager")) || User.current.admin? %>
<%= link_to "<span class='#{typeclass}'></span>#{text}".html_safe,"javascript:void(0)" ,:onClick => "show_window();", :class => "pr_join_a",:id => "setting_project_type"%>
<% end %>
<!--退出项目-->
<% if (User.current.member_of? @project) && User.current.login? &&
Member.where(:user_id => User.current.id, :project_id=>@project.id).first.roles.first.to_s != "Manager" %>
Member.where(:user_id => User.current.id, :project_id => @project.id).first.roles.first.to_s != "Manager" %>
<%= exit_project_link(@project) %>
<% end %>
</div>