This commit is contained in:
huang 2015-09-02 18:02:16 +08:00
commit 86405b8a3c
14 changed files with 70 additions and 37 deletions

View File

@ -1,16 +1,17 @@
<% content_for :header_tags do %> <%= javascript_include_tag "/assets/kindeditor/kindeditor" %>
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
<%= javascript_include_tag 'homework','baiduTemplate' %>
<% end %>
<%= error_messages_for 'homework_common' %> <%= error_messages_for 'homework_common' %>
<div class="project_r_h">
<h2 class="project_h2">
<%= l(:label_course_homework_new)%>
</h2>
</div>
<div class="hwork_new"> <div class="hwork_new">
<%= labelled_form_for @homework,:url => {:controller => 'homework_common',:action => 'create'} do |f| %> <%= labelled_form_for @homework,:url => {:controller => 'homework_common',:action => 'create'} do |f| %>
<%= hidden_field_tag "course",@course.id%> <%= hidden_field_tag "course",@course.id%>
<%= render :partial => 'homework_common/new_homework_detail_manual_form', :locals => { :homework => @homework,:f => f,:edit_mode => false } %> <%= render :partial => 'homework_common/homework_detail_manual_form', :locals => { :homework => @homework,:f => f,:edit_mode => false } %>
<a href="javascript:void(0)" class="blue_btn fl mr10" onClick="submit_homework('new_homework_common');" >提交</a>
<%#= link_to "上一步", new_homework_common_path(:course => @course.id), :class => "orange_btn_homework fl"%>
<%= link_to '取消',homework_common_index_path(:course => @course.id),:class => 'grey_btn fl'%>
<% end%> <% end%>
</div><!--hwork_new end--> </div><!--hwork_new end-->
<div class="cl"></div> <div class="cl"></div>

View File

@ -61,7 +61,7 @@
<%if count > 2 %> <%if count > 2 %>
<div class="homepagePostReplyBannerMore"> <div class="homepagePostReplyBannerMore">
<a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" > <a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >
点击展开更多回复(<%= count.to_s%>) 展开更多
</a> </a>
</div> </div>
<% end %> <% end %>

View File

@ -35,7 +35,7 @@
<%if count>2 %> <%if count>2 %>
<div class="homepagePostReplyBannerMore"> <div class="homepagePostReplyBannerMore">
<a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" > <a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >
点击展开更多回复(<%= count.to_s%>) 展开更多
</a> </a>
</div> </div>
<% end %> <% end %>

View File

@ -72,7 +72,7 @@
<% if count > 2 %> <% if count > 2 %>
<div class="homepagePostReplyBannerMore"> <div class="homepagePostReplyBannerMore">
<a id="reply_btn_<%= user_activity_id %>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help"> <a id="reply_btn_<%= user_activity_id %>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help">
点击展开更多回复(<%= count.to_s %>) 展开更多
</a> </a>
</div> </div>
<% end %> <% end %>

View File

@ -49,7 +49,7 @@
)</div> )</div>
<div class="homepagePostReplyBannerTime"><%#=format_date(activity.updated_on)%></div> <div class="homepagePostReplyBannerTime"><%#=format_date(activity.updated_on)%></div>
<%if count>2 %> <%if count>2 %>
<div class="homepagePostReplyBannerMore"><a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >点击展开更多回复(<%= count.to_s%>)</a></div> <div class="homepagePostReplyBannerMore"><a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >展开更多</a></div>
<% end %> <% end %>
</div> </div>

View File

@ -9,6 +9,7 @@
span.ke-icon-emoticons:hover{background-position:-79px -671px;width:50px;height:26px;} span.ke-icon-emoticons:hover{background-position:-79px -671px;width:50px;height:26px;}
div.ke-toolbar .ke-outline{border:none;} div.ke-toolbar .ke-outline{border:none;}
.ke-inline-block{display: none;} .ke-inline-block{display: none;}
.ke-container{height: 40px !important;}
</style> </style>
<% user_activities.each do |user_activity| <% user_activities.each do |user_activity|
if user_activities %> if user_activities %>
@ -60,7 +61,6 @@
<% end %> <% end %>
<% end %> <% end %>
<% end %> <% end %>
<input type="hidden" value="<%= page%>"/>
<% if user_activities.count == 10%> <% if user_activities.count == 10%>
<%= link_to "点击展开更多",user_activities_path(@user.id,:type => type,:page => page),:id => "show_more_activities",:remote => "true",:class => "loadMore mt10 f_grey"%> <%= link_to "点击展开更多",user_activities_path(@user.id,:type => type,:page => page),:id => "show_more_activities",:remote => "true",:class => "loadMore mt10 f_grey"%>

View File

