This commit is contained in:
whimlex 2015-09-29 15:26:14 +08:00
commit 4515c397db
9 changed files with 139 additions and 104 deletions

View File

@ -176,12 +176,6 @@ class FilesController < ApplicationController
def index def index
@flag = params[:flag] || false @flag = params[:flag] || false
#sort_init 'filename', 'asc'
# sort_init 'created_on', 'desc'
# sort_update 'created_on' => "#{Attachment.table_name}.created_on",
# 'filename' => "#{Attachment.table_name}.filename",
# 'size' => "#{Attachment.table_name}.filesize",
# 'downloads' => "#{Attachment.table_name}.downloads"
sort = "" sort = ""
@sort = "" @sort = ""
@order = "" @order = ""

View File

@ -1,11 +1,10 @@
<a href="javascript:void(0)" class="upimg fl"> <a href="javascript:void(0)" class="upimg fl">
<%= image_tag(url_to_avatar(source), id: "avatar_image", :width =>"60", :height =>"60",:alt=>"上传图片")%> <%= image_tag(url_to_avatar(source), id: "avatar_image", :width =>"60", :height =>"60",:alt=>"上传图片")%>
</a> </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 href="javascript:void(0)" class="upbtn fl" onclick="$('#upload_img').click();"><%= l(:button_upload_photo) %></a>
<a href="javascript:void(0)" class="upbtn fl"><%= l(:button_upload_photo) %></a>
<%= file_field_tag 'avatar[image]', <%= file_field_tag 'avatar[image]',
:id => nil, :id => "upload_img",
:class => 'upload_file', :class => 'undis',
:size => "1", :size => "1",
:multiple => true, :multiple => true,
:data => { :data => {

View File

@ -133,7 +133,7 @@
<body class="<%= h body_css_classes %>" onload="prettyPrint();"> <body class="<%= h body_css_classes %>" onload="prettyPrint();">
<div class="cl"></div> <div class="cl"></div>
<div class="navContainer mb10"> <div class="navContainer">
<% if User.current.logged? %> <% if User.current.logged? %>
<%= render :partial => 'layouts/logined_header' %> <%= render :partial => 'layouts/logined_header' %>
<% else%> <% else%>

View File

@ -58,11 +58,11 @@
</ul> </ul>
</div> </div>
<%end%> <%end%>
<div class="postDetailTitle"> <div class="postDetailTitle fl">
<a href="javascript:void(0);" class="f14 linkGrey4 fb" style="word-break: break-all; word-wrap:break-word;white-space:pre-wrap;">主题: <%= @memo.subject%></a> <a href="javascript:void(0);" class="f14 linkGrey4 fb" style="overflow:hidden;">主题: <%= @memo.subject%></a>
<%= render :partial => "memos/praise_tread",:locals => {:obj => @memo,:show_flag => true,:user_id =>User.current.id,:horizontal => true}%>
<div class="cl"></div>
</div> </div>
<%= render :partial => "memos/praise_tread",:locals => {:obj => @memo,:show_flag => true,:user_id =>User.current.id,:horizontal => true}%>
<div class="cl"></div>
<div class="postDetailCreater"><a href="javascript:void(0);" class="linkBlue2" target="_blank"><%= @memo.author.name%></a></div> <div class="postDetailCreater"><a href="javascript:void(0);" class="linkBlue2" target="_blank"><%= @memo.author.name%></a></div>
<div class="postDetailDate mb5"><%= format_date( @memo.created_at)%></div> <div class="postDetailDate mb5"><%= format_date( @memo.created_at)%></div>

View File

@ -4,7 +4,7 @@ class AlterActivities < ActiveRecord::Migration
if activity.act_type == 'JournalsForMessage' if activity.act_type == 'JournalsForMessage'
if activity.act if activity.act
unless activity.act.m_parent_id.nil? unless activity.act.m_parent_id.nil?
parent_act = UserActivity.where("act_id = #{activity.act.parent.id} and act_type='JournalsForMessage' and container_type='Course'").first parent_act = UserActivity.where("act_id = #{activity.act.m_parent_id} and act_type='JournalsForMessage' and container_type='Course'").first
if parent_act if parent_act
parent_act.created_at = activity.act.parent.children.maximum("created_on") parent_act.created_at = activity.act.parent.children.maximum("created_on")
parent_act.save parent_act.save
@ -21,7 +21,7 @@ class AlterActivities < ActiveRecord::Migration
if activity.course_act_type == 'JournalsForMessage' if activity.course_act_type == 'JournalsForMessage'
if activity.course_act if activity.course_act
unless activity.course_act.m_parent_id.nil? unless activity.course_act.m_parent_id.nil?
parent_act = CourseActivity.where("course_act_id = #{activity.course_act.parent.id} and course_act_type='JournalsForMessage'").first parent_act = CourseActivity.where("course_act_id = #{activity.course_act.m_parent_id} and course_act_type='JournalsForMessage'").first
if parent_act if parent_act
parent_act.created_at = activity.course_act.parent.children.maximum("created_on") parent_act.created_at = activity.course_act.parent.children.maximum("created_on")
parent_act.save parent_act.save
@ -34,7 +34,7 @@ class AlterActivities < ActiveRecord::Migration
elsif activity.course_act_type == 'Message' elsif activity.course_act_type == 'Message'
if activity.course_act if activity.course_act
unless activity.course_act.parent_id.nil? unless activity.course_act.parent_id.nil?
parent_act = CourseActivity.where("course_act_id = #{activity.course_act.parent.id} and course_act_type='Message'").first parent_act = CourseActivity.where("course_act_id = #{activity.course_act.parent_id} and course_act_type='Message'").first
if parent_act if parent_act
parent_act.created_at = activity.course_act.parent.children.maximum("created_on") parent_act.created_at = activity.course_act.parent.children.maximum("created_on")
parent_act.save parent_act.save

View File

@ -446,63 +446,45 @@ function check_late_penalty(id)
} }
//验证匿评数量 //验证匿评数量
function regex_evaluation_num() //function regex_evaluation_num()
{ //{
if($("#evaluation_num").length == 0){ return true;} // if($("#evaluation_num").length == 0){ return true;}
var evaluation_num = $.trim($("#evaluation_num").val()); // var evaluation_num = $.trim($("#evaluation_num").val());
var regex = /^\d+$/; // var regex = /^\d+$/;
if(evaluation_num=="") // if(evaluation_num=="")
{ // {
$("#evaluation_num_notice").html("匿评分配数量不能为空"); // $("#evaluation_num_notice").html("匿评分配数量不能为空");
$("#evaluation_num_notice").removeClass("c_red").addClass("c_red"); // $("#evaluation_num_notice").removeClass("c_red").addClass("c_red");
return false; // return false;
} // }
else if(regex.test(evaluation_num)) // else if(regex.test(evaluation_num))
{ // {
if(evaluation_num > 0) // if(evaluation_num > 0)
{ // {
$("#evaluation_num_notice").html("每个学生将收到<span class='c_red'>&nbsp;"+ parseInt(evaluation_num) + "&nbsp;</span>份待匿评作品"); // $("#evaluation_num_notice").html("每个学生将收到<span class='c_red'>&nbsp;"+ parseInt(evaluation_num) + "&nbsp;</span>份待匿评作品");
$("#evaluation_num_notice").removeClass("c_red"); // $("#evaluation_num_notice").removeClass("c_red");
return true; // return true;
} // }
else // else
{ // {
$("#evaluation_num_notice").html("匿评分配数量必须为大于0"); // $("#evaluation_num_notice").html("匿评分配数量必须为大于0");
$("#evaluation_num_notice").removeClass("c_red").addClass("c_red"); // $("#evaluation_num_notice").removeClass("c_red").addClass("c_red");
return false; // return false;
} // }
} // }
else // else
{ // {
$("#evaluation_num_notice").html("匿评分配数量只能为数字"); // $("#evaluation_num_notice").html("匿评分配数量只能为数字");
$("#evaluation_num_notice").removeClass("c_red").addClass("c_red"); // $("#evaluation_num_notice").removeClass("c_red").addClass("c_red");
return false; // return false;
} // }
} //}
//点击是否开启匿评单选框效果 //点击是否开启匿评单选框效果
$(function(){ $(function(){
//$("#homework_common_homework_type").click(function(){
// if($("#homework_common_homework_type").attr("checked") == "checked")
// {
// $("#evaluation_setting").slideDown();
// $("#ta_proportion").removeAttr("disabled");
// }
// else
// {
// $("#evaluation_setting").slideUp();
// $("#ta_proportion").attr("disabled","disabled");
// }
//});
$("#absence_penalty").change(function(){ $("#absence_penalty").change(function(){
$("#absence_penalty_notice").html("&nbsp;"+ $("#absence_penalty").val() +"&nbsp;"); $("#absence_penalty_notice").html("&nbsp;"+ $("#absence_penalty").val() +"&nbsp;");
}); });
//$("#ta_proportion").change(function(){
// var ta_proportion = $("#ta_proportion").val();
// $("#student_proportion").val((100 - parseInt(ta_proportion * 100)) + "%");
//});
}); });
//生成select //生成select
@ -519,41 +501,101 @@ function build_selector(max_num){
return html; return html;
} }
//第一次加载时,如果未开启匿评作业,隐藏显示匿评配置信息 //提交匿评参数设置
//$(function(){ function submit_set_evaluation_attr(end_time){
// if($("#homework_common_homework_type").attr("id") != null && $("#homework_common_homework_type").val() != 2) if(!regex_evaluation_start(end_time)){
// { $("#evaluation_start_time").focus();
// if($("#homework_common_homework_type").attr("checked") == "checked")
// {
// $("#evaluation_setting").show();
// $("#ta_proportion").removeAttr("disabled");
// }
// else
// {
// $("#evaluation_setting").hide();
// $("#ta_proportion").attr("disabled","disabled");
// }
// }
//});
//老师提交 新建/修改 作业
function submit_homework(id)
{
if(!regex_homework_name())
{
$("#homework_name").focus();
} }
else if(!regex_evaluation_num()) else if(!regex_evaluation_end()){
{ $("#evaluation_end_time").focus();
}
else if(!regex_evaluation_num()){
$("#evaluation_num").focus(); $("#evaluation_num").focus();
} }
else else{
{ $('#popbox02 form').submit();
homework_description_editor.sync();
$("#"+id).submit();
} }
} }
//验证匿评开启时间:大于截止时间,或者为空
function regex_evaluation_start(end_time){
var evaluation_start = $.trim($("#evaluation_start_time").val());
if(evaluation_start == ""){
$("#homework_evaluation_start_time").text("开启匿评日期不能为空");
return false;
}
var end_time = new Date(end_time);
var evaluation_start_time = new Date(evaluation_start);
if(evaluation_start_time > end_time){
$("#homework_evaluation_start_time").text("");
return true;
}else{
$("#homework_evaluation_start_time").text("开启匿评日期必须大于截止日期");
return false;
}
}
//验证匿评结束时间:大于匿评开启时间,或者为空。当匿评开启时间为空时,匿评结束时间必须为空
function regex_evaluation_end(){
var evaluation_start = $.trim($("#evaluation_start_time").val());
var evaluation_end = $.trim($("#evaluation_end_time").val());
if(evaluation_end == ""){
$("#homework_evaluation_end_time").text("关闭匿评日期不能为空");
return true;
}
var evaluation_start_time = new Date(evaluation_start);
var evaluation_end_time = new Date(evaluation_end);
if(evaluation_end_time > evaluation_start_time){
$("#homework_evaluation_end_time").text("");
return true;
}else{
$("#homework_evaluation_end_time").text("关闭匿评日期必须大于开启匿评日期");
return false;
}
}
//验证匿评数量
function regex_evaluation_num(){
var evaluation_num = $.trim($("#evaluation_num").val());
var regex = /^\d+$/;
if(evaluation_num==""){
$("#evaluation_num_notice").text("匿评人数不能为空");
return false;
}
else if(regex.test(evaluation_num)){
if(evaluation_num > 0){
$("#evaluation_num_notice").html("");
return true;
}
else{
$("#evaluation_num_notice").text("匿评人数必须为大于0");
return false;
}
}
else{
$("#evaluation_num_notice").text("匿评人数只能为数字");
return false;
}
}
//老师提交 新建/修改 作业
//function submit_homework(id)
//{
// if(!regex_homework_name())
// {
// $("#homework_name").focus();
// }
// else if(!regex_evaluation_num())
// {
// $("#evaluation_num").focus();
// }
// else
// {
// homework_description_editor.sync();
// $("#"+id).submit();
// }
//}
function regexHomeworkCommonName() function regexHomeworkCommonName()
{ {
var name = $.trim($("#homework_attach_name").val()); var name = $.trim($("#homework_attach_name").val());
@ -661,7 +703,7 @@ $(document).ready(function () {
// 日历选择日期后关闭 // 日历选择日期后关闭
function regexDeadLine() function regexDeadLine()
{ {
('#ui-datepicker-div').hide; ('#ui-datepicker-div').hide();
} }
//新建、修改课程明码显示 //新建、修改课程明码显示

View File

@ -163,7 +163,7 @@ a.f_grey:hover {color:#000000;}
.resourcesIcon {margin-top:15px; display:block; width:25px; height:20px;} .resourcesIcon {margin-top:15px; display:block; width:25px; height:20px;}
.nolink_btn{ background:#BCBCBC; color: #fff; padding:2px 5px;} .nolink_btn{ background:#BCBCBC; color: #fff; padding:2px 5px;}
.more_btn{-moz-border-radius:3px; -webkit-border-radius:3px; border:1px solid #9DCEFF; color:#9DCEFF; border-radius:3px; padding:0px 3px;} .more_btn{-moz-border-radius:3px; -webkit-border-radius:3px; border:1px solid #9DCEFF; color:#9DCEFF; border-radius:3px; padding:0px 3px;}
.upbtn{ margin:42px 0 0 10px; border:none; color:#999; width:150px;} /*.upbtn{ margin:42px 0 0 10px; border:none; color:#999; width:150px;}*/
.red_btn_cir{ background:#e74c3c; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;} .red_btn_cir{ background:#e74c3c; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;}
.green_btn_cir{ background:#28be6c; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;} .green_btn_cir{ background:#28be6c; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;}
.grey_btn_cir{ background:#b2b2b2; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal; font-size:12px;} .grey_btn_cir{ background:#b2b2b2; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal; font-size:12px;}
@ -511,7 +511,7 @@ a:hover.st_add{ color:#ff8e15;}
.upimg{ border:1px solid #eaeaea; display:block; width:60px; height:60px; padding:1px;} .upimg{ border:1px solid #eaeaea; display:block; width:60px; height:60px; padding:1px;}
.upimg:hover{ border:1px solid #64bdd9; } .upimg:hover{ border:1px solid #64bdd9; }
.upbtn{ margin:40px 0 0 15px; display:block; padding:2px 5px; border:1px solid #eaeaea;} .upbtn{ margin:40px 0 0 15px; display:block; padding:2px 5px; border:1px solid #eaeaea;}
.upbtn:hover{border:1px solid #64bdd9; color:#64bdd9;cursor: pointer;} .upbtn:hover{color:#64bdd9;cursor: pointer;}
.upload_file{margin-left: -60px;margin-top: 40px;width: 50px;position: absolute;height: 24px;opacity: 0;cursor: pointer} .upload_file{margin-left: -60px;margin-top: 40px;width: 50px;position: absolute;height: 24px;opacity: 0;cursor: pointer}
/* 功能倒计时*/ /* 功能倒计时*/
.w_img{ float:left; margin:10px 10px 15px 0px;} .w_img{ float:left; margin:10px 10px 15px 0px;}

View File

@ -663,7 +663,7 @@ a.postReplyCancel:hover {color:#ffffff;}
.homepagePostSettiongText {width:85px; line-height:2; font-size:12px; color:#616060; background-color:#ffffff; border:1px solid #eaeaea; border-radius:3px; position:absolute; left:-68px; top:20px; padding:5px 0px; display:none;} .homepagePostSettiongText {width:85px; line-height:2; font-size:12px; color:#616060; background-color:#ffffff; border:1px solid #eaeaea; border-radius:3px; position:absolute; left:-68px; top:20px; padding:5px 0px; display:none;}
.homepagePostSettingIcon:hover {background:url(../images/homepage_icon.png) -93px -44px no-repeat;} .homepagePostSettingIcon:hover {background:url(../images/homepage_icon.png) -93px -44px no-repeat;}
a.postOptionLink {color:#616060; display:block; width:55px; padding:0px 15px;} a.postOptionLink {color:#616060; display:block; width:55px; padding:0px 15px;}
a.postOptionLink:hover {color:#ffffff; background-color:#15bccf;} a.postOptionLink:hover {color:#ffffff; background-color:#269ac9;}
.homepagePostReplyPortrait {float:left; width:33px;} .homepagePostReplyPortrait {float:left; width:33px;}
.imageFuzzy {filter:alpha(opacity=50); -moz-opacity:0.5; -khtml-opacity:0.5;opacity: 0.5;} .imageFuzzy {filter:alpha(opacity=50); -moz-opacity:0.5; -khtml-opacity:0.5;opacity: 0.5;}
.homepagePostReplyDes {float:left; width:632px; margin-left:15px;} .homepagePostReplyDes {float:left; width:632px; margin-left:15px;}
@ -796,7 +796,7 @@ a.sortArrowActiveU {background:url(images/post_image_list.png) -17px -20px no-re
.postDetailRow {width:720px; border-bottom:1px solid #efefef; padding:15px 0;} .postDetailRow {width:720px; border-bottom:1px solid #efefef; padding:15px 0;}
.postDetailPortrait {width:50px; height:50px; float:left; margin-right:15px;} .postDetailPortrait {width:50px; height:50px; float:left; margin-right:15px;}
.postDetailWrap {width:580px; float:left;} .postDetailWrap {width:580px; float:left;}
.postDetailTitle {width:650px; max-width:650px; margin-bottom:5px;} .postDetailTitle {width:580px; max-width:580px; margin-bottom:5px;}
.postDetailDes {width:580px; max-width:580px; margin-bottom:6px; color:#888888;display:block;overflow:hidden;word-break:keep-all;text-overflow:ellipsis;} .postDetailDes {width:580px; max-width:580px; margin-bottom:6px; color:#888888;display:block;overflow:hidden;word-break:keep-all;text-overflow:ellipsis;}
.postDetailCreater {color:#888888; font-size:12px; float:left; margin-right:25px;} .postDetailCreater {color:#888888; font-size:12px; float:left; margin-right:25px;}
.postDetailDate {color:#888888; font-size:12px; float:left;} .postDetailDate {color:#888888; font-size:12px; float:left;}

View File

@ -43,7 +43,7 @@ pre li,ul,ol {
} }
/* Specify class=linenums on a pre to get line numbering */ /* Specify class=linenums on a pre to get line numbering */
ol.linenums { margin-top: 0; margin-bottom: 0;line-height: 3px } /* IE indents via margin-left */ ol.linenums { margin-top: 0; margin-bottom: 0;line-height: 15px } /* IE indents via margin-left */
li.L0, li.L0,
li.L1, li.L1,
li.L2, li.L2,