Merge branch 'szzh' into develop

This commit is contained in:
huang 2015-11-06 17:49:36 +08:00
commit e2f87a5b06
11 changed files with 27 additions and 50 deletions

View File

@ -21,7 +21,6 @@ class AccountController < ApplicationController
# prevents login action to be filtered by check_if_login_required application scope filter # prevents login action to be filtered by check_if_login_required application scope filter
skip_before_filter :check_if_login_required skip_before_filter :check_if_login_required
# Login request and validation # Login request and validation
def login def login
if request.get? if request.get?

View File

@ -663,7 +663,8 @@ class ApplicationController < ActionController::Base
if api_request? if api_request?
logger.error "Form authenticity token is missing or is invalid. API calls must include a proper Content-type header (text/xml or text/json)." logger.error "Form authenticity token is missing or is invalid. API calls must include a proper Content-type header (text/xml or text/json)."
end end
render_error "Invalid form authenticity token." #render_error "Invalid form authenticity token."
redirect_to signin_path(:login=>true)
end end
def render_feed(items, options={}) def render_feed(items, options={})

View File

@ -28,7 +28,7 @@
<li class="hworkList130 c_grey" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;"> <li class="hworkList130 c_grey" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;">
<% if student_work.created_at && @homework.end_time%> <% if student_work.created_at && @homework.end_time%>
<%= Time.parse(format_time(student_work.created_at)).strftime("%m-%d %H:%M")%>&nbsp; <%= Time.parse(format_time(student_work.created_at)).strftime("%m-%d %H:%M")%>&nbsp;
<% if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(student_work.created_at.to_s).strftime("%Y-%m-%d") %> <% if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(format_time(student_work.created_at)).strftime("%Y-%m-%d") %>
<span class="c_red">[迟交]</span> <span class="c_red">[迟交]</span>
<% end %> <% end %>
<% end %> <% end %>

View File

@ -48,7 +48,7 @@
</li> </li>
<li class="hworkList130 c_grey" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;"> <li class="hworkList130 c_grey" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;">
<%= Time.parse(format_time(student_work.created_at)).strftime("%m-%d %H:%M")%>&nbsp; <%= Time.parse(format_time(student_work.created_at)).strftime("%m-%d %H:%M")%>&nbsp;
<% if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(student_work.created_at.to_s).strftime("%Y-%m-%d") %> <% if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(format_time(student_work.created_at)).strftime("%Y-%m-%d") %>
<span class="c_red">[迟交]</span> <span class="c_red">[迟交]</span>
<% end %> <% end %>
</li> </li>

View File

@ -9,13 +9,11 @@
</p> </p>
<p class="mt5"> <p class="mt5">
<span class="fl fb mr30">附</span><span class="fb fl">件:</span> <span class="fl fb mr30">附</span><span class="fb fl">件:</span>
<% if @student_work.attachments.count == 0%> <% if @student_work.attachments.empty? %>
<span class="fl c_red"><%= "无附件"%></span> <span class="fl c_red"><%= "无附件"%></span>
<% else %> <% else %>
<div class="fl"> <div class="fl grey_c">
<% @student_work.attachments.each do |attachment| %> <%= render :partial => 'work_attachments_status', :locals => {:attachments => @student_work.attachments, :status => 2} %>
<span style="display: block; color: #808181;"><%=attachment.filename %></span>
<% end %>
</div> </div>
<% end %> <% end %>
</p> </p>

View File

@ -5,7 +5,7 @@
<!--</p>--> <!--</p>-->
<% else %> <% else %>
<% attachments.each do |attach| %> <% attachments.each do |attach| %>
<ul class="resourcesList"> <ul class="resourcesList" onmouseover="$(this).children().css('background-color', '#e1e1e1')" onmouseout="$(this).children().css('background-color', 'white')">
<li class="resourcesListCheckbox fl"> <li class="resourcesListCheckbox fl">
<input name="checkbox1[]" type="checkbox" onclick="checkAllBox($(this));" value="<%= attach.id%>" class="resourcesCheckbox" /> <input name="checkbox1[]" type="checkbox" onclick="checkAllBox($(this));" value="<%= attach.id%>" class="resourcesCheckbox" />
</li> </li>