@ -15,9 +15,12 @@
<div class="calendar_div fl"> <div class="calendar_div fl">
<input type="text" name="homework_common[end_time]" id="homework_end_time" placeholder="截止日期" class="InputBox fl W120 calendar_input" readonly="readonly" > <input type="text" name="homework_common[end_time]" id="homework_end_time" placeholder="截止日期" class="InputBox fl W120 calendar_input" readonly="readonly" >
<%= calendar_for('homework_end_time')%> <%= calendar_for('homework_end_time')%>
</div> </div>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<p id="homework_end_time_span" class="c_red mt5"></p>
<div class="cl"></div>
<div id="homework_editor" style="display: none"> <div id="homework_editor" style="display: none">
<div class="mt10"> <div class="mt10">
<% if edit_mode %> <% if edit_mode %>
@ -31,9 +34,9 @@
<div class="mt10"> <div class="mt10">
<!--<input type="text" class="InputBox W700 SearchIcon" placeholder="发送到课程" />-->
<%= select_tag :course_id, options_for_select(get_as_teacher_courses(User.current), homework.course_id), {:class => "InputBox w720",:value => "请选择发布作业的课程"} %> <%= select_tag :course_id, options_for_select(get_as_teacher_courses(User.current), homework.course_id), {:class => "InputBox w720",:value => "请选择发布作业的课程"} %>
</div> </div>
<p id="homework_course_id_span" class="c_red mt5"></p>
<div class="cl"></div> <div class="cl"></div>
<div id="homework_attachments"> <div id="homework_attachments">

View File

@ -52,6 +52,6 @@
</div> </div>
</div><!----HomeWork end--> </div><!----HomeWork end-->
<% end%> <% end%>
<% if homework_commons.count == 10%>
<input type="hidden" value="<%= page%>" /> <%= link_to "加载更多",user_homeworks_user_path(User.current.id,:page => page),:id => "user_show_more_homework",:remote => "true",:class => "loadMore f_grey"%>
<%= link_to "加载更多",user_homeworks_user_path(User.current.id, :page=> page),:id => "user_show_more_homework",:remote => "true",:class => "loadMore f_grey"%> <% end%>

View File

@ -1,4 +1,2 @@
$("#user_show_more_homework").replaceWith("<%= escape_javascript( render :partial => 'users/user_homework_list',:locals => {:homework_commons => @homework_commons, :page => @page} )%>"); $("#user_show_more_homework").replaceWith("<%= escape_javascript( render :partial => 'users/user_homework_list',:locals => {:homework_commons => @homework_commons, :page => @page} )%>");
<% if @homework_commons.count < 10%>
$(window).off("scroll", scrollHandler);
<% end%>

View File

