完成项目配置-成员模块
This commit is contained in:
parent
b3c3693d72
commit
b98a67f50d
|
@ -38,7 +38,7 @@ module MembersHelper
|
|||
links = pagination_links_full(@obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true){|text, parameters, options|
|
||||
link_to text, autocomplete_project_memberships_path(project, parameters.merge(:q => params[:q],:flag => true, :format => 'js')), :remote => true
|
||||
}
|
||||
s + content_tag('ul', links,:class => 'wlist', :style =>"float:left;margin-top:0px;")
|
||||
s + content_tag('ul', links,:class => 'wlist', :id => "course_member_pagination_links" )
|
||||
end
|
||||
|
||||
# add by nwb
|
||||
|
@ -55,6 +55,19 @@ module MembersHelper
|
|||
s + content_tag('ul', links,:class => 'wlist',:id => "course_member_pagination_links")
|
||||
end
|
||||
|
||||
# 项目配置中添加成员列表
|
||||
def render_principals_for_new_project_members(project)
|
||||
scope = Principal.active.sorted.not_member_of(project).like(params[:q])
|
||||
principals = paginateHelper scope,10
|
||||
s = content_tag('ul', project_member_check_box_tags_ex('membership[user_ids][]', principals), :class => 'mb5', :id => 'principals')
|
||||
|
||||
links = pagination_links_full(@obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true) {|text, parameters, options|
|
||||
link_to text, appliedproject_project_memberships_path(project, parameters.merge(:q => params[:q], :format => 'js')), :remote => true
|
||||
}
|
||||
|
||||
s + content_tag('ul', links,:class => 'wlist',:id => "course_member_pagination_links")
|
||||
end
|
||||
|
||||
|
||||
# 当前申请加入的成员名单
|
||||
def render_principals_for_applied_members(project)
|
||||
|
|
|
@ -163,8 +163,16 @@
|
|||
<li><%= link_to l(:label_invite_trustie_user), :controller=>"projects", :action=>"invite_members", :id => @project %></li>
|
||||
</ul>
|
||||
<% end %><!--end-->
|
||||
<!--menu 左侧工具栏 -->
|
||||
<%= render :partial => 'layouts/base_development_group', :locals => {:project => @project}%> <!-- end -->
|
||||
<!--menu 左侧工具栏 -->
|
||||
<!--project_new_type: 1为开发组;2为科研组;3为朋友圈子-->
|
||||
<% if @project.project_new_type == 1 || @project.project_new_type.nil? %>
|
||||
<%= render :partial => 'layouts/base_development_group', :locals => {:project => @project}%>
|
||||
<% elsif @project.project_new_type == 2 %>
|
||||
<%= render :partial => 'layouts/base_research_team', :locals => {:project => @project}%>
|
||||
<% else %>
|
||||
<%= render :partial => 'layouts/base_friend_group', :locals => {:project => @project}%>
|
||||
<% end %>
|
||||
<!-- end -->
|
||||
</div><!--项目侧导航 end-->
|
||||
<div class="cl"></div>
|
||||
|
||||
|
@ -211,13 +219,13 @@
|
|||
<div id="light" class="white_content02">
|
||||
<!-- 这里写需弹出框的HTML代码 -->
|
||||
<% text = @project.project_new_type == 1 ? "development_group" : (@project.project_new_type == 2 ? "research_group" : "friend_organization")%>
|
||||
<div ><a href="javascript:void(0)" onClick="close_window('development_group');" class="box_close" id="close_light"></a></div>
|
||||
<div ><a href="javascript:void(0)" onClick="close_window('<%= text%>');" class="box_close" id="close_light"></a></div>
|
||||
<div class=" mt10">
|
||||
<h3 class="mb10 c_blue">请选择项目类型:</h3>
|
||||
<ul class="mb10" id="project_type">
|
||||
<li><input type="radio" name="project_type" checked="" id="development_group"/><label > 开发组</label></li>
|
||||
<li><input type="radio" name="project_type" id="research_group"/><label > 科研组</label></li>
|
||||
<li><input type="radio" name="project_type" id="friend_organization"/><label > 朋友圈</label></li>
|
||||
<li><input type="radio" name="project_type" <%= @project.project_new_type == 1 ? 'checked' : ''%> id="development_group"/><label > 开发组</label></li>
|
||||
<li><input type="radio" name="project_type" <%= @project.project_new_type == 2 ? 'checked' : ''%> id="research_group"/><label > 科研组</label></li>
|
||||
<li><input type="radio" name="project_type" <%= @project.project_new_type == 3 ? 'checked' : ''%> id="friend_organization"/><label > 朋友圈</label></li>
|
||||
</ul>
|
||||
<a href="javascript:void(0)" class="orange_btn" onclick="click_ok('<%= change_project_type_project_path @project%>');" >确定</a>
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<% if @flag == "true"%>
|
||||
$('#principals_for_new_member').html('<%= escape_javascript(render_project_members(@project)) %>');
|
||||
<% else%>
|
||||
$('#principals_for_new_member').html('<%= escape_javascript(render_principals_for_new_members(@project)) %>');
|
||||
$('#principals_for_new_member').html('<%= escape_javascript(render_project_members(@project)) %>');
|
||||
<% end%>
|
||||
<% elsif @course%>
|
||||
var checked = $("#principals input:checked").size();
|
||||
|
|
|
@ -11,11 +11,11 @@
|
|||
|
||||
<div class="members_left">
|
||||
<% if members.any? %>
|
||||
<ul style=" border-bottom:none;">
|
||||
<li><span class="w90 f_b" ><%= l(:label_user) %></span><span class="w210 f_b"><%= l(:label_role_plural) %></span><span></span></li>
|
||||
<ul style=" border-bottom:none;">
|
||||
<li><span class="w90 f_b" ><%= l(:label_user) %></span><span class="w210 f_b"><%= l(:label_role_plural) %></span><span></span></li>
|
||||
<%= call_hook(:view_projects_settings_members_table_header, :project => @project) %>
|
||||
<% members.each do |member| %>
|
||||
<li >
|
||||
<li >
|
||||
<%= link_to_user_header member.principal,false,:class => "w150 c_orange fl" %>
|
||||
<span class="w150 fl">
|
||||
<%= h member.roles.sort.collect(&:to_s).join(', ') %>
|
||||
|
@ -25,8 +25,8 @@
|
|||
) do |f| %>
|
||||
<% roles.each do |role| %>
|
||||
<ul style="text-align: left;" class="ml20">
|
||||
<%= radio_button_tag 'membership[role_ids][]', role.id, member.roles.include?(role),
|
||||
:disabled => member.member_roles.detect { |mr| mr.role_id == role.id && !mr.inherited_from.nil? } %>
|
||||
<%= check_box_tag 'membership[role_ids][]', role.id, member.roles.include?(role),
|
||||
:disabled => member.member_roles.detect { |mr| mr.role_id == role.id && !mr.inherited_from.nil? } %>
|
||||
<label ><%= h role %></label>
|
||||
</ul>
|
||||
<!--<br/>-->
|
||||
|
@ -50,68 +50,45 @@
|
|||
:data => (!User.current.admin? && member.include?(User.current) ? {:confirm => l(:text_own_membership_delete_confirmation)} : {confirm: l(:label_delete_confirm)}) if member.deletable? %>
|
||||
<%# end%>
|
||||
</li>
|
||||
<% end%>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
<% end%>
|
||||
</ul>
|
||||
<% else %>
|
||||
<p class="nodata"><%= l(:label_no_data) %></p>
|
||||
<% end %>
|
||||
</div><!-- 左边-->
|
||||
|
||||
<div class="members_right">
|
||||
<div class="members_jion">
|
||||
<p class="c_blue mb10 fb">+申请加入</p>
|
||||
<ul class="mb10">
|
||||
<li><input name="membership[user_ids][]" type="checkbox" value="3172"> <a href="/users/3172" class="c_blue">JackWu (巫 荣杰)</a></li>
|
||||
<li><input name="membership[user_ids][]" type="checkbox" value="3172"> <a href="/users/3172" class="c_blue">JackWu (巫 荣杰)</a></li>
|
||||
<li><input name="membership[user_ids][]" type="checkbox" value="3172"> <a href="/users/3172" class="c_blue">JackWu (巫 荣杰)</a></li>
|
||||
</ul>
|
||||
<ul class="mb10">
|
||||
<li>角色:</li>
|
||||
<li><input type="checkbox" /><label>Manager</label></li>
|
||||
<li><input type="checkbox" /><label>Developer</label></li>
|
||||
<li><input type="checkbox" /><label>Reporter</label></li>
|
||||
</ul>
|
||||
<div class="cl"></div>
|
||||
<a href="javascript:void(0)" class="blue_btn fl" >批准</a><a href="javascript:void(0)" class="grey_btn fl ml10" >拒绝</a>
|
||||
<p class="c_blue fb mt10 mb5"><%= l(:label_member_new) %></p>
|
||||
<%= form_for(@member, {:as => :membership, :url => project_memberships_path(@project), :remote => true, :method => :post}) do |f| %>
|
||||
<div class="member_search">
|
||||
<input hidden="hidden" value="true" name="flag">
|
||||
<input id="principal_search" class="member_search_input fl" type="text" placeholder="请输入用户名称来搜索好友">
|
||||
<%= javascript_tag "observeSearchfield('principal_search', null, '#{ escape_javascript autocomplete_project_memberships_path(@project, :format => 'js') }')" %>
|
||||
<div class="cl"></div>
|
||||
|
||||
</div><!--members_jion end-->
|
||||
<div class="cl"></div>
|
||||
<div class="members_add">
|
||||
<p class="c_blue fb mt10 mb5">添加成员</p>
|
||||
<div class="member_search">
|
||||
<input class="member_search_input fl" type="text" name="" value="输入用户名称搜索好友"><a class="invi_search_btn fl c_white" >搜索</a>
|
||||
<div class="cl"></div>
|
||||
<ul class="mb5">
|
||||
<li><input type="checkbox" name="" checked=""> <label >suntao</label> </li>
|
||||
<li><input type="checkbox" name="" > <label >suntaoalibb</label> </li>
|
||||
<li><input type="checkbox" name="" > <label >用户名称</label> </li>
|
||||
<li><input type="checkbox" name="" > <label >suntao</label> </li>
|
||||
<li><input type="checkbox" name="" checked=""> <label >suntao</label> </li>
|
||||
<li><input type="checkbox" name="" > <label >suntaoalibb</label> </li>
|
||||
<li><input type="checkbox" name="" > <label >用户名称</label> </li>
|
||||
<li><input type="checkbox" name="" > <label >suntao</label> </li>
|
||||
<li><input type="checkbox" name="" > <label >用户名称</label> </li>
|
||||
<li><input type="checkbox" name="" > <label >suntao</label> </li>
|
||||
</ul>
|
||||
<div class="cl"></div>
|
||||
<ul class="wlist mr40" >
|
||||
<li><a href="javascript:void(0)">下一页</a></li>
|
||||
<li><a href="javascript:void(0)">...</a></li>
|
||||
<li><a href="javascript:void(0)">2</a></li>
|
||||
<li class="wlist_select" ><a href="javascript:void(0)">1</a></li>
|
||||
<li><a href="javascript:void(0)">上一页</a></li>
|
||||
</ul>
|
||||
<div class="cl"></div>
|
||||
<ul class="rolebox mb10 mt10">
|
||||
<li class="fb">角色: </li>
|
||||
<li ><input class="fl" type="checkbox" name="" checked=""> <label >TeachingAsistant</label> </li>
|
||||
<li ><input type="checkbox" name="" > <label >Teacher</label> </li>
|
||||
<li ><input type="checkbox" name="" > <label >Student</label> </li>
|
||||
</ul>
|
||||
<div class="cl"></div>
|
||||
<a href="javascript:void(0)" class=" blue_btn">新增成员</a>
|
||||
</div>
|
||||
</div>
|
||||
<div id="principals_for_new_member">
|
||||
<%= render_principals_for_new_project_members(@project) %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
||||
<ul class="rolebox mb10 mt10">
|
||||
<li class="fb">
|
||||
<%= l(:label_role_plural) %>:
|
||||
</li>
|
||||
<% roles.each do |role| %>
|
||||
<li>
|
||||
<%= check_box_tag 'membership[role_ids][]', role.id %>
|
||||
<label ><%= h role %></label>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<div class="cl mb10"></div>
|
||||
<a href="javascript:void(0)" class="member_btn" onclick="$('#new_membership').submit();">
|
||||
新增成员
|
||||
</a>
|
||||
</div>
|
||||
<% end%>
|
||||
</div><!-- 右边 end-->
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue