添加成员

This commit is contained in:
huang 2016-12-22 17:02:54 +08:00
parent b74c034237
commit f37c292e99
2 changed files with 40 additions and 29 deletions

View File

@ -1,3 +1,4 @@
#encoding=utf-8
class ContestsController < ApplicationController
before_filter :find_contest, :only => [:show, :settings, :update]
@ -56,6 +57,8 @@ class ContestsController < ApplicationController
end
def settings
@roles = ["管理人员","开发者","报告人员"]
@members = @contest.member_principals.includes(:roles, :principal).all.sort
end
def join_contest

View File

@ -1,34 +1,36 @@
<div class="pro_new_setting_conbox fl " style="width:100%; border:none;">
<a href="javascript:void(0);" class="fl sy_btn_green mb10 ml15">添加成员</a>
<a href="javascript:void(0);" class="fl sy_btn_green mb10 ml15" onclick="add_contest_member();">添加成员</a>
<div class="cl"></div>
<div class=" sy_new_tchbox clear" style="margin-left:10px; margin-right:10px">
<div class="hw_search_box mb10">
<input class=" sy_new_search" placeholder="支持姓名、邮箱、登录名搜索" type="text">
</div>
<div class="clear mb10">
<ul class="pro_new_idlist fl">
<li class=" clear " ><input type="checkbox" class="mr5 fl" ><span class="fl pro_new_idname mt3">shashashashashashasshashashashashashshashashashashashshashashashashashshashashashashashhasha</span></li>
<li class=" clear "><input type="checkbox" class="mr5 fl" ><span class="fl mt3">shashashashashashashasha</span></li>
<li class=" clear "><input type="checkbox" class="mr5 fl" ><span class="fl mt3">shashashashashashashasha</span></li>
<li class=" clear "><input type="checkbox" class="mr5 fl" ><span class="fl mt3">shashashashashashashasha</span></li>
<div class=" sy_new_tchbox clear undis" style="margin-left:10px; margin-right:10px" id="add_contest_member">
<%= form_for(@member, {:as => :membership, :url => project_memberships_path(@contest), :remote => true, :method => :post}) do |f| %>
<div class="hw_search_box mb10">
<input class=" sy_new_search" placeholder="支持姓名、邮箱、登录名搜索" type="text">
</div>
<div class="clear mb10">
<ul class="pro_new_idlist fl">
<li class=" clear " ><input type="checkbox" class="mr5 fl" ><span class="fl pro_new_idname mt3">shashashashashashasshashashashashashshashashashashashshashashashashashshashashashashashhasha</span></li>
<li class=" clear "><input type="checkbox" class="mr5 fl" ><span class="fl mt3">shashashashashashashasha</span></li>
<li class=" clear "><input type="checkbox" class="mr5 fl" ><span class="fl mt3">shashashashashashashasha</span></li>
<li class=" clear "><input type="checkbox" class="mr5 fl" ><span class="fl mt3">shashashashashashashasha</span></li>
</ul>
<ul class="fl pro_new_idbox">
<li class="clear ">
<input type="checkbox" class="mt2 fl" >
<p class="fl ml5"> 管理员</p>
</li>
<li class="clear ">
<input type="checkbox" class="mt2 fl" >
<p class="fl ml5"> 评委</p>
</li>
<li class="clear ">
<input type="checkbox" class="mt2 fl" >
<p class="fl ml5"> 参赛者</p>
</li>
</ul>
</div>
<a href="javascript:void(0);" class="fr sy_btn_grey ">取消</a><a href="javascript:void(0);" class="fr sy_btn_blue mr5">保存</a>
</ul>
<ul class="fl pro_new_idbox">
<li class="clear ">
<input type="checkbox" class="mt2 fl" >
<p class="fl ml5"> 管理员</p>
</li>
<li class="clear ">
<input type="checkbox" class="mt2 fl" >
<p class="fl ml5"> 评委</p>
</li>
<li class="clear ">
<input type="checkbox" class="mt2 fl" >
<p class="fl ml5"> 参赛者</p>
</li>
</ul>
</div>
<a href="javascript:void(0);" class="fr sy_btn_grey ">取消</a><a href="javascript:void(0);" class="fr sy_btn_blue mr5">保存</a>
<% end %>
</div>
<div class=" clear ml10 mr10" >
@ -79,4 +81,10 @@
</tbody>
</table>
</div>
</div>
</div>
<script>
function add_contest_member(){
$("#add_contest_member").show();
}
</script>