View File

@ -66,9 +66,9 @@
<li>课程名称:<%= ma.course_message.course.name %> <li>课程名称:<%= ma.course_message.course.name %>
(<%= ma.course_message.course.time.to_s + '年'+ ma.course_message.course.term %>)</li> (<%= ma.course_message.course.time.to_s + '年'+ ma.course_message.course.term %>)</li>
<li>作业标题:<span style="color:Red"><%= ma.course_message.name %></span></li> <li>作业标题:<span style="color:Red"><%= ma.course_message.name %></span></li>
<li>提交截止:<span style="color:Red;"><%= ma.course_message.end_time %>&nbsp;&nbsp;24点</span></li> <li>提交截止:<span style="color:Red;"><%= ma.course_message.end_time %>&nbsp;&nbsp;23:59</span></li>
<li>匿评开始:<span style="color:Red;"><%= ma.course_message.homework_detail_manual.evaluation_start %>&nbsp;&nbsp;24点</span></li> <li>匿评开始:<span style="color:Red;"><%= ma.course_message.homework_detail_manual.evaluation_start %>&nbsp;&nbsp;23:59</span></li>
<li>匿评关闭:<span style="color:Red;"><%= ma.course_message.homework_detail_manual.evaluation_end %>&nbsp;&nbsp;24点</span></li> <li>匿评关闭:<span style="color:Red;"><%= ma.course_message.homework_detail_manual.evaluation_end %>&nbsp;&nbsp;23:59</span></li>
<li>迟交扣分:<span style="color:Red;"><%= ma.course_message.late_penalty %>分</span></li> <li>迟交扣分:<span style="color:Red;"><%= ma.course_message.late_penalty %>分</span></li>
<li>缺评扣分:<span style="color:Red;"><%= ma.course_message.homework_detail_manual.absence_penalty %>分</span></li> <li>缺评扣分:<span style="color:Red;"><%= ma.course_message.homework_detail_manual.absence_penalty %>分</span></li>
</ul> </ul>
@ -81,9 +81,9 @@
<li>课程名称:<%= ma.course_message.course.name %> <li>课程名称:<%= ma.course_message.course.name %>
(<%= ma.course_message.course.time.to_s + '年'+ ma.course_message.course.term %>)</li> (<%= ma.course_message.course.time.to_s + '年'+ ma.course_message.course.term %>)</li>
<li>作业标题:<span style="color:Red;"><%= ma.course_message.name %></span></li> <li>作业标题:<span style="color:Red;"><%= ma.course_message.name %></span></li>
<li>提交截止:<span style="color:Red;"><%= ma.course_message.end_time %>&nbsp;&nbsp;24点</span></li> <li>提交截止:<span style="color:Red;"><%= ma.course_message.end_time %>&nbsp;&nbsp;23:59</span></li>
<li>匿评开始:<span style="color:Red;"><%= ma.course_message.homework_detail_manual.evaluation_start %>&nbsp;&nbsp;24点</span></li> <li>匿评开始:<span style="color:Red;"><%= ma.course_message.homework_detail_manual.evaluation_start %>&nbsp;&nbsp;23:59</span></li>
<li>匿评关闭:<span style="color:Red;"><%= ma.course_message.homework_detail_manual.evaluation_end %>&nbsp;&nbsp;24点</span></li> <li>匿评关闭:<span style="color:Red;"><%= ma.course_message.homework_detail_manual.evaluation_end %>&nbsp;&nbsp;23:59</span></li>
<li>迟交扣分:<span style="color:Red;"><%= ma.course_message.late_penalty %>分</span></li> <li>迟交扣分:<span style="color:Red;"><%= ma.course_message.late_penalty %>分</span></li>
<li>缺评扣分:<span style="color:Red;"><%= ma.course_message.homework_detail_manual.absence_penalty %>分</span></li> <li>缺评扣分:<span style="color:Red;"><%= ma.course_message.homework_detail_manual.absence_penalty %>分</span></li>
</ul> </ul>
@ -116,9 +116,9 @@
<ul class="ul_normal_color"> <ul class="ul_normal_color">
<li>课程名称:<%= ma.course_message.course.name %>(<%= ma.course_message.course.time.to_s + '年'+ ma.course_message.course.term %>)</li> <li>课程名称:<%= ma.course_message.course.name %>(<%= ma.course_message.course.time.to_s + '年'+ ma.course_message.course.term %>)</li>
<li>作业标题:<span style="color:Red;"><%= ma.course_message.name %></span></li> <li>作业标题:<span style="color:Red;"><%= ma.course_message.name %></span></li>
<li>提交截止:<span style="color:Red;"><%= ma.course_message.end_time %>&nbsp;&nbsp;24点</span></li> <li>提交截止:<span style="color:Red;"><%= ma.course_message.end_time %>&nbsp;&nbsp;23:59</span></li>
<li>匿评开始:<span style="color:Red;"><%= ma.course_message.homework_detail_manual.evaluation_start %>&nbsp;&nbsp;24点</span></li> <li>匿评开始:<span style="color:Red;"><%= ma.course_message.homework_detail_manual.evaluation_start %>&nbsp;&nbsp;23:59</span></li>
<li>匿评关闭:<span style="color:Red;"><%= ma.course_message.homework_detail_manual.evaluation_end %>&nbsp;&nbsp;24点</span></li> <li>匿评关闭:<span style="color:Red;"><%= ma.course_message.homework_detail_manual.evaluation_end %>&nbsp;&nbsp;23:59</span></li>
<li>迟交扣分:<span style="color:Red;"><%= ma.course_message.late_penalty %>分</span></li> <li>迟交扣分:<span style="color:Red;"><%= ma.course_message.late_penalty %>分</span></li>
<li>缺评扣分:<span style="color:Red;"><%= ma.course_message.homework_detail_manual.absence_penalty %>分</span></li> <li>缺评扣分:<span style="color:Red;"><%= ma.course_message.homework_detail_manual.absence_penalty %>分</span></li>
<p>请抓紧时间提交您的作品,谢谢!</p> <p>请抓紧时间提交您的作品,谢谢!</p>
@ -154,7 +154,7 @@
<li>课程名称:<%= ma.course_message.course.name %>(<%= ma.course_message.course.time.to_s + '年'+ ma.course_message.course.term %>)</li> <li>课程名称:<%= ma.course_message.course.name %>(<%= ma.course_message.course.time.to_s + '年'+ ma.course_message.course.term %>)</li>
<li>作业标题:<span style="color:Red;"><%= ma.course_message.name %></span></li> <li>作业标题:<span style="color:Red;"><%= ma.course_message.name %></span></li>
<li>缺评扣分:<span style="color:Red;"><%= ma.course_message.homework_detail_manual.absence_penalty %>分</span></li> <li>缺评扣分:<span style="color:Red;"><%= ma.course_message.homework_detail_manual.absence_penalty %>分</span></li>
<li>匿评截止:<span style="color:Red;"><%= ma.course_message.homework_detail_manual.evaluation_end %>&nbsp;&nbsp;24点</span></li> <li>匿评截止:<span style="color:Red;"><%= ma.course_message.homework_detail_manual.evaluation_end %>&nbsp;&nbsp;23:59</span></li>
</ul> </ul>
<% unless User.current.allowed_to?(:as_teacher, ma.course_message.course)%> <% unless User.current.allowed_to?(:as_teacher, ma.course_message.course)%>
<p>请您尽早完成匿评!如果您在截止日期前未完成匿评,您的最终成绩将被扣除<%= ma.course_message.homework_detail_manual.absence_penalty %>分乘以缺评份数。</p> <p>请您尽早完成匿评!如果您在截止日期前未完成匿评,您的最终成绩将被扣除<%= ma.course_message.homework_detail_manual.absence_penalty %>分乘以缺评份数。</p>
@ -215,7 +215,7 @@
<li>失败原因:<span style="color:red;">提交作品的人数低于2人</span></li> <li>失败原因:<span style="color:red;">提交作品的人数低于2人</span></li>
<li>课程名称:<%= ma.course_message.course.name %>(<%= ma.course_message.course.time.to_s + '年' + ma.course_message.course.term %>)</li> <li>课程名称:<%= ma.course_message.course.name %>(<%= ma.course_message.course.time.to_s + '年' + ma.course_message.course.term %>)</li>
<li>作业标题:<span style="color:Red;"><%= ma.course_message.name %></span></li> <li>作业标题:<span style="color:Red;"><%= ma.course_message.name %></span></li>
<li>提交截止:<span style="color:Red;"><%= ma.course_message.end_time%>&nbsp;&nbsp;24点</span></li> <li>提交截止:<span style="color:Red;"><%= ma.course_message.end_time%>&nbsp;&nbsp;23:59</span></li>
</ul> </ul>
</div> </div>
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li> <li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
@ -314,7 +314,7 @@
<% end %> <% end %>
</ul> </ul>
<p> <p>
本次作业将在<%= ma.course_message.student_work.homework_common.homework_detail_manual.evaluation_end %>&nbsp;&nbsp;24点结束匿评,到时您将可以看到所有其他同学的作品啦!大家可以进一步互相学习。 期待您取得更大的进步! 本次作业将在<%= ma.course_message.student_work.homework_common.homework_detail_manual.evaluation_end %>&nbsp;&nbsp;23:59结束匿评,到时您将可以看到所有其他同学的作品啦!大家可以进一步互相学习。 期待您取得更大的进步!
</p> </p>
</div> </div>
<% end %> <% end %>
@ -397,7 +397,7 @@
<ul class="ul_grey"> <ul class="ul_grey">
<li>课程名称:<%= ma.course_message.homework_common.course.name %>(<%= ma.course_message.homework_common.course.time.to_s + '年' + ma.course_message.homework_common.course.term %>)</li> <li>课程名称:<%= ma.course_message.homework_common.course.name %>(<%= ma.course_message.homework_common.course.time.to_s + '年' + ma.course_message.homework_common.course.term %>)</li>
<li>作业标题:<%= ma.course_message.homework_common.name %></li> <li>作业标题:<%= ma.course_message.homework_common.name %></li>
<li>提交截止:<%= ma.course_message.homework_common.end_time %>&nbsp;24:00</li> <li>提交截止:<%= ma.course_message.homework_common.end_time %>&nbsp;23:59</li>
<li>提交时间:<%= format_time(ma.course_message.created_at) %></li> <li>提交时间:<%= format_time(ma.course_message.created_at) %></li>
<li>迟交扣分:<%= ma.course_message.homework_common.late_penalty %>分</li> <li>迟交扣分:<%= ma.course_message.homework_common.late_penalty %>分</li>
</ul> </ul>

