76 lines
3.6 KiB
Plaintext
76 lines
3.6 KiB
Plaintext
<div class="pro_new_setting_conbox fl " style="width:100%; border:none;">
|
|
<a href="javascript:void(0);" class="fl sy_btn_green mb10 ml15" onclick="add_contest_member();">添加成员</a>
|
|
<%= link_to "Excel导出", export_all_members_contest_path(@contest, :format => 'xls'), :class => 'fl sy_btn_green mb10 ml15' %>
|
|
<div class="cl"></div>
|
|
<div class=" sy_new_tchbox clear undis" style="margin-left:10px; margin-right:10px" id="add_contest_member">
|
|
<%= form_tag url_for(:controller => 'contest_members', :action => 'create', :contest => @contest.id),:id => 'contest_member_add_form', :remote => true do |f|%>
|
|
<div class="hw_search_box mb10">
|
|
<input class="sy_new_search" placeholder="支持姓名、邮箱、登录名搜索" id="principal_search" type="text">
|
|
<%= javascript_tag "observeSearchfield('principal_search', null, '#{escape_javascript "/contest_members/contest_member_autocomplete?" + {:contest => @contest.id}.to_query }')" %>
|
|
</div>
|
|
<div class="fl mb10 pro_new_idlist" id="principals_for_new_member">
|
|
<%= find_user_not_in_current_contest_by_name(@contest) %>
|
|
</div>
|
|
<div class="fl">
|
|
<ul class="fl pro_new_idbox">
|
|
<li class="clear ">
|
|
<label>
|
|
<input type="checkbox" class="mt2 fl h28" name="membership[role_ids][]" value="13" id="contest_admin">
|
|
<p class="fl ml5"> 管理员</p>
|
|
</label>
|
|
</li>
|
|
<li class="clear ">
|
|
<label>
|
|
<input type="checkbox" class="mt2 fl h28" name="membership[role_ids][]" value="14" id="contest_judge">
|
|
<p class="fl ml5"> 评委</p>
|
|
</label>
|
|
</li>
|
|
<li class="clear ">
|
|
<label>
|
|
<input type="checkbox" class="mt2 fl h28" name="membership[role_ids][]" value="15" id="contest_contestant">
|
|
<p class="fl ml5"> 参赛者</p>
|
|
</label>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
<div class="cl"></div>
|
|
<a href="javascript:void(0);" class="fr sy_btn_grey" onclick='$("#add_contest_member").hide();'>取消</a>
|
|
<a href="javascript:void(0);" class="fr sy_btn_blue mr5" onclick="$('#contest_member_add_form').submit();">保存</a>
|
|
<% end %>
|
|
</div>
|
|
|
|
<div class="clear ml10 mr10">
|
|
<%= render :partial => 'contests/contest_member' %>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
function add_contest_member(){
|
|
$("#add_contest_member").toggle();
|
|
}
|
|
$(function() {
|
|
$("#contest_admin").on('click', function(){
|
|
if($("#contest_admin").is(":checked") || $("#contest_judge").is(":checked")) {
|
|
$("#contest_contestant").attr('disabled', 'disabled');
|
|
} else {
|
|
$("#contest_contestant").removeAttr('disabled');
|
|
}
|
|
});
|
|
$("#contest_judge").on('click', function(){
|
|
if($("#contest_admin").is(":checked") || $("#contest_judge").is(":checked")) {
|
|
$("#contest_contestant").attr('disabled', 'disabled');
|
|
} else {
|
|
$("#contest_contestant").removeAttr('disabled');
|
|
}
|
|
});
|
|
$("#contest_contestant").on('click', function(){
|
|
if($("#contest_contestant").is(":checked")) {
|
|
$("#contest_admin").attr('disabled', 'disabled');
|
|
$("#contest_judge").attr('disabled', 'disabled');
|
|
} else {
|
|
$("#contest_admin").removeAttr('disabled');
|
|
$("#contest_judge").removeAttr('disabled');
|
|
}
|
|
});
|
|
});
|
|
</script> |