班级配置页面的改版:基本信息、成员、组织、讨论区设置
This commit is contained in:
parent
8a0833e6cd
commit
d35245f7e4
|
@ -8,7 +8,7 @@ class ContestsController < ApplicationController
|
||||||
helper :files
|
helper :files
|
||||||
include AvatarHelper
|
include AvatarHelper
|
||||||
|
|
||||||
before_filter :find_contest, :only => [:show, :settings, :update, :destroy, :contest_activities, :search_member, :private_or_public, :switch_role, :set_invite_code_halt, :renew,
|
before_filter :find_contest, :only => [:show, :settings, :update, :destroy, :contest_activities, :private_or_public, :switch_role, :set_invite_code_halt, :renew,
|
||||||
:member, :export_all_members, :feedback]
|
:member, :export_all_members, :feedback]
|
||||||
before_filter :is_logged, :only => [:index, :new, :create]
|
before_filter :is_logged, :only => [:index, :new, :create]
|
||||||
before_filter :is_admin?, :only => [:settings, :set_invite_code_halt, :destroy]
|
before_filter :is_admin?, :only => [:settings, :set_invite_code_halt, :destroy]
|
||||||
|
@ -247,20 +247,6 @@ class ContestsController < ApplicationController
|
||||||
redirect_to contest_path(@contest)
|
redirect_to contest_path(@contest)
|
||||||
end
|
end
|
||||||
|
|
||||||
def search_member
|
|
||||||
if User.current.admin_of_contest?(@contest) || User.current.admin?
|
|
||||||
q = "#{params[:name].strip}"
|
|
||||||
@roles = Role.givable.all[11..13]
|
|
||||||
if q.nil? || q == ""
|
|
||||||
@members = @contest.member_principals.includes(:roles, :principal).all.sort
|
|
||||||
else
|
|
||||||
@members = searchmember_by_name(@contest.member_principals.includes(:roles, :principal).all.sort,q)
|
|
||||||
end
|
|
||||||
else
|
|
||||||
render_403
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
# 邀请码停用/启用
|
# 邀请码停用/启用
|
||||||
def set_invite_code_halt
|
def set_invite_code_halt
|
||||||
if User.current.admin_of_contest?(@contest) || User.current.admin?
|
if User.current.admin_of_contest?(@contest) || User.current.admin?
|
||||||
|
|
|
@ -621,11 +621,6 @@ class CoursesController < ApplicationController
|
||||||
join_course_messages = CourseMessage.where("user_id =? and course_message_type =? and course_id =? and status = ? and viewed =?", User.current.id, 'JoinCourse', @course.id, 1, 0)
|
join_course_messages = CourseMessage.where("user_id =? and course_message_type =? and course_id =? and status = ? and viewed =?", User.current.id, 'JoinCourse', @course.id, 1, 0)
|
||||||
join_course_messages.update_all(:viewed => true)
|
join_course_messages.update_all(:viewed => true)
|
||||||
|
|
||||||
if params[:tab] && params[:tab] == 'boards'
|
|
||||||
@tab = 4
|
|
||||||
else
|
|
||||||
@tab = 0
|
|
||||||
end
|
|
||||||
if User.current.allowed_to?(:as_teacher,@course)
|
if User.current.allowed_to?(:as_teacher,@course)
|
||||||
@select_tab = params[:tab]
|
@select_tab = params[:tab]
|
||||||
@issue_custom_fields = IssueCustomField.sorted.all
|
@issue_custom_fields = IssueCustomField.sorted.all
|
||||||
|
@ -635,6 +630,14 @@ class CoursesController < ApplicationController
|
||||||
|
|
||||||
@roles = Role.givable.all[3..5]
|
@roles = Role.givable.all[3..5]
|
||||||
@members = @course.member_principals.includes(:roles, :principal).all.sort
|
@members = @course.member_principals.includes(:roles, :principal).all.sort
|
||||||
|
|
||||||
|
course_org_ids = OrgCourse.find_by_sql("select distinct organization_id from org_courses where course_id = #{@course.id}").map(&:organization_id)
|
||||||
|
if course_org_ids.empty?
|
||||||
|
@orgs_not_in_course = User.current.organizations
|
||||||
|
else
|
||||||
|
course_org_ids = "(" + course_org_ids.join(',') + ")"
|
||||||
|
@orgs_not_in_course = User.current.organizations.where("organizations.id not in #{course_org_ids}")
|
||||||
|
end
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html { render :layout => 'base_courses' }
|
format.html { render :layout => 'base_courses' }
|
||||||
format.api { render_validation_errors(@course) }
|
format.api { render_validation_errors(@course) }
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
<a href="javascript:void(0)">
|
<div class="banner-course-avatar fl">
|
||||||
<%= image_tag(url_to_avatar(source), id: "avatar_image", :width =>"60", :height =>"60",:alt=>"上传图片", :class => "fl ml5 pro_new_upimg")%>
|
<%= image_tag(url_to_avatar(source), id: "avatar_image", :width =>"60", :height =>"60",:alt=>"上传图片", :class => "fl pro_new_upimg")%>
|
||||||
</a>
|
<a class="banner-course-inner" href="javascript:void(0)" onclick="$('#upload_course_logo').click();"></a>
|
||||||
<%#= link_to l(:button_delete_file),{:controller => :avatar,:action => :delete_image,:remote=>true,:source_type=> source.class,:source_id=>source.id},:confirm => l(:text_are_you_sure), :method => :post, :class => "upbtn fl" %>
|
<a class="banner-course-notice" href="javascript:void(0)" onclick="$('#upload_course_logo').click();">更换图片</a>
|
||||||
<a href="javascript:void(0)" class="sub_btn fl mt35 ml5" style="line-height: 1.5" onclick="$('#upload_course_logo').click();"><%= l(:button_upload_photo) %></a>
|
</div>
|
||||||
|
<a href="javascript:void(0)" class="fl mt45 ml5" style="line-height: 1.5" onclick="$('#upload_course_logo').click();">点击更换</a>
|
||||||
<%= file_field_tag 'avatar[image]',
|
<%= file_field_tag 'avatar[image]',
|
||||||
:id => 'upload_course_logo',
|
:id => 'upload_course_logo',
|
||||||
:class => 'undis upload_file',
|
:class => 'undis upload_file',
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<% if @course %>
|
<% if @course %>
|
||||||
|
hideModal();
|
||||||
$("#tbc_04").html("<%=escape_javascript(render :partial => 'courses/settings/boards_setting') %>");
|
$("#tbc_04").html("<%=escape_javascript(render :partial => 'courses/settings/boards_setting') %>");
|
||||||
<% course_board = @course.boards.where("parent_id is NULL").first %>
|
<% course_board = @course.boards.where("parent_id is NULL").first %>
|
||||||
$("#board_children_list").html("<%= escape_javascript(render :partial => 'layouts/board_children_list', :locals => {:course_board => course_board})%>");
|
$("#board_children_list").html("<%= escape_javascript(render :partial => 'layouts/board_children_list', :locals => {:course_board => course_board})%>");
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<% if @course %>
|
<% if @course %>
|
||||||
|
hideModal();
|
||||||
$("#tbc_04").html("<%=escape_javascript(render :partial => 'courses/settings/boards_setting') %>");
|
$("#tbc_04").html("<%=escape_javascript(render :partial => 'courses/settings/boards_setting') %>");
|
||||||
<% course_board = @course.boards.where("parent_id is NULL").first %>
|
<% course_board = @course.boards.where("parent_id is NULL").first %>
|
||||||
$("#board_children_list").html("<%= escape_javascript(render :partial => 'layouts/board_children_list', :locals => {:course_board => course_board})%>");
|
$("#board_children_list").html("<%= escape_javascript(render :partial => 'layouts/board_children_list', :locals => {:course_board => course_board})%>");
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
$('#course_members_setting').html('<%= escape_javascript(render :partial => 'courses/course_members') %>');
|
|
|
@ -1 +1 @@
|
||||||
$('#course_members_setting').html('<%= escape_javascript(render :partial => 'courses/course_members') %>');
|
$('#tbc_02').html('<%= escape_javascript(render :partial => 'courses/settings/member') %>');
|
||||||
|
|
|
@ -5,9 +5,9 @@
|
||||||
}
|
}
|
||||||
<% end %>
|
<% end %>
|
||||||
$("#search_orgs_result_list").html("");
|
$("#search_orgs_result_list").html("");
|
||||||
$("#search_orgs_result_list").append('<ul class="ml20">');
|
$("#search_orgs_result_list").append('<ul class="sy_new_tchlist ml20">');
|
||||||
<% @orgs_not_in_course.each do |org|%>
|
<% @orgs_not_in_course.each do |org|%>
|
||||||
link = "<li><label><input type='checkbox'class='mr5 fl mt3' name='orgNames[]' value='<%=org.id%>'/><span class='relateOrgName fl'> <%=org.name %> </span></label></li><div class='cl mt5'></div>";
|
link = "<li><label><input type='checkbox'class='mr5 fl' name='orgNames[]' style='height:28px' value='<%=org.id%>'/><span class='relateOrgName fl' style='line-height: 28px;'> <%=org.name %> </span></label></li><div class='cl mt5'></div>";
|
||||||
$("#search_orgs_result_list").append(link );
|
$("#search_orgs_result_list").append(link );
|
||||||
<%end %>
|
<%end %>
|
||||||
$("#search_orgs_result_list").append('</ul>')
|
$("#search_orgs_result_list").append('</ul>')
|
||||||
|
|
|
@ -1,151 +1,63 @@
|
||||||
<div class="courseRSide fl" id="homework_page_right">
|
<div class="sy_class_r fr mb10 ml10" id="homework_page_right">
|
||||||
<div class="project_r_h" style="width:730px;">
|
<h3 class="game-setting-h3 "><span class="ml15"></span>班级配置</h3>
|
||||||
<h2 class="project_h2"><%= l(:label_course_modify_settings)%></h2>
|
<div class="game-setting-tab">
|
||||||
|
<ul id="game-setting-tab-nav">
|
||||||
|
<li id="tb_1" class="game-setting-nav-hover" onclick="HoverLi(1);">
|
||||||
|
<a href="javascript:void(0);">基本信息</a>
|
||||||
|
</li>
|
||||||
|
<li id="tb_2" onclick="HoverLi(2);">
|
||||||
|
<a href="javascript:void(0);">成员</a>
|
||||||
|
</li>
|
||||||
|
<li id="tb_3" onclick="HoverLi(3);">
|
||||||
|
<a href="javascript:void(0);">组织</a>
|
||||||
|
</li>
|
||||||
|
<li id="tb_4" onclick="HoverLi(4);">
|
||||||
|
<a href="javascript:void(0);">讨论区设置</a>
|
||||||
|
</li>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<div class="hwork_dis" id="tbc_01" style="padding-top: 10px;">
|
||||||
|
<%= render :partial => 'courses/settings/edit' %>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="hwork_undis" id="tbc_02">
|
||||||
|
<%= render :partial => 'courses/settings/member'%>
|
||||||
|
</div><!---成员结束-->
|
||||||
|
|
||||||
|
<div class="hwork_undis" id="tbc_03">
|
||||||
|
<%= render :partial => 'courses/settings/join_org' %>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="hwork_undis" id="tbc_04">
|
||||||
|
<%= render :partial => 'courses/settings/boards_setting' %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
$(function(){
|
$(function(){
|
||||||
var tab = <%= @tab %>;
|
|
||||||
if(tab != 0){
|
|
||||||
course_setting(tab);
|
|
||||||
}
|
|
||||||
<% if @select_tab == 'member'%>
|
<% if @select_tab == 'member'%>
|
||||||
$("#tb_2").click();
|
$("#tb_2").click();
|
||||||
|
<% elsif @select_tab == 'boards'%>
|
||||||
|
$("#tb_4").click();
|
||||||
<% end %>
|
<% end %>
|
||||||
$("#homework_page_right").css("min-height",$("#courseLSide").height()+45);
|
$("#homework_page_right").css("min-height",$("#courseLSide").height()+45);
|
||||||
})
|
});
|
||||||
</script>
|
|
||||||
<div class="hwork_new">
|
|
||||||
<div id="tb_" class="hwork_tb_">
|
|
||||||
<ul>
|
|
||||||
<li id="tb_1" class="hwork_hovertab" onclick="course_setting(1);" >
|
|
||||||
基本信息
|
|
||||||
</li>
|
|
||||||
<li id="tb_2" class="hwork_normaltab" onclick="course_setting(2);">
|
|
||||||
成员
|
|
||||||
</li>
|
|
||||||
<li id="tb_3" class="hwork_normaltab" onclick="course_setting(3);">
|
|
||||||
组织
|
|
||||||
</li>
|
|
||||||
<li id="tb_4" class="hwork_normaltab" onclick="course_setting(4);">
|
|
||||||
讨论区设置
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
<div class="hwork_dis" id="tbc_01" style="padding-top: 10px;">
|
|
||||||
<ul>
|
|
||||||
<%= labelled_form_for @course do |f| %>
|
|
||||||
<li class="ml45 mb10" id="course_avatar_form">
|
|
||||||
<%= render :partial => "avatar/new_avatar_form", :locals => {source: @course} %>
|
|
||||||
</li>
|
|
||||||
<li class="ml45 mb10">
|
|
||||||
<label><span class="c_red">*</span> <%= l(:label_tags_syllabus_name)%> :</label>
|
|
||||||
<span id="edit_syllabus_id"><%=@course.syllabus.title %></span>
|
|
||||||
<%#= select_tag :syllabus_id,options_for_select(course_syllabus_option,@course.syllabus_id), {:id=>"edit_syllabus_id", :class=>"syllabus_input", :style=>'width:210px'} %>
|
|
||||||
<!--<span class="c_red" id="edit_syllabus_notice">如果列表中没有对应的课程,请您先<%#=link_to '创建课程', new_syllabus_path(),:target => '_blank', :class => 'ml5 green_btn_share c_white'%>,然后【刷新】</span>-->
|
|
||||||
</li>
|
|
||||||
<li class="ml45">
|
|
||||||
<label><span class="c_red">*</span> <%= l(:label_tags_course_name)%> :</label>
|
|
||||||
<input type="text" name="course[name]" id="edit_course_name" autocomplete="off" class="courses_input" maxlength="100" onkeyup="regex_course_name('edit');" value="<%= @course.name%>">
|
|
||||||
<div class="cl"></div>
|
|
||||||
<span class="c_red ml80" id="edit_course_name_notice" style="display: none;">班级名称不能为空</span>
|
|
||||||
</li>
|
|
||||||
<div class="cl"></div>
|
|
||||||
<li class="ml45">
|
|
||||||
<label><span class="c_red">*</span> <%= l(:label_class_period)%> :</label>
|
|
||||||
<input type="text" name="class_period" id="edit_class_period" class="hwork_input02" onkeyup="regex_course_class_period('edit');" maxlength="6" value="<%= @course.class_period%>">
|
|
||||||
<span class="c_red" id="edit_course_class_period_notice" style="display: none;"></span>
|
|
||||||
</li>
|
|
||||||
<div class="cl"></div>
|
|
||||||
<li class="ml45 mb10">
|
|
||||||
<label><span class="c_red">*</span> <%= l(:label_course_term)%> :</label>
|
|
||||||
<%= select_tag :time,options_for_select(course_time_option(@course.time),@course.time), {:id=>"edit_time"} %>
|
|
||||||
<%= select_tag :term,options_for_select(course_term_option,@course.term || cur_course_term),{:id=>"edit_term"} %>
|
|
||||||
</li>
|
|
||||||
<div class="cl"></div>
|
|
||||||
<li class="ml45 mb10">
|
|
||||||
<label><span class="c_red">*</span> 结束学期 :</label>
|
|
||||||
<%= select_tag :end_time,options_for_select(course_time_option(@course.end_time),@course.end_time), {:id=>"edit_end_time"} %>
|
|
||||||
<%= select_tag :end_term,options_for_select(course_term_option,@course.end_term || cur_course_term),{:id=>"edit_end_term"} %>
|
|
||||||
<span class="c_red" id="edit_course_time_term_notice"></span>
|
|
||||||
</li>
|
|
||||||
<div class="cl"></div>
|
|
||||||
<!--<li class="ml45 mb10">
|
|
||||||
<label><span class="c_red">*</span> <%#= l(:label_new_course_password)%> :</label>
|
|
||||||
<input type="password" name="course[password]" id="edit_course_course_password" class="hwork_input02" value="<%#= @course.password%>" onkeyup="regex_course_password('edit');">
|
|
||||||
<a id="psw_btn" href="javascript:void(0)">显示明码</a>
|
|
||||||
<span class="c_red" id="edit_course_course_password_notice"></span>
|
|
||||||
<div class="cl"></div>
|
|
||||||
<span class=" ml80 c_orange">学生或其他成员申请加入课程时候需要使用该口令,该口令可以由老师在课堂上公布。</span>
|
|
||||||
</li>-->
|
|
||||||
<!--<li class="ml45">-->
|
|
||||||
<!--<label class="fl" > <%#= l(:label_new_course_description)%> :</label>-->
|
|
||||||
<!--<textarea name="course[description]" placeholder="最多3000个汉字(或6000个英文字符)" class="courses_text fl" maxlength="6000"><%#= @course.description%></textarea>-->
|
|
||||||
<!--<div class="cl"></div>-->
|
|
||||||
<!--</li>-->
|
|
||||||
<li class=" mb5 ml80">
|
|
||||||
<label >公开 :</label>
|
|
||||||
<input <%= @course.is_public == 1 ? 'checked' : ''%> id="course_is_public" name="course[is_public]" type="checkbox">
|
|
||||||
<span class="c_grey">(选中后对所有用户可见,否则仅对本班级成员可见)</span>
|
|
||||||
<div class="cl"></div>
|
|
||||||
</li>
|
|
||||||
<li class=" mb5 ml30">
|
|
||||||
<label >学生列表公开 :</label>
|
|
||||||
<input <%= @course.open_student == 1 ? 'checked' : ''%> id="course_open_student" name="course[open_student]" type="checkbox" style="margin-left: 1px;"/>
|
|
||||||
<span class="c_grey">(选中后对所有用户可见,否则仅对本班级成员可见)</span>
|
|
||||||
<div class="cl"></div>
|
|
||||||
</li>
|
|
||||||
<li class=" mb5 ml30">
|
|
||||||
<label >学生上传资源 :</label>
|
|
||||||
<input <%= @course.publish_resource == 1 ? 'checked' : ''%> id="course_publish_resource" name="course[publish_resource]" type="checkbox" style="margin-left: 1px;"/>
|
|
||||||
<span class="c_grey">(选中后允许学生上传班级资源,否则不允许)</span>
|
|
||||||
<div class="cl"></div>
|
|
||||||
</li>
|
|
||||||
<li class="mt10 ml90" >
|
|
||||||
<a href="javascript:void(0)" class="blue_btn fl c_white" onclick="submit_edit_course(<%= @course.id%>);" >提交</a>
|
|
||||||
<%= link_to l(:button_cancel), course_path(@course), :class => "grey_btn fl c_white ml10" %>
|
|
||||||
<div class="cl"></div>
|
|
||||||
</li>
|
|
||||||
<% end %>
|
|
||||||
</ul>
|
|
||||||
<% if @course.is_delete == 1 %>
|
|
||||||
<div class="mt30"><%=link_to "恢复该班级", renew_course_path(@course) %></div>
|
|
||||||
<% else %>
|
|
||||||
<div class="mt30">
|
|
||||||
<img src="/images/pic_del.gif" class="mr5"><%=link_to "删除该班级", course_path(@course), :method => :delete, :confirm=>"确认要删除该班级吗?" %>
|
|
||||||
<span>(友情提示:删除该班级后如果您想恢复该班级,请联系系统管理员!)</span>
|
|
||||||
</div>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
</div>
|
function g(o){
|
||||||
|
return document.getElementById(o);
|
||||||
|
}
|
||||||
|
function HoverLi(n){
|
||||||
|
//如果有N个标签,就将i<=N;
|
||||||
|
for(var i=1;i<=4;i++){
|
||||||
|
g('tb_'+i).className='game-setting-nav-nomall';
|
||||||
|
g('tbc_0'+i).className='undis';
|
||||||
|
}
|
||||||
|
g('tb_'+n).className='game-setting-nav-hover';
|
||||||
|
g('tbc_0'+n).className='game-dis';
|
||||||
|
}
|
||||||
|
|
||||||
<div class="hwork_undis" id="tbc_02">
|
|
||||||
<div class="search_course fl">
|
|
||||||
<%= form_tag(search_member_course_path,:id => "course_member_search_form", :method => :get, :class => "search_form_course",:remote => true) do %>
|
|
||||||
<!-- , :onkeyup => "regexQ('#{l(:label_search_conditions_not_null)}');" -->
|
|
||||||
<%= text_field_tag 'name', params[:name], :placeholder => "登录名、学号、姓名搜索", :class => "search_text fl" %>
|
|
||||||
<a href="javascript:void(0)" onclick="submitMemberSerch('<%= l(:label_search_conditions_not_null) %>');" class="search_btn fl f14 c_white ml10" >
|
|
||||||
<%= l(:label_search)%>
|
|
||||||
</a>
|
|
||||||
<br />
|
|
||||||
<span id="course_member_name_span" style="float: left"></span>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="course_members_setting">
|
|
||||||
<%= render :partial => "course_members" %>
|
|
||||||
</div>
|
|
||||||
</div><!---成员结束-->
|
|
||||||
|
|
||||||
<div class="hwork_undis" id="tbc_03">
|
|
||||||
<%= render :partial => 'courses/settings/join_org' %>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="hwork_undis" id="tbc_04">
|
|
||||||
<%= render :partial => 'courses/settings/boards_setting' %>
|
|
||||||
</div>
|
|
||||||
</div><!--talknew end-->
|
|
||||||
<div class="cl"></div>
|
|
||||||
<script type="text/javascript">
|
|
||||||
function select() {
|
function select() {
|
||||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'courses/term_select') %>');
|
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'courses/term_select') %>');
|
||||||
showModal('ajax-modal', '500px');
|
showModal('ajax-modal', '500px');
|
||||||
|
@ -155,7 +67,4 @@
|
||||||
$('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9");
|
$('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9");
|
||||||
$('#ajax-modal').parent().addClass("anonymos");
|
$('#ajax-modal').parent().addClass("anonymos");
|
||||||
}
|
}
|
||||||
//$("#time").click(select);
|
</script>
|
||||||
//$("#term").click(select);
|
|
||||||
</script>
|
|
||||||
</div>
|
|
|
@ -1,12 +1,8 @@
|
||||||
<ul>
|
<ul>
|
||||||
<li><span class="relatedListName fb fl">名称</span><span class="relatedListOption fb fl">操作</span></li>
|
|
||||||
<% orgs.each do |org| %>
|
<% orgs.each do |org| %>
|
||||||
<li>
|
<li class="clear mb5">
|
||||||
<a href="<%= organization_path(org) %>" class="relatedListName linkBlue fl"><%= org.name %></a>
|
<a href="<%= organization_path(org) %>" title="<%= org.name %>" style="max-width: 250px;" class="hidden fl"><%= org.name %></a>
|
||||||
<a href="javascript:void(0);" onclick="cancel_org_course_relation(<%= OrgCourse.where(:organization_id => org.id, :course_id => course_id).first.id %>, '<%= course_id %>');"
|
<a href = "javascript:void(0);" onclick="delete_confirm_box_2('<%= org_course_path(OrgCourse.where(:organization_id => org.id, :course_id => course_id).first.id, :course_id => course_id) %>', '确定取消关联吗?')" class="fr sy_btn_grey_mini ml5" >取消关联</a>
|
||||||
class = "relatedListOption fl linkGrey3">取消关联</a>
|
|
||||||
<%#= link_to "取消关联", org_course_path(:id => OrgCourse.where(:organization_id => org.id, :course_id => course_id).first.id, :course_id => course_id),
|
|
||||||
:method => 'delete',:remote => true, :class => "relatedListOption fl linkGrey3" %>
|
|
||||||
</li>
|
</li>
|
||||||
<% end %>
|
<% end %>
|
||||||
</ul>
|
</ul>
|
|
@ -1,67 +1,59 @@
|
||||||
<% board = @course.boards.where("parent_id is NULL").first %>
|
<% board = @course.boards.where("parent_id is NULL").first %>
|
||||||
<div class="w730 mt10" id="org_subfield_list">
|
<div class="pro_new_setting_conbox" style="width:100%; border:none;">
|
||||||
<ul class="orgListRow borderBottomNone orgListBg">
|
<div class="sy_new_tchbox clear undis" style="margin-left:10px; margin-right:10px;" id="add_sub_board">
|
||||||
<li class="w270 fb fl"><span class="ml15">名称</span></li>
|
<%= form_tag url_for(:controller => 'boards', :action => 'create', :course_id => @course.id, :board_id => board.id), :id=> 'add_board_form_subboard',:remote => true do %>
|
||||||
<li class="w140 fb fl">状态</li>
|
<ul class="pro_newsetting_con mb15">
|
||||||
<li class="w170 fb fl">类型</li>
|
<li>
|
||||||
<li class="w150 fb fl"><span class="mr15 fr">操作</span></li>
|
<label class="fl">新增子栏目名称 : </label>
|
||||||
<div class="cl"></div>
|
<input id="subfield_name" name="name" placeholder="请输入子栏目名称" maxlength="30" class="fl h28" style="width: 420px" type="text">
|
||||||
</ul>
|
<a href="javascript:void(0);" class="fr sy_btn_grey" onclick="$('#add_sub_board').toggle();">取消</a>
|
||||||
<ul class="orgListRow">
|
<a href="javascript:void(0);" class="fr sy_btn_blue mr5" id="subMenuSubmit">保存</a>
|
||||||
<li class="w270 fl"> <span class="ml15">班级讨论区</span> </li>
|
|
||||||
<li class="w140 fl">默认</li>
|
|
||||||
<li class="w170 fl">帖子</li>
|
|
||||||
<li class="w150 fl"> <a href="javascript:void(0)" class="link-blue fr mr15" id="addSubMenu">添加子栏目</a> </li>
|
|
||||||
<div class="cl"></div>
|
|
||||||
<% count = board.children.count %>
|
|
||||||
<% board.children.reorder("position asc").each_with_index do |board, i|%>
|
|
||||||
<ul class="orgSubList" style="border-top: 1px solid rgb(228, 228, 228);">
|
|
||||||
<li class="<%= i == count - 1 ? 'orgSubTree2' : 'orgSubTree' %>"></li>
|
|
||||||
<li class="w210 mr10 fl">
|
|
||||||
<div id="board_sub_show_<%= board.id %>" class="w210 hidden" title="<%=board.name %>"><%=board.name %></div>
|
|
||||||
<div id="board_sub_edit_<%= board.id %>" style="display:none;">
|
|
||||||
<input type="text" name="name" onblur="update_sub_board_name('#board_sub_show_<%= board.id %>','#board_sub_edit_<%= board.id %>','<%= board.id %>','<%= @course.id %>',$(this).val());" value="<%= board.name %>" style="width:140px;"/>
|
|
||||||
</div>
|
|
||||||
</li>
|
|
||||||
<li class="w140 fl">新增</li>
|
|
||||||
<li class="w170 fl">帖子</li>
|
|
||||||
<li class="w150 fl">
|
|
||||||
<a href="javascript:void(0);" class="linkGrey fr ml5 mr15" onclick="edit('#board_sub_show_<%= board.id %>','#board_sub_edit_<%= board.id %>');">编辑</a>
|
|
||||||
<%= link_to('删除', {:controller => 'boards', :action => 'destroy', :id => board.id, :course_id => @course.id},:remote => true, :method => 'delete', :confirm => l(:text_are_you_sure), :class => "linkGrey fr ml5 mr5", :title => l(:button_delete)) %>
|
|
||||||
<% if i < count - 1 %>
|
|
||||||
<%= link_to('下移', {:controller => 'boards', :action => 'update_position', :id => board.id, :course_id => @course.id, :opr => 'down'},:remote => true, :method => 'post', :class => "linkGrey fr ml5 mr5", :title => '下移') %>
|
|
||||||
<% end %>
|
|
||||||
<% unless i == 0 %>
|
|
||||||
<%= link_to('上移', {:controller => 'boards', :action => 'update_position', :id => board.id, :course_id => @course.id, :opr => 'up'},:remote => true, :method => 'post', :class => "linkGrey fr ml5 mr5", :title => '上移') %>
|
|
||||||
<% end %>
|
|
||||||
</li>
|
</li>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
|
<span id="new_notice" class="undis fl c_red">名称不能为空</span>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<% end %>
|
<% end %>
|
||||||
</ul>
|
</div>
|
||||||
|
<div class="clear ml10 mr10">
|
||||||
|
<table class="sy_new_table clearfix mb15" cellpadding="0" cellspacing="0">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>名称</th>
|
||||||
|
<th style="width:280px;">操作</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td class="game-text-left"><span class="ml20"></span>班级讨论区</td>
|
||||||
|
<td class="game-text-right"><a href="javascript:void(0);" class="sy_btn_green mr5" onclick="$('#add_sub_board').toggle();">添加子栏目</a></td>
|
||||||
|
</tr>
|
||||||
|
<% count = board.children.count %>
|
||||||
|
<% board.children.reorder("position asc").each_with_index do |board, i|%>
|
||||||
|
<tr>
|
||||||
|
<td class="game-text-left">
|
||||||
|
<div id="board_sub_show_<%= board.id %>" class="ml40 w350 hidden" title="<%=board.name %>"><%=board.name %></div>
|
||||||
|
<div id="board_sub_edit_<%= board.id %>" style="display:none;" class="ml40">
|
||||||
|
<input type="text" name="name" class="h28 w300" id="board_sub_name_<%=board.id %>" maxlength="30"
|
||||||
|
onblur="update_sub_board_name('#board_sub_show_<%= board.id %>','#board_sub_edit_<%= board.id %>','<%= board.id %>','<%= @course.id %>',$(this).val());" value="<%= board.name %>"/>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td class="game-text-right">
|
||||||
|
<% unless i == 0 %>
|
||||||
|
<%= link_to('上移', {:controller => 'boards', :action => 'update_position', :id => board.id, :course_id => @course.id, :opr => 'up'},:remote => true, :method => 'post', :class => "sy_btn_blue mr5", :title => '上移') %>
|
||||||
|
<% end %>
|
||||||
|
<% if i < count - 1 %>
|
||||||
|
<%= link_to('下移', {:controller => 'boards', :action => 'update_position', :id => board.id, :course_id => @course.id, :opr => 'down'},:remote => true, :method => 'post', :class => "sy_btn_blue mr5", :title => '下移') %>
|
||||||
|
<% end %>
|
||||||
|
<a href="javascript:void(0);" class="sy_btn_blue mr5" onclick="edit('#board_sub_show_<%= board.id %>','#board_sub_edit_<%= board.id %>');">编辑</a>
|
||||||
|
<a href="javascript:void(0);" class="sy_btn_blue mr5" onclick="delete_confirm_box_2('<%=course_board_path(board, :course_id => @course.id) %>', '确定要删除<%=board.name %>吗?')">删除</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<% end %>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!--新增二级栏目-->
|
|
||||||
<div class="mt10 fl orgListBg w730 undis" id="subMenuContent">
|
|
||||||
<%= form_tag url_for(:controller => 'boards', :action => 'create', :course_id => @course.id, :board_id => board.id), :id=> 'add_board_form_subboard',:remote => true do %>
|
|
||||||
<div class="ml15 mt10">
|
|
||||||
<span class="fontGrey3 mb5 mr10">新增子栏目名称 :</span>
|
|
||||||
<input id="subfield_name" name="name" placeholder="请输入子栏目名称" maxlength="30" class="orgAddSearch mb10" type="text">
|
|
||||||
<span id="new_notice" class="undis ml10">名称不能为空</span>
|
|
||||||
</div>
|
|
||||||
<div class="mb10">
|
|
||||||
<span class="fontGrey3 ml50 mr15 fl">栏目类型 :</span>
|
|
||||||
<input class="mr5" id="orgMng" value="Post" name="field_type" checked="checked" type="radio">
|
|
||||||
<label for="orgMng">帖子</label>
|
|
||||||
</div>
|
|
||||||
<div class="mb10">
|
|
||||||
<a href="javascript:void(0);" class="grey_btn_cir fr c_white mr15 ml15" id="subMenuCancel">取消</a>
|
|
||||||
<a href="javascript:void(0);" class="blue_btn_cir fr c_white" id="subMenuSubmit">确定</a>
|
|
||||||
<div class="cl"></div>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
|
||||||
<!--over-->
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
$(function(){
|
$(function(){
|
||||||
|
@ -80,28 +72,31 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$("#addSubMenu").click(function(){
|
|
||||||
$("#subMenuContent").toggle();
|
|
||||||
});
|
|
||||||
$("#subMenuCancel").click(function(){
|
|
||||||
$("#subMenuContent").hide();
|
|
||||||
});
|
|
||||||
|
|
||||||
function update_sub_board_name(show_id, edit_id, field_id, domain_id, input_value) {
|
function update_sub_board_name(show_id, edit_id, field_id, domain_id, input_value) {
|
||||||
if (input_value.trim() != "" && $(show_id).html().trim() != input_value.trim()) {
|
if (input_value.trim() != "" && $(show_id).html().trim() != input_value.trim()) {
|
||||||
if (confirm('确定修改为' + input_value + "?"))
|
var htmlvalue = '<div id="muban_popup_box" style="width:300px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
|
||||||
$.ajax({
|
'<div class="clear mt15"><p class="text_c f16 fontGrey7">确定修改为' + input_value + '?</p><div class="cl"></div><a href="javascript:void(0)" class="fr sy_btn_blue mt10"' +
|
||||||
url: "/boards/" + field_id + "/update_name?course_id=" + domain_id + "&name=" + input_value,
|
' style="margin-right: 92px;" onclick="update_confirm(1,' + field_id + ',' + domain_id + ');">确定</a>'+
|
||||||
type: 'put'
|
'<a href="javascript:void(0);" class="fr sy_btn_grey mt10 mr10" onclick="update_confirm(2,' + field_id + ',' + domain_id + ');">取消</a></div></div>';
|
||||||
});
|
pop_box_new(htmlvalue, 300, 140);
|
||||||
else{
|
|
||||||
$(edit_id).children("input").val($(show_id).html().trim());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
$(show_id).show();
|
$(show_id).show();
|
||||||
$(edit_id).hide();
|
$(edit_id).hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function update_confirm(type, field_id, domain_id){
|
||||||
|
if(type == 1){
|
||||||
|
$.ajax({
|
||||||
|
url: "/boards/" + field_id + "/update_name?course_id=" + domain_id + "&name=" + $("#board_sub_name_"+field_id).val(),
|
||||||
|
type: 'put'
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
hideModal();
|
||||||
|
$("#board_sub_edit_"+field_id).children("input").val($("#board_sub_show_"+field_id).html().trim());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function edit(show_id, edit_id) {
|
function edit(show_id, edit_id) {
|
||||||
$(show_id).toggle();
|
$(show_id).toggle();
|
||||||
$(edit_id).toggle();
|
$(edit_id).toggle();
|
||||||
|
|
|
@ -0,0 +1,90 @@
|
||||||
|
<table class="sy_new_table clearfix mb15" cellpadding="0" cellspacing="0">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th style="width: 35px;">序号</th>
|
||||||
|
<th style="width:180px;">姓名</th>
|
||||||
|
<th style="width:140px;">学号</th>
|
||||||
|
<th>角色</th>
|
||||||
|
<th class="sy_new_namebox">操作</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<% @members.each_with_index do |member, index| %>
|
||||||
|
<tr>
|
||||||
|
<td><%= index + 1 %></td>
|
||||||
|
<td>
|
||||||
|
<%= link_to member.user.show_name, user_path(member.user), :class => "pro_new_idname ml10 mr10", :title => "#{member.user.show_name}" %>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<span class="pro_new_school_name ml5 mr5"><%=member.user.user_extensions.student_id %></span>
|
||||||
|
</td>
|
||||||
|
<td style="width: 200px">
|
||||||
|
<span id="member_role_<%=member.id %>"><%= zh_course_role(h member.roles.sort.collect(&:to_s).join(', ')) %></span>
|
||||||
|
<%= form_for(member, {:as => :membership, :remote => true, :url => membership_path(member),
|
||||||
|
:method => :put,
|
||||||
|
:html => {:id => "member-#{member.id}-roles-form", :class => 'hol'}}
|
||||||
|
) do |f| %>
|
||||||
|
<ul class="clear ml15">
|
||||||
|
<script>
|
||||||
|
$(function() {
|
||||||
|
$("#edit_member_role_<%=member.id %>_7").on('click', function(){
|
||||||
|
if($("#edit_member_role_<%=member.id %>_7").is(":checked")) {
|
||||||
|
$("#edit_member_role_<%=member.id %>_9").attr("checked",false);
|
||||||
|
$("#edit_member_role_<%=member.id %>_9").attr('disabled', 'disabled');
|
||||||
|
} else {
|
||||||
|
$("#edit_member_role_<%=member.id %>_9").removeAttr('disabled');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
$("#edit_member_role_<%=member.id %>_9").on('click', function(){
|
||||||
|
if($("#edit_member_role_<%=member.id %>_9").is(":checked")) {
|
||||||
|
$("#edit_member_role_<%=member.id %>_7").attr('disabled', 'disabled');
|
||||||
|
$("#edit_member_role_<%=member.id %>_7").attr("checked",false);
|
||||||
|
} else {
|
||||||
|
$("#edit_member_role_<%=member.id %>_7").removeAttr('disabled');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<% @roles.each do |role| %>
|
||||||
|
<li class="fl mr5">
|
||||||
|
<!--<label style="width: 54px;">-->
|
||||||
|
<%= check_box_tag 'membership[role_ids][]', role.id, member.roles.include?(role), :id => "edit_member_role_#{member.id}_#{role.id}",
|
||||||
|
:disabled => member.member_roles.detect {|mr| mr.role_id == role.id && !mr.inherited_from.nil?}, :class => "mt6 fl h28" %>
|
||||||
|
<p class="fl ml5"><%= zh_course_role(h role) %></p>
|
||||||
|
<!--</label>-->
|
||||||
|
</li>
|
||||||
|
<% end %>
|
||||||
|
<%= hidden_field_tag 'membership[role_ids][]', '' %>
|
||||||
|
</ul>
|
||||||
|
<% end %>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<% unless member.user == @course.teacher %>
|
||||||
|
<a href="javascript:void(0)" class="sy_btn_blue mr5" onclick="edit_member($(this), <%=member.id %>);">编辑</a>
|
||||||
|
<a href="javascript:void(0)" class="sy_btn_blue mr5" style="display: none;" onclick="$('#member-<%= member.id%>-roles-form').submit();">保存</a>
|
||||||
|
<a href="javascript:void(0)" class="sy_btn_grey mr5" style="display: none;" onclick="cancel_edit($(this), <%=member.id %>);">取消</a>
|
||||||
|
<a href="javascript:void(0)" class="sy_btn_grey mr5" id="delete_member_<%=member.id %>" onclick="delete_confirm_box_2('<%=membership_path(member) %>', '<%= l(:label_delete_confirm)%>')">删除</a>
|
||||||
|
<% end %>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<% end %>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<script>
|
||||||
|
function edit_member(div, id){
|
||||||
|
$('#member_role_' + id).hide();
|
||||||
|
$('#member-' + id + '-roles-form').show();
|
||||||
|
$(div).next().show();
|
||||||
|
$(div).next().next().show();
|
||||||
|
$('#delete_member_' + id).hide();
|
||||||
|
$(div).hide();
|
||||||
|
}
|
||||||
|
function cancel_edit(div, id){
|
||||||
|
$('#member_role_' + id).show();
|
||||||
|
$('#member-' + id + '-roles-form').hide();
|
||||||
|
$(div).prev().hide();
|
||||||
|
$(div).prev().prev().show();
|
||||||
|
$('#delete_member_' + id).show();
|
||||||
|
$(div).hide();
|
||||||
|
}
|
||||||
|
</script>
|
|
@ -0,0 +1,72 @@
|
||||||
|
<ul>
|
||||||
|
<%= labelled_form_for @course do |f| %>
|
||||||
|
<li class="ml45 mb10" id="course_avatar_form">
|
||||||
|
<%= render :partial => "avatar/new_avatar_form", :locals => {source: @course} %>
|
||||||
|
</li>
|
||||||
|
<li class="ml45 mb10">
|
||||||
|
<label><span class="c_red">*</span> <%= l(:label_tags_syllabus_name)%> :</label>
|
||||||
|
<span id="edit_syllabus_id"><%=@course.syllabus.title %></span>
|
||||||
|
<%#= select_tag :syllabus_id,options_for_select(course_syllabus_option,@course.syllabus_id), {:id=>"edit_syllabus_id", :class=>"syllabus_input", :style=>'width:210px'} %>
|
||||||
|
<!--<span class="c_red" id="edit_syllabus_notice">如果列表中没有对应的课程,请您先<%#=link_to '创建课程', new_syllabus_path(),:target => '_blank', :class => 'ml5 green_btn_share c_white'%>,然后【刷新】</span>-->
|
||||||
|
</li>
|
||||||
|
<li class="ml45">
|
||||||
|
<label><span class="c_red">*</span> <%= l(:label_tags_course_name)%> :</label>
|
||||||
|
<input type="text" name="course[name]" id="edit_course_name" autocomplete="off" class="courses_input" maxlength="100" onkeyup="regex_course_name('edit');" value="<%= @course.name%>">
|
||||||
|
<div class="cl"></div>
|
||||||
|
<span class="c_red ml80" id="edit_course_name_notice" style="display: none;">班级名称不能为空</span>
|
||||||
|
</li>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<li class="mb5 fontGrey3" style="margin-left: 125px;"><span class="success-icon mr25">正确示例:软件工程计算机系2016秋季A班</span></li>
|
||||||
|
<li class="mb10 fontGrey3" style="margin-left: 125px;"><span class="error-icon">错误示例:计算机系2016秋季A班</span></li>
|
||||||
|
<li class="ml45">
|
||||||
|
<label><span class="c_red">*</span> <%= l(:label_class_period)%> :</label>
|
||||||
|
<input type="text" name="class_period" id="edit_class_period" class="hwork_input02 w290" onkeyup="regex_course_class_period('edit');" maxlength="6" value="<%= @course.class_period%>">
|
||||||
|
<span class="c_red" id="edit_course_class_period_notice" style="display: none;"></span>
|
||||||
|
</li>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<li class="ml45 mb10">
|
||||||
|
<label><span class="c_red">*</span> <%= l(:label_course_term)%> :</label>
|
||||||
|
<%= select_tag :time,options_for_select(course_time_option(@course.time),@course.time), {:id=>"edit_time", :class => "h28 w145 mr8"} %>
|
||||||
|
<%= select_tag :term,options_for_select(course_term_option,@course.term || cur_course_term),{:id=>"edit_term", :class => "h28 w145"} %>
|
||||||
|
</li>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<li class="ml45 mb10">
|
||||||
|
<label><span class="c_red">*</span> 结束学期 :</label>
|
||||||
|
<%= select_tag :end_time,options_for_select(course_time_option(@course.end_time),@course.end_time), {:id=>"edit_end_time", :class => "h28 w145 mr8"} %>
|
||||||
|
<%= select_tag :end_term,options_for_select(course_term_option,@course.end_term || cur_course_term),{:id=>"edit_end_term", :class => "h28 w145"} %>
|
||||||
|
<span class="c_red" id="edit_course_time_term_notice"></span>
|
||||||
|
</li>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<li class=" mb5 ml80">
|
||||||
|
<label >公开 :</label>
|
||||||
|
<input <%= @course.is_public == 1 ? 'checked' : ''%> id="course_is_public" name="course[is_public]" type="checkbox">
|
||||||
|
<span class="c_grey">(选中后对所有用户可见,否则仅对本班级成员可见)</span>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</li>
|
||||||
|
<li class=" mb5 ml30">
|
||||||
|
<label >学生列表公开 :</label>
|
||||||
|
<input <%= @course.open_student == 1 ? 'checked' : ''%> id="course_open_student" name="course[open_student]" type="checkbox" style="margin-left: 1px;"/>
|
||||||
|
<span class="c_grey">(选中后对所有用户可见,否则仅对本班级成员可见)</span>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</li>
|
||||||
|
<li class=" mb5 ml30">
|
||||||
|
<label >学生上传资源 :</label>
|
||||||
|
<input <%= @course.publish_resource == 1 ? 'checked' : ''%> id="course_publish_resource" name="course[publish_resource]" type="checkbox" style="margin-left: 1px;"/>
|
||||||
|
<span class="c_grey">(选中后允许学生上传班级资源,否则不允许)</span>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</li>
|
||||||
|
<li class="mt10" style="margin-left: 125px;">
|
||||||
|
<a href="javascript:void(0)" class="blue_btn fl c_white" onclick="submit_edit_course(<%= @course.id%>);" >提交</a>
|
||||||
|
<%= link_to l(:button_cancel), course_path(@course), :class => "grey_btn fl c_white ml10" %>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</li>
|
||||||
|
<% end %>
|
||||||
|
</ul>
|
||||||
|
<% if @course.is_delete == 1 %>
|
||||||
|
<div class="mt30 ml30"><%=link_to "恢复该班级", renew_course_path(@course) %></div>
|
||||||
|
<% else %>
|
||||||
|
<div class="mt30 ml30">
|
||||||
|
<img src="/images/pic_del.gif" class="mr5"><%=link_to "删除该班级", course_path(@course), :method => :delete, :confirm=>"确认要删除该班级吗?" %>
|
||||||
|
<span>(友情提示:删除该班级后如果您想恢复该班级,请联系系统管理员!)</span>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
|
@ -1,85 +1,84 @@
|
||||||
<!--<div class="members_left">-->
|
|
||||||
<!--<input type="text" id="orgs_not_course_member_search" name="orgAddSearch" placeholder="支持姓名、邮箱、昵称搜索" class="orgAddSearch mb20" />-->
|
|
||||||
<!--<%#= javascript_tag "observeSearchfield('orgs_not_course_member_search', null, '#{ escape_javascript autocomplete_search_organizations_path(:course_id=> @course.id, :format => 'js') }')" %>-->
|
|
||||||
<!--<div id="new_orgs_for_course">-->
|
|
||||||
|
|
||||||
<!--</div>-->
|
|
||||||
<!--</div>-->
|
|
||||||
<%= stylesheet_link_tag 'css/org' %>
|
<%= stylesheet_link_tag 'css/org' %>
|
||||||
|
|
||||||
<div>
|
<% if @orgs_not_in_course.empty? && @course.organizations.empty? %>
|
||||||
<div class="relateOrg fl">
|
<div class="icons_tishi"><img src="/images/new_project/icons_smile.png" width="110" height="110" alt="" ></div>
|
||||||
<span class="pic_add fl mr5 mt3"></span><span class="f14 fontBlue fl">关联组织</span>
|
<p class="sy_tab_con_p">您没有创建组织,请先 <%=link_to '新建组织', new_organization_path, :class => 'sy_btn_green', :target => '_blank' %>,再关联</p>
|
||||||
<div class="cl mb5"></div>
|
<% else %>
|
||||||
<%= form_tag url_for(:controller => 'org_courses', :action => 'create', :course_id => @course.id), :id => 'join_orgs_for_course', :remote => true do %>
|
<div class="sy_new_tchbox clear mt10">
|
||||||
<input type="text" name="orgs" class="searchOrg mb5 ml20" placeholder="请输入组织名称" />
|
<div class="course_setting_org_fl fl">
|
||||||
<div id="search_orgs_result_list" class="ml20"></div>
|
<h3 class="mb10 fl" style="color: #8f8f8f;">关联组织</h3>
|
||||||
<ul id="paginator" class="wlist ml20" style="float:none;"></ul>
|
<div class="cl mb5"></div>
|
||||||
<a href="javascript:void(0);" class="saveBtn db fl ml20 mr15 mt5" onclick="course_join_org(<%= @course.id %>);">关联</a>
|
<%= form_tag url_for(:controller => 'org_courses', :action => 'create', :course_id => @course.id), :id => 'join_orgs_for_course', :remote => true do %>
|
||||||
<a href="javascript:void(0);" class="org-cancel-btn db fl mt5" onclick="cancel_join_orgs();">取消</a>
|
<input type="text" name="orgs" class="sy_new_search" style="height: 28px; width: 300px;" placeholder="请输入组织名称" />
|
||||||
<% end %>
|
<div class="cl mb5"></div>
|
||||||
</div>
|
<div id="search_orgs_result_list" ></div>
|
||||||
<div class="relatedList fr">
|
<ul id="paginator" class="wlist ml20" style="float:none;"></ul>
|
||||||
<div class="fr mr15">
|
<a href="javascript:void(0);" class="fl sy_btn_blue mr5" onclick="course_join_org(<%= @course.id %>);">关联</a>
|
||||||
<span class="f14 fontBlue">已关联组织</span>
|
<a href="javascript:void(0);" class="fl sy_btn_grey mr5" onclick="cancel_join_orgs();">取消</a>
|
||||||
<div id="added_orgs">
|
|
||||||
<%= render :partial => 'courses/settings/added_orgs', :locals => {:orgs => @course.organizations, :course_id => params[:id]} %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div class="course_setting_org_fr fr">
|
||||||
</div>
|
<h3 class="mb20" style="color: #8f8f8f;">已关联组织</h3>
|
||||||
|
<ul>
|
||||||
|
<div id="added_orgs">
|
||||||
|
<%= render :partial => 'courses/settings/added_orgs', :locals => {:orgs => @course.organizations, :course_id => @course.id} %>
|
||||||
|
</div>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var lastSearchCondition = '';
|
var lastSearchCondition = '';
|
||||||
var page = 1;
|
var page = 1;
|
||||||
var count = 0;
|
var count = 0;
|
||||||
var maxPage = 0;
|
var maxPage = 0;
|
||||||
function search_orgs(e){
|
function search_orgs(e){
|
||||||
if($(e.target).val().trim() == lastSearchCondition && lastSearchCondition != '')
|
if($(e.target).val().trim() == lastSearchCondition && lastSearchCondition != '')
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
lastSearchCondition = $(e.target).val().trim();
|
|
||||||
page = 1;
|
|
||||||
$.ajax({
|
|
||||||
url: '<%= url_for(:controller => 'courses', :action => 'search_public_orgs_not_in_course') %>'+'?name='+ e.target.value+'&page='+page,
|
|
||||||
type:'get'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function throttle(method,context,e){
|
|
||||||
clearTimeout(method.tId);
|
|
||||||
method.tId=setTimeout(function(){
|
|
||||||
method.call(context,e);
|
|
||||||
},500);
|
|
||||||
}
|
|
||||||
|
|
||||||
//查询组织
|
|
||||||
$("input[name='orgs']").on('input', function (e) {
|
|
||||||
throttle(search_orgs,window,e);
|
|
||||||
});
|
|
||||||
|
|
||||||
$(document).ready(function(){
|
|
||||||
$.ajax({
|
|
||||||
url: '<%= url_for(:controller => 'courses', :action => 'search_public_orgs_not_in_course') %>'+'?page=1',
|
|
||||||
type:'get'
|
|
||||||
});
|
|
||||||
});
|
|
||||||
function cancel_join_orgs() {
|
|
||||||
$("#join_orgs_for_course input:checked").attr("checked", false);
|
|
||||||
}
|
|
||||||
function course_join_org(courseId) {
|
|
||||||
$.ajax({
|
|
||||||
url: "/org_courses?" + $("#join_orgs_for_course").serialize() + "&course_id=" + courseId,
|
|
||||||
type: "post",
|
|
||||||
success: function (data) {
|
|
||||||
$.ajax({
|
|
||||||
url: "/courses/" + courseId + "/search_public_orgs_not_in_course?hint_flag=true&name=" + $("input[name='orgs']").val().trim(),
|
|
||||||
type: "get"
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
lastSearchCondition = $(e.target).val().trim();
|
||||||
|
page = 1;
|
||||||
|
$.ajax({
|
||||||
|
url: '<%= url_for(:controller => 'courses', :action => 'search_public_orgs_not_in_course') %>'+'?name='+ e.target.value+'&page='+page,
|
||||||
|
type:'get'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function throttle(method,context,e){
|
||||||
|
clearTimeout(method.tId);
|
||||||
|
method.tId=setTimeout(function(){
|
||||||
|
method.call(context,e);
|
||||||
|
},500);
|
||||||
|
}
|
||||||
|
|
||||||
|
//查询组织
|
||||||
|
$("input[name='orgs']").on('input', function (e) {
|
||||||
|
throttle(search_orgs,window,e);
|
||||||
});
|
});
|
||||||
}
|
|
||||||
</script>
|
$(document).ready(function(){
|
||||||
|
$.ajax({
|
||||||
|
url: '<%= url_for(:controller => 'courses', :action => 'search_public_orgs_not_in_course') %>'+'?page=1',
|
||||||
|
type:'get'
|
||||||
|
});
|
||||||
|
});
|
||||||
|
function cancel_join_orgs() {
|
||||||
|
$("#join_orgs_for_course input:checked").attr("checked", false);
|
||||||
|
}
|
||||||
|
function course_join_org(courseId) {
|
||||||
|
$.ajax({
|
||||||
|
url: "/org_courses?" + $("#join_orgs_for_course").serialize() + "&course_id=" + courseId,
|
||||||
|
type: "post",
|
||||||
|
success: function (data) {
|
||||||
|
$.ajax({
|
||||||
|
url: "/courses/" + courseId + "/search_public_orgs_not_in_course?hint_flag=true&name=" + $("input[name='orgs']").val().trim(),
|
||||||
|
type: "get"
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<% end %>
|
|
@ -0,0 +1,67 @@
|
||||||
|
<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_course_member();">添加成员</a>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<div class=" sy_new_tchbox clear undis" style="margin-left:10px; margin-right:10px" id="add_course_member">
|
||||||
|
<%= form_for(@member, {:as => :membership, :url => course_memberships_path(@course), :remote => true, :method => :post}) 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 autocomplete_course_memberships_path(@course, :format => 'js',:flag => true) }')" %>
|
||||||
|
<%#= 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">
|
||||||
|
<%= render_principals_for_new_course_members(@course) %>
|
||||||
|
</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="9" id="add_member_checkbox_9">
|
||||||
|
<p class="fl ml5"> 教师</p>
|
||||||
|
</label>
|
||||||
|
</li>
|
||||||
|
<li class="clear ">
|
||||||
|
<label>
|
||||||
|
<input type="checkbox" class="mt2 fl h28" name="membership[role_ids][]" value="7" id="add_member_checkbox_7">
|
||||||
|
<p class="fl ml5"> 助教</p>
|
||||||
|
</label>
|
||||||
|
</li>
|
||||||
|
<li class="clear ">
|
||||||
|
<label>
|
||||||
|
<input type="checkbox" class="mt2 fl h28" name="membership[role_ids][]" value="10" id="add_member_checkbox_10">
|
||||||
|
<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_course_member").hide();'>取消</a>
|
||||||
|
<a href="javascript:void(0);" class="fr sy_btn_blue mr5" onclick="$('#new_membership').submit();">保存</a>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="clear ml10 mr10">
|
||||||
|
<%= render :partial => 'courses/settings/course_member' %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
function add_course_member(){
|
||||||
|
$("#add_course_member").toggle();
|
||||||
|
}
|
||||||
|
$(function() {
|
||||||
|
$("#add_member_checkbox_7").on('click', function(){
|
||||||
|
if($("#add_member_checkbox_7").is(":checked")) {
|
||||||
|
$("#add_member_checkbox_9").attr('disabled', 'disabled');
|
||||||
|
} else {
|
||||||
|
$("#add_member_checkbox_9").removeAttr('disabled');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
$("#add_member_checkbox_9").on('click', function(){
|
||||||
|
if($("#add_member_checkbox_9").is(":checked")) {
|
||||||
|
$("#add_member_checkbox_7").attr('disabled', 'disabled');
|
||||||
|
} else {
|
||||||
|
$("#add_member_checkbox_7").removeAttr('disabled');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
|
@ -19,7 +19,7 @@
|
||||||
<%= javascript_heads %>
|
<%= javascript_heads %>
|
||||||
<%= heads_for_theme %>
|
<%= heads_for_theme %>
|
||||||
<%= call_hook :view_layouts_base_html_head %>
|
<%= call_hook :view_layouts_base_html_head %>
|
||||||
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','css/common','css/public', 'css/structure','prettify', 'css/courses','css/popup','sy_public','syllabus', 'css/moduel'%>
|
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','css/common','css/public', 'css/structure','prettify', 'css/courses','css/popup','sy_public','syllabus', 'css/moduel','css/contest'%>
|
||||||
<%= javascript_include_tag "course","avatars","header","attachments",'prettify' %>
|
<%= javascript_include_tag "course","avatars","header","attachments",'prettify' %>
|
||||||
<!-- page specific tags -->
|
<!-- page specific tags -->
|
||||||
<%= yield :header_tags -%>
|
<%= yield :header_tags -%>
|
||||||
|
|
|
@ -9,12 +9,12 @@
|
||||||
<% end%>
|
<% end%>
|
||||||
<%elsif @course%>
|
<%elsif @course%>
|
||||||
<% if @create_member_error_messages%>
|
<% if @create_member_error_messages%>
|
||||||
alert("<%= @create_member_error_messages%>");
|
notice_box("<%= @create_member_error_messages%>");
|
||||||
<% else%>
|
<% else%>
|
||||||
$('#course_members_setting').html('<%= escape_javascript(render :partial => 'courses/course_members') %>');
|
$('#tbc_02').html('<%= escape_javascript(render :partial => 'courses/settings/member') %>');
|
||||||
$("#teacher_number").html("<%= searchTeacherAndAssistant(@course).count %>");
|
$("#teacher_number").html("<%= searchTeacherAndAssistant(@course).count %>");
|
||||||
$("#student_number").html("<%= studentCount(@course) %>");
|
$("#student_number").html("<%= studentCount(@course) %>");
|
||||||
alert("添加成功");
|
notice_box("添加成功");
|
||||||
<% end%>
|
<% end%>
|
||||||
hideOnLoad();
|
hideOnLoad();
|
||||||
<%end%>
|
<%end%>
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
$("#project_members_number").html("<%= @project.members.count %>");
|
$("#project_members_number").html("<%= @project.members.count %>");
|
||||||
// $('#tab-content-members').html('<%#= escape_javascript(render :partial => 'projects/settings/members') %>');
|
// $('#tab-content-members').html('<%#= escape_javascript(render :partial => 'projects/settings/members') %>');
|
||||||
<%elsif @course%>
|
<%elsif @course%>
|
||||||
$('#course_members_setting').html('<%= escape_javascript(render :partial => 'courses/course_members') %>');
|
$('#tbc_02').html('<%= escape_javascript(render :partial => 'courses/settings/member') %>');
|
||||||
$("#teacher_number").html("<%= searchTeacherAndAssistant(@course).count %>")
|
$("#teacher_number").html("<%= searchTeacherAndAssistant(@course).count %>")
|
||||||
$("#student_number").html("<%= studentCount(@course) %>");
|
$("#student_number").html("<%= studentCount(@course) %>");
|
||||||
<%end%>
|
<%end%>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<%if @project%>
|
<%if @project%>
|
||||||
$('#pro_st_tbc_03').html('<%= escape_javascript(render :partial => 'projects/settings/new_members') %>');
|
$('#pro_st_tbc_03').html('<%= escape_javascript(render :partial => 'projects/settings/new_members') %>');
|
||||||
<%elsif @course%>
|
<%elsif @course%>
|
||||||
$('#course_members_setting').html('<%= escape_javascript(render :partial => 'courses/course_members') %>');
|
$('#tbc_02').html('<%= escape_javascript(render :partial => 'courses/settings/member') %>');
|
||||||
$("#teacher_number").html("<%= searchTeacherAndAssistant(@course).count %>")
|
$("#teacher_number").html("<%= searchTeacherAndAssistant(@course).count %>")
|
||||||
$("#student_number").html("<%= studentCount(@course) %>");
|
$("#student_number").html("<%= studentCount(@course) %>");
|
||||||
<%end%>
|
<%end%>
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
$("#added_orgs").html("");
|
hideModal();
|
||||||
$("#added_orgs").html('<%= escape_javascript(render :partial => "courses/settings/added_orgs", :locals => {:orgs => @course.organizations, :course_id => @course.id}) %>');
|
$("#tbc_03").html('<%= escape_javascript(render :partial => "courses/settings/join_org") %>');
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -217,6 +217,7 @@ h4{ font-size:14px;}/*color:#3b3b3b;*/
|
||||||
.mt30{ margin-top: 30px;}
|
.mt30{ margin-top: 30px;}
|
||||||
.mt35 {margin-top:35px;}
|
.mt35 {margin-top:35px;}
|
||||||
.mt40{ margin-top: 40px;}
|
.mt40{ margin-top: 40px;}
|
||||||
|
.mt45{ margin-top: 45px;}
|
||||||
.mt50{ margin-top:50px;}
|
.mt50{ margin-top:50px;}
|
||||||
.mt100{ margin-top:100px;}
|
.mt100{ margin-top:100px;}
|
||||||
.mb0 {margin-bottom: 0px !important;}
|
.mb0 {margin-bottom: 0px !important;}
|
||||||
|
@ -276,6 +277,7 @@ h4{ font-size:14px;}/*color:#3b3b3b;*/
|
||||||
.w270{ width: 270px;}
|
.w270{ width: 270px;}
|
||||||
.w280{ width:280px;}
|
.w280{ width:280px;}
|
||||||
.w289{ width:289px !important;}
|
.w289{ width:289px !important;}
|
||||||
|
.w290{ width:290px !important;}
|
||||||
.w300{ width:300px !important;}
|
.w300{ width:300px !important;}
|
||||||
.w305{ width:305px;}
|
.w305{ width:305px;}
|
||||||
.w350 {width:350px;}
|
.w350 {width:350px;}
|
||||||
|
|
|
@ -605,4 +605,28 @@ a:hover.ex_icon_edit{ background:url(/images/course/icons.png) -21px -276px no-
|
||||||
.archive_course_notice em {display:block; border-width:10px; position:absolute;top:26px; left:-20px; border-style:dashed solid dashed dashed; border-color:transparent #eaeaea transparent transparent; font-size:0; line-height:0;}
|
.archive_course_notice em {display:block; border-width:10px; position:absolute;top:26px; left:-20px; border-style:dashed solid dashed dashed; border-color:transparent #eaeaea transparent transparent; font-size:0; line-height:0;}
|
||||||
.archive_course_notice span {display:block; border-width:10px; position:absolute;top:26px; left:-18px; border-style:dashed solid dashed dashed; border-color:transparent #fff transparent transparent; font-size:0; line-height:0;}
|
.archive_course_notice span {display:block; border-width:10px; position:absolute;top:26px; left:-18px; border-style:dashed solid dashed dashed; border-color:transparent #fff transparent transparent; font-size:0; line-height:0;}
|
||||||
|
|
||||||
.teacher_member_img{width:50px; height:50px; border: 1px solid #fff;-webkit-border-radius:50px;-moz-border-radius:50px;-o-border-radius:50px;border-radius:50px;}
|
.teacher_member_img{width:50px; height:50px; border: 1px solid #fff;-webkit-border-radius:50px;-moz-border-radius:50px;-o-border-radius:50px;border-radius:50px;}
|
||||||
|
|
||||||
|
/* 设置页的头像更换 */
|
||||||
|
.banner-course-avatar { width: 64px; height: 62px; position: relative; overflow: hidden;}
|
||||||
|
.banner-course-inner {
|
||||||
|
display: block;
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
top: 100%;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
background: #000;
|
||||||
|
text-align: center;
|
||||||
|
opacity: 0.3;
|
||||||
|
-moz-transition: top ease 200ms;
|
||||||
|
-o-transition: top ease 200ms;
|
||||||
|
-webkit-transition: top ease 200ms;
|
||||||
|
transition: top ease 200ms;
|
||||||
|
}
|
||||||
|
a.banner-course-notice {position: absolute; font-size: 12px; line-height: 20px; top: 102px; left: 10px; color: #fff;}
|
||||||
|
.banner-course-avatar:hover .banner-course-inner { top: 0;}
|
||||||
|
.banner-course-avatar:hover .banner-course-notice { top: 20px;}
|
||||||
|
|
||||||
|
.course_setting_org_fl {width: 49%; border-right: 1px solid #e5e5e5;}
|
||||||
|
.course_setting_org_fr {width: 49%;}
|
Loading…
Reference in New Issue