添加成员

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,7 +1,8 @@
<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=" 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>
@ -29,6 +30,7 @@
</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" >
@ -80,3 +82,9 @@
</table>
</div>
</div>
<script>
function add_contest_member(){
$("#add_contest_member").show();
}
</script>