View File

@ -145,7 +145,6 @@
var id; //资源id var id; //资源id
var sendType; //发送到课程 1 发送到项目 2 var sendType; //发送到课程 1 发送到项目 2
var lastSendType; //保存上次发送的发送类型 var lastSendType; //保存上次发送的发送类型
var last_op
$("#resources_list").mousedown(function(e) { $("#resources_list").mousedown(function(e) {
//如果是右键的话 //如果是右键的话
if (3 == e.which) { if (3 == e.which) {
@ -180,28 +179,6 @@
last_line = line; last_line = line;
} }
}); });
//鼠标经过时,背景颜色设为灰色
$("#resources_list").mouseover(function(e){
pageX = e.clientX;
pageY = e.clientY;
var ele = document.elementFromPoint(pageX,pageY);
line = $(ele).parent();
if(last_op != null){
last_op.children().css("background-color", 'white');
restore();
last_op == null;
}
//如果当前的tag是li那么还要li的父级元素
if(line.get(0).tagName === 'LI'){
line = line.parent();
}
//将当前的元素的所有子元素的背景色改为蓝色
line.children().css("background-color", '#e1e1e1');
//将当前元素赋给 上一个对象 保存起来。
last_op = line;
});
//元素包含关系计算 //元素包含关系计算
var contains = function(root, el) { var contains = function(root, el) {
if (root.compareDocumentPosition) if (root.compareDocumentPosition)

View File

@ -480,7 +480,7 @@ a.xls{ margin-left:5px; color:#136b3b;}
/* 开启匿评弹框 */ /* 开启匿评弹框 */
.anonymos{width:480px;height:180px;position:fixed !important;z-index:100;left:50%;top:50%;margin:-215px 0 0 -300px; background:#fff; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px; box-shadow:0px 0px 8px #194a81; overflow:auto;} .anonymos{width:480px;height:180px;position:fixed !important;z-index:100;left:50%;top:50%;margin:-215px 0 0 -300px; background:#fff; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px; box-shadow:0px 0px 8px #194a81; overflow:auto;}
.anonymos_work {position:fixed !important;left:60%;top:60%;margin:-215px 0 0 -300px; box-shadow:0px 0px 8px #194a81; overflow:auto;} .anonymos_work {position:fixed !important;left:60%;top:60%;margin:-215px 0 0 -300px; box-shadow:0px 0px 8px #194a81; overflow:auto;}
.ni_con { width:425px; margin:25px 30px;} .ni_con { width:425px; margin:25px 30px;font-family:"微软雅黑","宋体";}
.ni_con h2{ display:block; height:40px; width:425px; text-align:center; color:#3a3a3a;} .ni_con h2{ display:block; height:40px; width:425px; text-align:center; color:#3a3a3a;}
.ni_con p{ color:#808181; } .ni_con p{ color:#808181; }
.ni_con a:hover{ text-decoration:none;} .ni_con a:hover{ text-decoration:none;}
@ -491,6 +491,7 @@ a:hover.tijiao{ background:#0f99a9;}
.ni_con_work { width:300px; margin:25px 20px;} .ni_con_work { width:300px; margin:25px 20px;}
.ni_con_work p{ color:#808181; } .ni_con_work p{ color:#808181; }
a.xls{ margin-left:5px; color:#136b3b;} a.xls{ margin-left:5px; color:#136b3b;}
.grey_c{ color:#808181;}
/* 学生列表*/ /* 学生列表*/
.st_list{ width:670px;} .st_list{ width:670px;}
.st_search{ } .st_search{ }

View File

@ -152,11 +152,12 @@ a:hover.tijiao{ background:#0f99a9 !important;}
/* 匿名评分弹框 */ /* 匿名评分弹框 */
.alert_praise{width:480px;height:200px;position:fixed;z-index:100;left:50%;top:50%;margin:-215px 0 0 -300px; background:#fff; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px; box-shadow:0px 0px 8px #194a81; overflow:auto;} .alert_praise{width:480px;height:200px;position:fixed;z-index:100;left:50%;top:50%;margin:-215px 0 0 -300px; background:#fff; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px; box-shadow:0px 0px 8px #194a81; overflow:auto;}
.alert .close02{width:26px;height:26px;overflow:hidden;position:absolute;top:-10px;right:-490px;background:url(images/close.png) no-repeat;cursor:pointer;} .alert .close02{width:26px;height:26px;overflow:hidden;position:absolute;top:-10px;right:-490px;background:url(images/close.png) no-repeat;cursor:pointer;}
.ni_con { width:425px; margin:25px 30px;} .ni_con { width:425px; margin:25px 30px;font-family:"微软雅黑","宋体";}
.ni_con h2{ display:block; height:40px; width:188px; margin:0 auto;} .ni_con h2{ display:block; height:40px; width:188px; margin:0 auto;}
.ni_con p{ color:#808181;} .ni_con p{ color:#808181;}
.ni_con a:hover{ text-decoration:none;} .ni_con a:hover{ text-decoration:none;}
.grey_c{ color:#808181;}
/*弹框*/ /*弹框*/
.black_overlay{display:none;position:absolute;top:0%;left:0%;width:100%;height:100%;background-color:black;z-index:1001;-moz-opacity:0.3;opacity:.30;filter:alpha(opacity=30);} .black_overlay{display:none;position:absolute;top:0%;left:0%;width:100%;height:100%;background-color:black;z-index:1001;-moz-opacity:0.3;opacity:.30;filter:alpha(opacity=30);}
.upload_box{display:none;position:absolute;top:25%;left:35%;width:30%;height: auto;padding:5px;border:3px solid #15bccf; background:#fff;z-index:1002;overflow:auto;} .upload_box{display:none;position:absolute;top:25%;left:35%;width:30%;height: auto;padding:5px;border:3px solid #15bccf; background:#fff;z-index:1002;overflow:auto;}

View File

@ -1297,7 +1297,7 @@ a:hover.SetUpIcon{background: url(../images/homepage_icon.png) 0px -486px no-rep
/* 开启匿评弹框 */ /* 开启匿评弹框 */
.anonymos{width:480px;height:180px;position:fixed !important;z-index:100;left:50%;top:50%;margin:-215px 0 0 -300px; background:#fff; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px; box-shadow:0px 0px 8px #194a81; overflow:auto;} .anonymos{width:480px;height:180px;position:fixed !important;z-index:100;left:50%;top:50%;margin:-215px 0 0 -300px; background:#fff; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px; box-shadow:0px 0px 8px #194a81; overflow:auto;}
.anonymos_work {position:fixed !important;left:60%;top:60%;margin:-215px 0 0 -300px; box-shadow:0px 0px 8px #194a81; overflow:auto;} .anonymos_work {position:fixed !important;left:60%;top:60%;margin:-215px 0 0 -300px; box-shadow:0px 0px 8px #194a81; overflow:auto;}
.ni_con { width:425px; margin:15px;} .ni_con { width:425px; margin:15px;font-family:"微软雅黑","宋体";}
.ni_con h2{ display:block; height:40px; width:425px; text-align:center; color:#3a3a3a;} .ni_con h2{ display:block; height:40px; width:425px; text-align:center; color:#3a3a3a;}
.ni_con p{ color:#808181; } .ni_con p{ color:#808181; }
.ni_con a:hover{ text-decoration:none;} .ni_con a:hover{ text-decoration:none;}
@ -1307,7 +1307,7 @@ a:hover.tijiao{ background:#297fb8;}
.c_pink{ color:#e65d5e;} .c_pink{ color:#e65d5e;}
.ni_con_work { width:300px; margin:25px 20px;} .ni_con_work { width:300px; margin:25px 20px;}
.ni_con_work p{ color:#808181; } .ni_con_work p{ color:#808181; }
.grey_c{ color:#808181;}
a.link_file_a{ background:url(../images/pic_file.png) 0 2px no-repeat; padding-left:20px; } a.link_file_a{ background:url(../images/pic_file.png) 0 2px no-repeat; padding-left:20px; }
a:hover.link_file_a{ background:url(../images/pic_file.png) 0 -25px no-repeat; color:#3ca5c6;} a:hover.link_file_a{ background:url(../images/pic_file.png) 0 -25px no-repeat; color:#3ca5c6;}
.link_file_a{ display:block; max-width:450px;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;} .link_file_a{ display:block; max-width:450px;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;}