This commit is contained in:
huang 2015-11-03 17:19:47 +08:00
commit 98ee22a3b6
14 changed files with 79 additions and 42 deletions

View File

@ -303,6 +303,7 @@ class CoursesService
#@state == 7 您已经发送过申请了,请耐心等待
#@state == 8 您已经是该课程的教师了
#@state == 9 您已经是该课程的教辅了
#@state == 10 您已经是该课程的管理员了
#@state 其他 未知错误,请稍后再试
def join_course params,current_user
course = Course.find_by_id params[:object_id]
@ -325,6 +326,8 @@ class CoursesService
#如果加入的角色教辅并且当前为教辅
elsif params[:role] == "7" && roleName == "TeachingAsistant"
@state = 9
elsif roleName == "Manager"
@state = 10
#如果加入角色为教师或者教辅,并且当前是学生,或者是要成为教辅,当前不是教辅,或者要成为教师,当前不是教师。那么要发送请求
elsif (params[:role] != "10" && roleName == "Student") || (params[:role] == "7" && roleName != "TeachingAsistant" ) || (params[:role] == "9" && roleName != "Teacher" )
#如果已经发送过消息了,那么就要给个提示

View File

@ -86,6 +86,9 @@
}
function register(){
if($("#loginUpButton").hasClass('loginUpDisableButton')){
return;
}
if($login_correct && $mail_correct && $passwd_correct && $passwd_comfirm_correct && $("#read_and_confirm").attr("checked") == 'checked'){
$("#main_reg_form").submit();
}else{
@ -182,6 +185,16 @@
$('#main_login_form').submit();
}
}
function changeRegisterBtn(checkbox){
if(checkbox.checked == true){
$("#loginUpButton").removeClass('loginUpDisableButton');
$("#loginUpButton").addClass('loginUpButton');
}else{
$("#loginUpButton").removeClass('loginUpButton')
$("#loginUpButton").addClass('loginUpDisableButton');
}
}
</script>
<div class="loginContentContainer">
<div class="loginContent">
@ -270,11 +283,11 @@
</div>
<div class="loginSignOption">
<div class="fl mt3 mr5">
<input type="checkbox" id="read_and_confirm"/>
<input type="checkbox" id="read_and_confirm" onchange="changeRegisterBtn(this);"/>
</div>
我已阅读并接受<a href="<%= agreement_path %>" class="newsBlue"><u>Trustie服务协议</u></a>条款</div>
<div class="loginUpButton">
<a href="javascript:void(0);" class="c_white db" id="regist_btn" onclick="register();">注册</a>
<div class="loginUpDisableButton" id="loginUpButton">
<a href="javascript:void(0);" class="c_white db" id="regist_btn" onclick="register();" >注册</a>
</div>
<% end %>

View File

@ -32,6 +32,10 @@ window.location.href= "http://"+"<%= Setting.host_name%>"+"/courses/" + "<%= @co
alert("您已经是该课程的教辅了");
hidden_join_course_form();
window.location.href= "http://"+"<%= Setting.host_name%>"+"/courses/" + "<%= @course.id%>"
<% elsif @state == 10%>
alert("您已经是该课程的管理员了");
hidden_join_course_form();
window.location.href= "http://"+"<%= Setting.host_name%>"+"/courses/" + "<%= @course.id%>"
<% else %>
alert("未知错误,请稍后再试");
<% end %>

View File

@ -247,7 +247,7 @@
tagId = id;
taggableType = type;
width = parseInt(domEle.css('width').replace('px', '')) >= 100 ? parseInt(domEle.css('width').replace('px', '')) : 100
domEle.html('<input name="" id="renameTagName" maxlength="<%=Setting.tags_max_length%>" minlength="<%= Setting.tags_min_length%>" style="width:' + width + 'px;" value="' + name + '"/>');
domEle.html('<input name="" id="renameTagName" maxlength="120" minlength="1" style="width:' + width + 'px;" value="' + name + '"/>');
domEle.parent().css("border", "1px solid #ffffff");
$("#renameTagName").focus();
}
@ -295,8 +295,8 @@
// }else{ //否则就要更新tag名称了
//// if(confirm("是否将标签改为 "+ $("#renameTagName").val().trim())){ 去掉询问
// $.post(
// '<%= update_tag_name_path %>',
// {"taggableId": tagId, "taggableType": taggableType, "tagName": tagName, "renameName": $("#renameTagName").val().trim(),"courseId":<%= @course.id%>}
// '<%#= update_tag_name_path %>',
// {"taggableId": tagId, "taggableType": taggableType, "tagName": tagName, "renameName": $("#renameTagName").val().trim(),"courseId":<%#= @course.id%>}
// )
//// }else{
//// ele.parent().css("border","");