@ -3536,8 +3536,8 @@ function _getInitHtml(themesPath, bodyClass, cssPath, cssData) {
(_direction === '' ? '<html>' : '<html dir="' + _direction + '">'), (_direction === '' ? '<html>' : '<html dir="' + _direction + '">'),
'<head><meta charset="utf-8" /><title></title>', '<head><meta charset="utf-8" /><title></title>',
'<style>', '<style>',
'html {margin:2px;padding:2px;}', 'html {margin:3px 5px;padding:0px;}',
'body {margin:2px;padding:5px;}', 'body {margin:0px;padding:0px;}',
'body, td {font:14px/1.5 "sans serif",tahoma,verdana,helvetica;}', 'body, td {font:14px/1.5 "sans serif",tahoma,verdana,helvetica;}',
'body, p, div {word-wrap: break-word;}', 'body, p, div {word-wrap: break-word;}',
'p {margin:0 0;}', 'p {margin:0 0;}',

View File

@ -1,6 +1,6 @@
function init_editor(params){ function init_editor(params){
var editor = params.kindutil.create(params.textarea, { var editor = params.kindutil.create(params.textarea, {
resizeType : 1,minWidth:"1px",width:"100%",height:"80px", resizeType : 1,minWidth:"1px",width:"100%",minHeight:"25px",
items:['emoticons'], items:['emoticons'],
afterChange:function(){//按键事件 afterChange:function(){//按键事件
nh_check_field({content:this,contentmsg:params.contentmsg,textarea:params.textarea}); nh_check_field({content:this,contentmsg:params.contentmsg,textarea:params.textarea});

View File

@ -62,8 +62,15 @@ function submit_homework(id)
{ {
$("#homework_name").focus(); $("#homework_name").focus();
} }
else else if(!regex_homework_end_time())
{ {
$("#homework_end_time").focus();
}
else if(!regex_course_id())
{
$("#course_id").focus();
}
else{
homework_description_editor.sync(); homework_description_editor.sync();
$("#"+id).submit(); $("#"+id).submit();
} }
@ -85,6 +92,36 @@ function regex_homework_name()
return true; return true;
} }
} }
//验证截止时间
function regex_homework_end_time()
{
var name = $.trim($("#homework_end_time").val());
if(name=="")
{
$("#homework_end_time_span").text("截止时间不能为空");
return false;
}
else
{
$("#homework_end_time_span").text("");
return true;
}
}
//验证发送到课程
function regex_course_id(){
var course_id = $("#course_id").val();
if(course_id == -1)
{
$("#homework_course_id_span").text("发布课程不能为空");
return false;
}
else
{
$("#homework_course_id_span").text("");
return true;
}
}
//老师导入作业时查询作业 //老师导入作业时查询作业
function search_homework_by_name(url){ function search_homework_by_name(url){

View File

@ -484,10 +484,7 @@ blockquote img{max-width: 100%;}
blockquote { blockquote {
/* font-style: italic; */ /* font-style: italic; */
border-left: 1px solid #e0e0e0; border:1px solid #d4d4d4;
border-right: 1px solid #e0e0e0;
border-top: 1px solid #e0e0e0;
border-bottom: 1px solid #e0e0e0;
padding-left: 0.6em; padding-left: 0.6em;
padding-top: 0.6em; padding-top: 0.6em;
padding-right: 0.6em; padding-right: 0.6em;
@ -645,10 +642,10 @@ a:hover.icon_remove{background:url(images/icons.png) -20px -338px no-repeat;}
.hwork_code02{ width:60px; text-align:center; } .hwork_code02{ width:60px; text-align:center; }
.hwork_tit_e{ width:420px; float:left; } .hwork_tit_e{ width:420px; float:left; }
.hwork_tit_e a{ width:405px; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; } .hwork_tit_e a{ width:405px; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; }
.hwork_num{ width:95px; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;min-height: 1px;} .hwork_num{ width:90px; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;min-height: 1px;}
.mr18{ margin-right:18px;} .mr18{ margin-right:18px;}
a.hwork_center{ display:block; width:60px; margin-right:5px;overflow: hidden; white-space: nowrap; text-overflow:ellipsis;} a.hwork_center{ display:block; width:60px; margin-right:5px;overflow: hidden; white-space: nowrap; text-overflow:ellipsis;}
.hwork_name{ display:block;width:85px; overflow: hidden;white-space: nowrap; text-overflow:ellipsis;min-height: 1px;} .hwork_name{ display:block;width:80px; overflow: hidden;white-space: nowrap; text-overflow:ellipsis;min-height: 1px;}
.absence_penalty{ display:block;width:45px; overflow: hidden;white-space: nowrap; text-overflow:ellipsis;min-height: 1px;} .absence_penalty{ display:block;width:45px; overflow: hidden;white-space: nowrap; text-overflow:ellipsis;min-height: 1px;}
.border_ce {border: 1px solid #e4e4e4;} .border_ce {border: 1px solid #e4e4e4;}
.show_hwork{ border:2px solid #64bdd9; width:646px; padding:10px; color:#666666; padding-bottom:0px; } .show_hwork{ border:2px solid #64bdd9; width:646px; padding:10px; color:#666666; padding-bottom:0px; }
@ -770,4 +767,4 @@ a.FilesName02{ max-width:665px;overflow:hidden; white-space:nowrap; text-overflo
.ProResultUl span { display:block; float:left;} .ProResultUl span { display:block; float:left;}
.ProResultUl li{ line-height:35px; border-bottom:1px solid #dddddd; } .ProResultUl li{ line-height:35px; border-bottom:1px solid #dddddd; }
.DateBorder{border:1px solid #d9d9d9; border-left:none; padding:7px 6px 6px 6px;} .DateBorder{border:1px solid #d9d9d9; border-left:none; padding:7px 6px 6px 6px;}
.mb50{margin-bottom: 50px;} .mb50{margin-bottom: 50px;}

View File

@ -865,7 +865,7 @@ a.DropBtn{background: url(../images/homepage_icon2.png) -125px -339px no-repeat;
a:hover.DropBtn{background: url(../images/homepage_icon2.png) -125px -370px no-repeat;} a:hover.DropBtn{background: url(../images/homepage_icon2.png) -125px -370px no-repeat;}
.DropLine{border-top:1px solid #d9d9d9; float:left; width:623px; height:10px; margin-top:10px;} .DropLine{border-top:1px solid #d9d9d9; float:left; width:623px; height:10px; margin-top:10px;}
/*20150820编程作业 LB*/ /*20150820编程作业 LB*/
.W320{ width:320px;} .W320{ width:320px; max-width: 320px; min-width: 320px;}
.icon_add{ background:url(images/icons.png) 0px -310px no-repeat; width:16px; height:27px; display:block;float:left; margin-right:5px;} .icon_add{ background:url(images/icons.png) 0px -310px no-repeat; width:16px; height:27px; display:block;float:left; margin-right:5px;}
a:hover.icon_add{background:url(images/icons.png) -20px -310px no-repeat;} a:hover.icon_add{background:url(images/icons.png) -20px -310px no-repeat;}
.icon_remove{background:url(images/icons.png) 0px -338px no-repeat; width:16px; height:27px; display:block;float:left;} .icon_remove{background:url(images/icons.png) 0px -338px no-repeat; width:16px; height:27px; display:block;float:left;}
@ -938,10 +938,7 @@ div.recall_con .reply_btn{margin-left:525px;margin-top:5px;}
blockquote { blockquote {
/* font-style: italic; */ /* font-style: italic; */
border-left: 1px solid #e0e0e0; border:1px solid #d4d4d4;
border-right: 1px solid #e0e0e0;
border-top: 1px solid #e0e0e0;
border-bottom: 1px solid #e0e0e0;
padding-left: 0.6em; padding-left: 0.6em;
padding-top: 0.6em; padding-top: 0.6em;
padding-right: 0.6em; padding-right: 0.6em;