<%= link_to @contest.user.try(:show_name), user_path(@contest.user), :class => "sy_cgrey" %>
>
<%= link_to @contest.name, contest_path(@contest), :class => "sy_cgrey" %>
<% if User.current.admin_of_contest?(@contest) || User.current.admin? %>
<%= render :partial => "contests/mamager_setting" %>
<% end %>
<% if @contest.id == 786 %>
<% else %>
<% end %>
<% if User.current.member_of_contest?(@contest) %>
<% if @contest.contest_members.where(:user_id => User.current.id)[0].contest_member_roles.count == 2 %>
<% if User.current.admin_of_contest?(@contest) %>
<%= link_to '评委身份', switch_role_contest_path(@contest, :user_id => User.current.id, :curr_role => 13, :tar_role => 14), :class => "fr sy_btn_blue mt28 ml10", :title => "由管理员身份切换至评委身份" %>
<% elsif User.current.judge_of_contest?(@contest) %>
<%= link_to '管理员身份', switch_role_contest_path(@contest, :user_id => User.current.id, :curr_role => 14, :tar_role => 13), :class => "fr sy_btn_blue mt28 ml10", :title => "由评委身份切换至管理员身份" %>
<% end %>
<% end %>
<% else %>
<%= link_to "加入竞赛",join_contest_contests_path(),:remote => true, :method => "get", :class => "fr sy_btn_blue mt28 ml10" %>
<% end %>
邀请码:
<% if @contest.invite_code_halt == 0 %>
<%=@contest.generate_invite_code %>
<% else %>
已停用
<% end %>
<% if User.current.admin_of_contest?(@contest) || User.current.admin? %>
<%= @contest.invite_code_halt == 0 ? "请将邀请码告诉成员" : "邀请码已停用" %>
<%= @contest.invite_code_halt == 0 ? "他们可以主动加入" : "暂时停止成员主动加入" %>
<% end %>