View File

@ -21,12 +21,11 @@
</a>
<% end %>
</div>
<div class="mt5">
<div class="mt5" style="color: #269ac9;cursor: default">
<!--<a target="hiddentab" href="http://wpa.qq.com/msgrd?v=1&uin=1554253403&site=qq&menu=yes" style="color: #269ac9;">-->
<%#= l(:label_technical_support) %>
<!--白&nbsp;&nbsp;&nbsp;羽</a> http://shang.qq.com/wpa/qunwpa?idkey=4fe2d63a4527cddce038f04f0b1d728a62082074fb4a74870a5444ee1a6910ad-->
<a href="javascript:void(0);" style="color: #269ac9;">
<p style="text-align: center"> 请加入师姐师姐答疑群</p> <p style="text-align: center">173184401</p> </a>
<p style="text-align: center"> 请加入师姐师兄答疑群</p> <p style="text-align: center">QQ群号173184401</p>
</div>
</div>
<div class="side_bottom"></div>

View File

@ -61,14 +61,14 @@
function addTag(){
if(<%=@forum.creator.id == User.current.id%>) {
if ($("input[name='addTag']").val().trim() != "" ) {
if($("input[name='addTag']").val().trim().length <= 14) {
if($("input[name='addTag']").val().trim().length <= 120) {
$.get(
'<%= add_forum_tag_forum_path(@forum)%>' + "?tag_str=" + $("input[name='addTag']").val(),
{}
);
$("input[name='addTag']").val('');
}else{
alert("标签名字长度不能超过14个字符");
alert("标签名字长度不能超过120个字符");
}
}
}

View File

@ -259,7 +259,7 @@ tags_min_length:
default: 1
tags_max_length:
format: int
default: 14
default: 120
tags_show_search_results:
format: int
default: 5

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.7 KiB

After

Width:  |  Height:  |  Size: 7.1 KiB

View File

@ -552,27 +552,27 @@ function addFileCourseSource(inputEl, file, eagerUpload,checkBox) {
fileSpan.append(
$('<input>', {
'type': 'text',
'class': 'filename readonly',
'class': 'upload_filename readonly',
'name': 'attachments[' + attachmentId + '][filename]',
'readonly': 'readonly'
}).val(file.name),
$('<input>', {
'type': 'text',
'class': 'description',
'name': 'attachments[' + attachmentId + '][description]',
'maxlength': 254,
'placeholder': $(inputEl).data('descriptionPlaceholder')
}).toggle(!eagerUpload),
$('<span >' + $(inputEl).data('fieldIsPublic') + ':</span>').attr({
'class': 'ispublic-label'
}),
$('<input>', {
'type': 'checkbox',
'class': 'is_public_checkbox',
'value': 1,
'name': 'attachments[' + attachmentId + '][is_public_checkbox]',
checked: 'checked'
}).toggle(!eagerUpload),
// $('<input>', {
// 'type': 'text',
// 'class': 'description',
// 'name': 'attachments[' + attachmentId + '][description]',
// 'maxlength': 254,
// 'placeholder': $(inputEl).data('descriptionPlaceholder')
// }).toggle(!eagerUpload),
// $('<span >' + $(inputEl).data('fieldIsPublic') + ':</span>').attr({
// 'class': 'ispublic-label'
// }),
// $('<input>', {
// 'type': 'checkbox',
// 'class': 'is_public_checkbox',
// 'value': 1,
// 'name': 'attachments[' + attachmentId + '][is_public_checkbox]',
// checked: 'checked'
// }).toggle(!eagerUpload),
$('<a>&nbsp</a>').attr({
'href': "#",
'class': 'remove-upload'

View File

@ -2745,15 +2745,31 @@ h2 img { vertical-align:middle; }
/*added by william*/
#tag {
background: url(../images/issue_tag.png) no-repeat right -19px;
border-radius: 3px;
color: #3a587d !important;
padding: 1px 4px 2px 4px;
margin: 3px;
display: inline-block;
font-size: 13px; /*modified by linchun*/
text-decoration: none;
cursor: pointer;
/*background: url(../images/issue_tag.png) no-repeat right -19px;*/
/*border-radius: 3px;*/
/*color: #3a587d !important;*/
/*padding: 1px 4px 2px 4px;*/
/*margin: 3px;*/
/*display: inline-block;*/
/*font-size: 13px; *//*modified by linchun*/
/*text-decoration: none;*/
/*cursor: pointer;*/
border-radius: 3px;
color: #3a587d !important;
padding: 1px 4px 2px 4px;
margin: 3px;
display: inline-block;
font-size: 13px;
text-decoration: none;
cursor: pointer;
width: auto;
padding: 0 5px;
padding-top: 2px;
border: 1px solid #f8df8c;
background: #fffce6;
margin-right: 5px;
word-wrap: break-word;
word-break: break-all;
}
/*tanxianbo*/

View File

@ -56,7 +56,7 @@ a:hover.subnav_green{ background:#14ad5a;}
a.yellowBtn{ display:inline-block;color:#0d90c3; height:22px;}
.submit{height:21px;border:0; cursor:pointer; background:url(../images/btn.png) no-repeat 0 0;width:42px; margin-top:2px; margin-left:3px; }
.isTxt{background:#fbfbfb url(../images/inputBg.png) repeat-x left top;height:22px;line-height:22px;border:1px solid #c1c1c1;padding:0 5px;color:#666666;}
.re_tag{ width: auto; padding:0 5px; padding-top:2px; height:20px; border:1px solid #f8df8c; background:#fffce6; margin-right:5px; }
.re_tag{ width: auto; padding:0 5px; padding-top:2px; border:1px solid #f8df8c; background:#fffce6; margin-right:5px; word-wrap: break-word;word-break: break-all }
.re_tag a{ color:#0d90c3;}
.tag_h{ }
.tag_h span,.tag_h a{ margin-bottom:5px;}

View File

@ -726,6 +726,8 @@ a.loginChooseTab {color:#484848; height:30px; display:block;}
.loginUpButton {width:315px; height:40px; background-color:#269ac9; margin-left:46px; font-size:14px; text-align:center; line-height:40px; vertical-align:middle; margin-top:30px;}
.loginInButton:hover {background-color: #297fb8}
.loginUpButton:hover {background-color: #297fb8}
.loginUpDisableButton {width:315px; height:40px; background-color:#C1C1C1; margin-left:46px; font-size:14px; text-align:center; line-height:40px; vertical-align:middle; margin-top:30px;}
.loginUpDisableButton:hover {background-color: #C1C1C1}
.loginChooseBorder {width:295px; height:30px; border-bottom:1px solid #e3e3e3;}
.loginSign {width:405px; background-color:#ffffff;}
.loginSignBox {width:308px; height:38px; margin-left:46px; border:1px solid #98a1a6; outline:none;}

View File

@ -59,7 +59,7 @@ a:hover.subnav_green{ background:#14ad5a;}
a.yellowBtn{ display:inline-block;color:#0d90c3; height:22px;}
.submit{height:21px;border:0; cursor:pointer; background:url(../images/btn.png) no-repeat 0 0;width:42px; margin-top:2px; margin-left:3px; }
.isTxt{background:#fbfbfb url(../images/inputBg.png) repeat-x left top;height:22px;line-height:22px;border:1px solid #c1c1c1;padding:0 5px;color:#666666;}
.re_tag{ width: auto; padding:0 5px; padding-top:2px; height:20px; border:1px solid #f8df8c; background:#fffce6; margin-right:5px; }
.re_tag{ width: auto; padding:0 5px; padding-top:2px; border:1px solid #f8df8c; background:#fffce6; margin-right:5px; word-wrap: break-word;word-break: break-all }
.re_tag a{ color:#0d90c3;}
.tag_h{ }
.tag_h span,.tag_h a{ margin-bottom:5px;}

View File

@ -56,7 +56,7 @@ a:hover.subnav_green{ background:#14ad5a;}
a.yellowBtn{ display:inline-block;color:#0d90c3; height:22px;}
.submit{height:21px;border:0; cursor:pointer; background:url(images/btn.png) no-repeat 0 0;width:42px; margin-top:2px; margin-left:3px; }
.isTxt{background:#fbfbfb url(images/inputBg.png) repeat-x left top;height:22px;line-height:22px;border:1px solid #c1c1c1;padding:0 5px;color:#666666;}
.re_tag{ width: auto; padding:0 5px; padding-top:2px; height:20px; border:1px solid #f8df8c; background:#fffce6; margin-right:5px; }
.re_tag{ width: auto; padding:0 5px; padding-top:2px; border:1px solid #f8df8c; background:#fffce6; margin-right:5px; word-wrap: break-word;word-break: break-all }
.re_tag a{ color:#0d90c3;}
.tag_h{ }
.tag_h span,.tag_h a{ margin-bottom:5px;}