加入班级时的提示修改

This commit is contained in:
cxt 2016-11-17 11:10:48 +08:00
parent efd0bf6707
commit 6c8736bea8
1 changed files with 69 additions and 34 deletions

View File

@ -1,52 +1,87 @@
<% if @object_id && @state != 6 && @state !=4 %>
$("#join_in_course_header").html("<%= escape_javascript(join_in_course_header(@course, @user)) %>");
<% end %>
<%# if @object_id && @state != 6 && @state !=4 %>
//$("#join_in_course_header").html("<%#= escape_javascript(join_in_course_header(@course, @user)) %>");
<%# end %>
<% if @state %>
<% if @state == 0 %>
alert("加入成功");
hideModal();
$("#try_join_course_link").replaceWith("<a href='<%=url_for(:controller => 'homework_common', :action => 'index',:course=>@course.id, :host=>Setting.host_course)%>' target='_blank' class='blue_n_btn fr mt20'>提交作品</a>");
window.location.href= "<%= Setting.protocol%>://"+"<%= Setting.host_name%>"+"/courses/" + "<%= @course.id%>"
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>'+
'<div class="clear mt15"><p class="text_c f14">加入成功</p><div class="cl"></div>'+
'<a href="javascript:void(0);" class="fr sy_btn_grey mt10" style="margin-right: 119px;" onclick="refresh_current_course();">确&nbsp;&nbsp;定</a></div></div>';
pop_box_new(htmlvalue, 300, 140);
<% elsif @state == 1 %>
alert("密码错误");
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>'+
'<div class="clear mt15"><p class="text_c f14">密码错误</p><div class="cl"></div>'+
'<a href="javascript:void(0);" class="fr sy_btn_grey mt10" style="margin-right: 119px;" onclick="hideModal();">确&nbsp;&nbsp;定</a></div></div>';
pop_box_new(htmlvalue, 300, 140);
<% elsif @state == 2 %>
alert("班级已过期\n请联系班级管理员重启班级。(在配置班级处)");
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>'+
'<div class="clear mt15"><p class="text_c f14">班级已过期<br/>请联系班级管理员重启班级。(在配置班级处)</p><div class="cl"></div>'+
'<a href="javascript:void(0);" class="fr sy_btn_grey mt10" style="margin-right: 119px;" onclick="hideModal();">确&nbsp;&nbsp;定</a></div></div>';
pop_box_new(htmlvalue, 300, 140);
<% elsif @state == 3 %>
alert("您已经加入了班级");
window.location.href= "<%= Setting.protocol%>://"+"<%= Setting.host_name%>"+"/courses/" + "<%= @course.id%>"
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>'+
'<div class="clear mt15"><p class="text_c f14">您已经加入了班级</p><div class="cl"></div>'+
'<a href="javascript:void(0);" class="fr sy_btn_grey mt10" style="margin-right: 119px;" onclick="refresh_current_course();">确&nbsp;&nbsp;定</a></div></div>';
pop_box_new(htmlvalue, 300, 140);
<% elsif @state == 4 %>
alert("您输入的邀请码错误");
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>'+
'<div class="clear mt15"><p class="text_c f14">您输入的邀请码错误</p><div class="cl"></div>'+
'<a href="javascript:void(0);" class="fr sy_btn_grey mt10" style="margin-right: 119px;" onclick="hideModal();">确&nbsp;&nbsp;定</a></div></div>';
pop_box_new(htmlvalue, 300, 140);
<% elsif @state == 5 %>
alert("您还未登录");
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>'+
'<div class="clear mt15"><p class="text_c f14">您还未登录</p><div class="cl"></div>'+
'<a href="javascript:void(0);" class="fr sy_btn_grey mt10" style="margin-right: 119px;" onclick="hideModal();">确&nbsp;&nbsp;定</a></div></div>';
pop_box_new(htmlvalue, 300, 140);
<% elsif @state == 6 %>
alert("申请成功,请等待审核");
hidden_join_course_form();
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>'+
'<div class="clear mt15"><p class="text_c f14">申请成功,请等待审核</p><div class="cl"></div>'+
'<a href="javascript:void(0);" class="fr sy_btn_grey mt10" style="margin-right: 119px;" onclick="hideModal();">确&nbsp;&nbsp;定</a></div></div>';
pop_box_new(htmlvalue, 300, 140);
<% elsif @state == 7%>
alert("您已经发送过申请了,请耐心等待");
hidden_join_course_form();
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>'+
'<div class="clear mt15"><p class="text_c f14">您已经发送过申请了,请耐心等待</p><div class="cl"></div>'+
'<a href="javascript:void(0);" class="fr sy_btn_grey mt10" style="margin-right: 119px;" onclick="hideModal();">确&nbsp;&nbsp;定</a></div></div>';
pop_box_new(htmlvalue, 300, 140);
<% elsif @state == 8%>
alert("您已经是该班级的教师了");
hidden_join_course_form();
window.location.href= "<%= Setting.protocol%>://"+"<%= Setting.host_name%>"+"/courses/" + "<%= @course.id%>"
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>'+
'<div class="clear mt15"><p class="text_c f14">您已经是该班级的教师了</p><div class="cl"></div>'+
'<a href="javascript:void(0);" class="fr sy_btn_grey mt10" style="margin-right: 119px;" onclick="refresh_current_course();">确&nbsp;&nbsp;定</a></div></div>';
pop_box_new(htmlvalue, 300, 140);
<% elsif @state == 9%>
alert("您已经是该班级的教辅了");
hidden_join_course_form();
window.location.href= "<%= Setting.protocol%>://"+"<%= Setting.host_name%>"+"/courses/" + "<%= @course.id%>"
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>'+
'<div class="clear mt15"><p class="text_c f14">您已经是该班级的教辅了</p><div class="cl"></div>'+
'<a href="javascript:void(0);" class="fr sy_btn_grey mt10" style="margin-right: 119px;" onclick="refresh_current_course();">确&nbsp;&nbsp;定</a></div></div>';
pop_box_new(htmlvalue, 300, 140);
<% elsif @state == 10%>
alert("您已经是该班级的管理员了");
hidden_join_course_form();
window.location.href= "<%= Setting.protocol%>://"+"<%= Setting.host_name%>"+"/courses/" + "<%= @course.id%>"
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>'+
'<div class="clear mt15"><p class="text_c f14">您已经是该班级的管理员了</p><div class="cl"></div>'+
'<a href="javascript:void(0);" class="fr sy_btn_grey mt10" style="margin-right: 119px;" onclick="refresh_current_course();">确&nbsp;&nbsp;定</a></div></div>';
pop_box_new(htmlvalue, 300, 140);
<% elsif @state == 11%>
alert("该班级已被删除");
hidden_join_course_form();
window.location.href= "<%= Setting.protocol%>://"+"<%= Setting.host_name%>"+"/courses/" + "<%= @course.id%>"
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>'+
'<div class="clear mt15"><p class="text_c f14">该班级已被删除</p><div class="cl"></div>'+
'<a href="javascript:void(0);" class="fr sy_btn_grey mt10" style="margin-right: 119px;" onclick="refresh_current_course();">确&nbsp;&nbsp;定</a></div></div>';
pop_box_new(htmlvalue, 300, 140);
<% elsif @state == 12 %>
alert("您已经发送过申请了,请耐心等待");
window.location.href= "<%= Setting.protocol%>://"+"<%= Setting.host_name%>"+"/courses/" + "<%= @course.id%>"
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>'+
'<div class="clear mt15"><p class="text_c f14">您已经发送过申请了,请耐心等待</p><div class="cl"></div>'+
'<a href="javascript:void(0);" class="fr sy_btn_grey mt10" style="margin-right: 119px;" onclick="refresh_current_course();">确&nbsp;&nbsp;定</a></div></div>';
pop_box_new(htmlvalue, 300, 140);
<% elsif @state == 13 %>
alert("申请成功,请等待审核");
window.location.href= "<%= Setting.protocol%>://"+"<%= Setting.host_name%>"+"/courses/" + "<%= @course.id%>"
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>'+
'<div class="clear mt15"><p class="text_c f14">申请成功,请等待审核</p><div class="cl"></div>'+
'<a href="javascript:void(0);" class="fr sy_btn_grey mt10" style="margin-right: 119px;" onclick="refresh_current_course();">确&nbsp;&nbsp;定</a></div></div>';
pop_box_new(htmlvalue, 300, 140);
<% else %>
alert("未知错误,请稍后再试");
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>'+
'<div class="clear mt15"><p class="text_c f14">未知错误,请稍后再试</p><div class="cl"></div>'+
'<a href="javascript:void(0);" class="fr sy_btn_grey mt10" style="margin-right: 119px;" onclick="hideModal();">确&nbsp;&nbsp;定</a></div></div>';
pop_box_new(htmlvalue, 300, 140);
<% end %>
<% end %>
function refresh_current_course(){
hideModal();
<% if @course %>
window.location.href= "<%=course_path(@course.id) %>";
<% end %>
}