You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
pgfqe6ch8/app/views/syllabuses/members.html.erb

55 lines
2.3 KiB

6 years ago
<ul id="sy_tab_nav">
<li id="sy_tab_nav_1" onclick="HoverLi(1);">
<a href="javascript:void(0);" class="sy_tab_type" >课程大纲</a>
</li>
<li id="sy_tab_nav_2" onclick="HoverLi(2);">
<a href="javascript:void(0);" class="sy_tab_type" >班级列表</a>
</li>
<li id="sy_tab_nav_3" class="sy_tab_hover" onclick="HoverLi(3);">
<a href="javascript:void(0);" class="sy_tab_type" >教师团队</a>
</li>
</ul>
<div id="sy_tab_con_3">
<div class="sy_new_tablebox clear">
<%= render :partial => 'syllabus_member_list' %>
<% if User.current == @syllabus.user || User.current.admin? %>
<a href="javascript:void(0);" class="fl sy_btn_green" onclick="toggle_search();">添加成员</a>
<% end %>
</div>
<% if User.current == @syllabus.user || User.current.admin? %>
<div class="sy_new_tchbox clear <%= @show == 1 ? '' : 'undis' %>" id="sy_search_box">
<%= form_tag url_for(:controller => 'syllabus_member', :action => 'create', :syllabus => @syllabus),:id => 'syllabus_member_add_form', :remote => true do |f|%>
<input hidden="hidden" value="true" name="flag">
<div class="hw_search_box mb10">
<input id="principal_search" class="sy_new_search" type="text" placeholder="<%= l(:label_invite_trustie_user_tips)%>">
<%= javascript_tag "observeSearchfield('principal_search', null, '#{escape_javascript "/syllabus_member/syl_member_autocomplete?" + {:syllabus => @syllabus.id}.to_query }')" %>
</div>
<div class="cl"></div>
<div id="principals_for_new_member">
<%= find_user_not_in_current_syllabus_by_name(@syllabus) %>
</div>
<div class="cl mb10"></div>
<a href="javascript:void(0);" class="fl sy_btn_blue mr5" onclick="$('#syllabus_member_add_form').submit();">确定</a>
<a href="javascript:void(0);" class="fl sy_btn_grey mr5" onclick="reset_search();">取消</a>
<% end%>
</div>
<% end %>
</div>
<script>
//如果右边的列表比左边的高度低则将右边的高度设为与左边对齐
$(function() {
$(".sy_con_l").css("min-height",$(".sy_con_r").height());
});
function toggle_search() {
$("#sy_search_box").toggle();
}
function reset_search() {
$("#sy_search_box").toggle();
$("#principal_search").val("");
$("#principals_for_new_member").html("");
}
</script>