socialforge/app/views/contests/_contest_base_info.html.erb

36 lines
2.2 KiB
Plaintext
Raw Normal View History

2016-12-23 21:44:03 +08:00
<p class="sy_cgrey mb10">
<%= link_to @contest.user.try(:show_name), user_path(@contest.user), :class => "sy_cgrey" %>
<span class="sy_cgrey">&nbsp;&gt;&nbsp;</span>
<%= link_to @contest.name, contest_path(@contest), :class => "sy_cgrey" %>
</p>
<% if User.current.admin_of_contest?(@contest) %>
<%= render :partial => "contests/mamager_setting" %>
<% end %>
<div class="cl"></div>
<div class="banner-game"><img src="/images/game/banner-game.png" width="968" height="110"/></div>
<div class="sy_class_info fl">
<div class="sy_class_titbox">
<h3 class="fl sy_class_title"><%= @contest.name %></h3>
2016-12-24 18:48:50 +08:00
<span class="<%= @contest.is_public ? 'hw_icon_open' : 'hw_icon_private' %> fl ml5 mt3"></span>
2016-12-23 21:44:03 +08:00
<div class="cl"></div>
</div>
<p class="sy_cgrey ">
2016-12-24 16:29:10 +08:00
<span class=" mr15">管理员:<a class="sy_cblue" id="admin_num"><%= contest_managers(@contest).count %></a></span>
<span class=" mr15">评委:<a class="sy_cblue" id="judge_num"><%= contest_judges(@contest).count %></a></span>
<span class=" mr15">参赛者:<a class="sy_cblue" id="contestant_num"><%= contest_contestants(@contest).count %></a></span>
2016-12-23 21:44:03 +08:00
</p>
</div>
<% 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 %>
<span class="fr mt30 f16"> 邀请码:<span class="sy_corange"><%= @contest.invite_code %></span></span>
<div class="cl"></div>