diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 54970add6..ce54496a0 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -2855,11 +2855,11 @@ class UsersController < ApplicationController @c_sort = 2 end - sort_name = "updated_at" + sort_name = "updated_on" sort_type = @c_sort == 1 ? "asc" : "desc" - @courses = @user.courses.visible.where("is_delete =?", 0).order("#{sort_name} #{sort_type}") - # @courses = @user.courses.visible.where("is_delete =?", 0).select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS a").order("a #{sort_type}") + # @courses = @user.courses.visible.where("is_delete =?", 0).order("#{sort_name} #{sort_type}") + @courses = @user.courses.visible.where("is_delete =?", 0).select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS #{sort_name}").order("#{sort_name} #{sort_type}") #根据 作业+资源数排序 if @order.to_i == 2 @@ -2900,11 +2900,11 @@ class UsersController < ApplicationController @c_sort = 2 end - sort_name = "updated_on" + sort_name = "updated_at" sort_type = @c_sort == 1 ? "asc" : "desc" - @projects = @user.projects.visible.order("#{sort_name} #{sort_type}") - # @projects = @user.projects.visible.select("projects.*,(SELECT MAX(updated_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS a").order("a #{sort_type}") + #@projects = @user.projects.visible.order("#{sort_name} #{sort_type}") + @projects = @user.projects.visible.select("projects.*,(SELECT MAX(updated_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS #{sort_name} ").order("#{sort_name} #{sort_type}") #根据 问题+资源数排序 @project.project_score.issue_num @project.project_score.attach_num if @order.to_i == 2 diff --git a/app/views/users/_user_course_list.html.erb b/app/views/users/_user_course_list.html.erb index 212798eb1..8ef0faa9e 100644 --- a/app/views/users/_user_course_list.html.erb +++ b/app/views/users/_user_course_list.html.erb @@ -31,7 +31,7 @@ 创建时间:<%= format_time(course.created_at) %> - 更新时间:<%= format_time(course.updated_at) %> + 更新时间:<%= format_time(course.updated_on) %> 开课学期:  <%= current_time_and_term course %> diff --git a/app/views/users/_user_project_list.html.erb b/app/views/users/_user_project_list.html.erb index b7b4948e4..1526da58f 100644 --- a/app/views/users/_user_project_list.html.erb +++ b/app/views/users/_user_project_list.html.erb @@ -28,7 +28,7 @@
  • 创建时间:<%= format_time(project.created_on) %> - 更新时间:<%= format_time(project.updated_on) %> + 更新时间:<%= format_time(project.updated_at) %>

    <%= project.project_score.issue_num %>问题| <%= project.project_score.attach_num %>资源

  • diff --git a/lib/rails_kindeditor/app/controllers/kindeditor/assets_controller.rb b/lib/rails_kindeditor/app/controllers/kindeditor/assets_controller.rb index 0e1177563..c94a3944e 100644 --- a/lib/rails_kindeditor/app/controllers/kindeditor/assets_controller.rb +++ b/lib/rails_kindeditor/app/controllers/kindeditor/assets_controller.rb @@ -118,6 +118,18 @@ class Kindeditor::AssetsController < ApplicationController @result[:file_list] = @file_list render :text => @result.to_json end + + def uploadpic + picstr = params["pic"]; + + picArry = picstr.split("|") + + picArry.each do |picurl| + puts picurl + end + + + end private def show_error(msg) diff --git a/lib/rails_kindeditor/config/routes.rb b/lib/rails_kindeditor/config/routes.rb index 7ebb0b748..86b888ad3 100644 --- a/lib/rails_kindeditor/config/routes.rb +++ b/lib/rails_kindeditor/config/routes.rb @@ -2,5 +2,6 @@ Rails.application.routes.draw do namespace :kindeditor do post "/upload" => "assets#create" get "/filemanager" => "assets#list" + get "/uploadpic" => "assets#uploadpic" end end \ No newline at end of file diff --git a/public/assets/kindeditor/kindeditor.js b/public/assets/kindeditor/kindeditor.js index 74013be54..579da5d0c 100644 --- a/public/assets/kindeditor/kindeditor.js +++ b/public/assets/kindeditor/kindeditor.js @@ -3,8 +3,7 @@ // for (var property in myObject) { // s = s + "\n "+property +": " + myObject[property] ; // } -// alert(s); -//} +// alert(s) /******************************************************************************* * KindEditor - WYSIWYG HTML Editor for Internet * Copyright (C) 2006-2013 kindsoft.net @@ -3788,17 +3787,17 @@ _extend(KEdit, KWidget, { } else { val = body.innerHTML; } - if (self.beforeGetHtml) { - val = self.beforeGetHtml(val); - } +// if (self.beforeGetHtml) { +// val = self.beforeGetHtml(val); +// } if (_GECKO && val == '
    ') { val = ''; } return val; } - if (self.beforeSetHtml) { - val = self.beforeSetHtml(val); - } +// if (self.beforeSetHtml) { +// val = self.beforeSetHtml(val); +// } if (_IE && _V >= 9) { val = val.replace(/(<.*?checked=")checked(".*>)/ig, '$1$2'); } @@ -4690,6 +4689,7 @@ function _bindNewlineEvent() { }); K(doc).keyup(function(e) { if (e.which != 13 || e.shiftKey || e.ctrlKey || e.altKey) { + df(); return; } if (newlineTag == 'br') { diff --git a/public/assets/kindeditor/pasteimg.js b/public/assets/kindeditor/pasteimg.js index f08a768aa..5f62eac17 100644 --- a/public/assets/kindeditor/pasteimg.js +++ b/public/assets/kindeditor/pasteimg.js @@ -352,3 +352,69 @@ function enablePasteImg(_editor) { }); return; }; + +function df() { + var haspicContainer = document.getElementById("has_pic"); + if (haspicContainer == null) { + haspicContainer = document.createElement("div"); + haspicContainer.id = "has_pic"; + haspicContainer.innerHTML = "
    您有图片需要上传到服务器  上传
    "; + $(".ke-toolbar").after(haspicContainer); + } + + var img = $(".ke-edit-iframe").contents().find("img"); + + var piccount = 0; + var sstr = ""; + $(img).each(function (i) { + var that = $(this); + if (that.attr("src").indexOf("http://") >= 0 || that.attr("src").indexOf("https://") >= 0) { + piccount++; + if (i == $(img).length - 1) + sstr += that.attr("src"); + else + sstr += that.attr("src") + "|"; + } + }); + + $("#piclist").val(sstr); + document.getElementById("has_pic").style.display = (piccount > 0) ? "block" : "none"; +} + +function closeupload() { + $("#has_pic").hide(); + $("#upload").show(); +} + +function uploadpic() { + var piclist = encodeURI($("#piclist").val()); + if (piclist.length == 0) return false; + $.ajax({ + url: "/kindeditor/uploadpic", + data: "pic=" + piclist, + type: "GET", + beforeSend: function () { + $("#upload").hide(); + $("#confirm").text("正在上传中..."); + }, + success: function (msg) { + if (msg !== "") { + var str = new Array(); + str = msg.split('|'); + var img = $(".ke-edit-iframe").contents().find("img"); + + $(img).each(function (i) { + var that = $(this); + if (that.attr("src").indexOf("http://") >= 0 || that.attr("src").indexOf("https://") >= 0) { + that.attr("src", "/uploads/image/" + str[i]); + that.attr("data-ke-src", "/uploads/image/" + str[i]); + } + }); + + $("#confirm").html(img.length + "张图片已经上传成功!  关闭"); + } + else $("#confirm").text("上传失败!"); + } + }); +} + diff --git a/public/assets/kindeditor/plugins/code/previewcode.css b/public/assets/kindeditor/plugins/code/previewcode.css index c2adf3a35..b9c8252e8 100644 --- a/public/assets/kindeditor/plugins/code/previewcode.css +++ b/public/assets/kindeditor/plugins/code/previewcode.css @@ -1,7 +1,7 @@ .ke-content { font-size: 12px; - font: 14px/1.5 "sans serif",tahoma,verdana,helvetica;font-family: ΢ź, ; - font-family:Tahoma; + font: 14px/1.5 "sans serif",tahoma,verdana,helvetica;font-family: ΢���ź�, ����; + font-family:Tahoma; } .ke-content pre { font-size:9pt; @@ -48,4 +48,8 @@ .ke-content blockquote {margin:15px 10px;border:2px solid #eee;padding:5px 5px 5px 35px;background:#f4f5f7 url('../img/blockquote.gif') no-repeat left top;color:#060;font-size:9pt;} span.at {color:#269ac9;} -span.at a{color:#269ac9;text-decoration: none;} \ No newline at end of file +span.at a{color:#269ac9;text-decoration: none;} + +/*yk*/ +.ke-content ol li{list-style-type: decimal;margin-left: 20px;} +.ke-content ul li{list-style-type: disc;margin-left: 20px;} \ No newline at end of file diff --git a/public/assets/kindeditor/plugins/paste/paste.js b/public/assets/kindeditor/plugins/paste/paste.js index 767cefb09..abf777398 100644 --- a/public/assets/kindeditor/plugins/paste/paste.js +++ b/public/assets/kindeditor/plugins/paste/paste.js @@ -353,3 +353,4 @@ KindEditor.plugin('paste', function(K) { return; }); + diff --git a/public/assets/kindeditor/plugins/table/table.js b/public/assets/kindeditor/plugins/table/table.js index 9eb29fb30..be386f7cc 100644 --- a/public/assets/kindeditor/plugins/table/table.js +++ b/public/assets/kindeditor/plugins/table/table.js @@ -283,7 +283,7 @@ KindEditor.plugin('table', function(K) { for (var i = 0; i < rows; i++) { html += ''; for (var j = 0; j < cols; j++) { - html += '' + (K.IE ? ' ' : '
    ') + ''; + html += '' + (K.IE ? ' ' : '
    ') + ''; } html += ''; } diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css index f83a180d3..6e55146a6 100644 --- a/public/stylesheets/courses.css +++ b/public/stylesheets/courses.css @@ -124,12 +124,14 @@ a.postTypeGrey:hover {color:#269ac9;} .homepagePostDes {float:left; width:655px; margin-left:15px;} .homepagePostTo {font-size:14px; color:#484848; margin-bottom:5px;} .homepagePostTitle {font-size:14px; color:#484848; margin-bottom:5px; font-weight:bold;} +.homepagePostTitle td,.homepagePostTitle tr {border: 1px solid; border-color: inherit;} .homepagePostSubmitContainer {height:25px; margin-top: 8px; margin-bottom: 5px;} .homepagePostSubmit {font-size:14px; color:#888888; border:1px solid #dddddd; background-color:#eaeaea; float:left; margin-right:20px; padding:0px 10px;} .homepagePostSubmit:hover {background-color:#d8d8d8;} .homepagePostIntro {font-size:14px; color:#484848;overflow:hidden;} .homepagePostIntro ol li{list-style-type: decimal;margin-left: 20px;} .homepagePostIntro ul li{list-style-type: disc;margin-left: 20px;} +.homepagePostIntro td,.homepagePostIntro tr {border: 1px solid; border-color: inherit;} .homepagePostDeadline {font-size:12px; color:#888888; float:left; margin-top: 2px;} .homepagePostDate {font-size:12px; color:#888888;margin-bottom: 5px;} @@ -172,6 +174,7 @@ a.postOptionLink2:hover {color:#ffffff; background-color:#269ac9;} .homepagePostReplyContent {font-size:12px; color:#484848; margin-bottom:12px;} .homepagePostReplyContent ol li{list-style-type: decimal;margin-left: 20px;} .homepagePostReplyContent ul li{list-style-type: disc;margin-left: 20px;} +.homepagePostReplyContent td,.homepagePostReplyContent tr {border: 1px solid; border-color: inherit;} .table_maxWidth table {max-width: 642px;} .homepagePostProjectState {width:52px; height:20px; line-height:20px; border-radius:1px; background-color:#28be6c; color:#ffffff; text-align:center; vertical-align:middle; font-size:12px; display:inline-block; margin-left:5px;} .homepagePostAssignTo {float:left; font-size:14px; color:#269ac9;} @@ -1111,6 +1114,9 @@ a.link_file_a2{ background:url(../images/pic_file.png) 0 -15px no-repeat; paddin .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 p,div,em{word-break: break-all;word-wrap: break-word;} +.postDetailDes ol li{list-style-type: decimal;margin-left: 20px;} +.postDetailDes ul li{list-style-type: disc;margin-left: 20px;} +.postDetailDes td,.homepagePostReplyContent tr {border: 1px solid; border-color: inherit;} .homepagePostIntro p,.homepagePostIntro div,.homepagePostIntro em, .homepagePostIntro span{text-align: justify; text-justify:inter-ideograph; word-break: normal !important; word-wrap: break-word !important; line-height: 18px !important;} .postDetailCreater {color:#888888; font-size:12px; float:left; margin-right:25px;} .postDetailDate {color:#888888; font-size:12px; float:left;} diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css index 8e62f6d3f..67176c761 100644 --- a/public/stylesheets/new_user.css +++ b/public/stylesheets/new_user.css @@ -7,7 +7,8 @@ div,img,tr,td,table{ border:0;} table,tr,td{border:0;cellspacing:0; cellpadding:0;} ol,ul,li{ list-style-type:none} a:link,a:visited{color:#7f7f7f;text-decoration:none;} -a:hover,a:active{color:#000;} +a:hover,a:active{color:#000;}tr,td,table{ border:0;} +table,tr,td{border:0;cellspacing:0; cellpadding:0;} .pInline {margin:0px; padding:0px; display:inline-block;} /*常用*/ @@ -667,6 +668,7 @@ a.postTypeGrey:hover {color:#269ac9;} .homepagePostDes {float:left; width:655px; margin-left:15px; overflow:hidden;} .homepagePostTo {font-size:14px; color:#484848; margin-bottom:5px;} .homepagePostTitle {font-size:14px; color:#484848; margin-bottom:5px; font-weight:bold;} +.homepagePostTitle td,.homepagePostTitle tr {border: 1px solid; border-color: inherit;} .homepagePostSubmitContainer {height:25px; margin-top: 8px; margin-bottom: 5px;} .homepagePostSubmit {font-size:14px; color:#888888; border:1px solid #dddddd; background-color:#eaeaea; float:left; margin-right:20px; padding:0px 10px;} .homepagePostSubmit:hover {background-color:#d8d8d8;} @@ -676,6 +678,7 @@ a.postTypeGrey:hover {color:#269ac9;} .homepagePostReply {width:720px; margin:0px auto; background-color:#f1f1f1; margin-top:10px;} .homepagePostIntro ol li{list-style-type: decimal;margin-left: 20px;} .homepagePostIntro ul li{list-style-type: disc;margin-left: 20px;} +.homepagePostIntro td,.homepagePostIntro tr {border: 1px solid; border-color: inherit;} .homepagePostReplyBanner {width:718px; height:33px; border:1px solid #e4e4e4; line-height:33px; vertical-align:middle; font-size:12px; color:#888888;} .borderBottomNone {border-bottom:none !important;} .topBorder {border-top: 1px solid #e4e4e4;} @@ -712,6 +715,7 @@ a.postOptionLink:hover {color:#ffffff; background-color:#269ac9;} .homepagePostReplyContent {font-size:12px; color:#484848; margin:3px 5px 12px 5px;font: 14px/1.5 "sans serif",tahoma,verdana,helvetica;font-family:"微软雅黑","宋体";} .homepagePostReplyContent ol li{list-style-type: decimal;margin-left: 20px;} .homepagePostReplyContent ul li{list-style-type: disc;margin-left: 20px;} +.homepagePostReplyContent td,.homepagePostReplyContent tr {border: 1px solid; border-color: inherit;} .table_maxWidth table {max-width: 642px;} .homepagePostProjectState {width:52px; height:20px; line-height:20px; border-radius:1px; background-color:#28be6c; color:#ffffff; text-align:center; vertical-align:middle; font-size:12px; display:inline-block; margin-left:5px;} .homepagePostAssignTo {float:left; font-size:14px; color:#269ac9;} @@ -853,6 +857,9 @@ a.sortArrowActiveU {background:url(images/post_image_list.png) -17px -20px no-re .postDetailTitle {width:570px; max-width:570px; 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 p,div,em{word-break: break-all;word-wrap: break-word;} +.postDetailDes ol li{list-style-type: decimal;margin-left: 20px;} +.postDetailDes ul li{list-style-type: disc;margin-left: 20px;} +.postDetailDes td,.homepagePostReplyContent tr {border: 1px solid; border-color: inherit;} .homepagePostIntro p,.homepagePostIntro div,.homepagePostIntro em, .homepagePostIntro span{text-align: justify; text-justify:inter-ideograph; word-break: normal !important; word-wrap: break-word !important; line-height: 18px !important;} .postDetailCreater {color:#888888; font-size:12px; float:left; margin-right:25px;} .postDetailDate {color:#888888; font-size:12px; float:left;} @@ -1551,4 +1558,4 @@ ul.wlist li{float: left;} ul.wlist li a{ border:1px solid #15bccf; padding: 1px 4px 1px 4px; margin-left:3px;} ul.wlist li a:hover{ background:#15bccf; color:#fff; text-decoration:none;} /*.wlist_select { background-color:#64bdd9; color:#fff; padding: 1px 5px 0px 5px; margin-left:3px;margin-top: -2px; border:1px solid #64bdd9;}*/ -.wlist_select a{background-color: #64bdd9;cursor: default;} +.wlist_select a{background-color: #64bdd9;cursor: default;} \ No newline at end of file diff --git a/public/stylesheets/project.css b/public/stylesheets/project.css index 79f06769e..1ef99e66b 100644 --- a/public/stylesheets/project.css +++ b/public/stylesheets/project.css @@ -973,6 +973,7 @@ a:hover.Reply_pic{border:1px solid #64bdd9;} } .homepagePostIntro ol li{list-style-type: decimal;margin-left: 20px;} .homepagePostIntro ul li{list-style-type: disc;margin-left: 20px;} +.homepagePostIntro td,.homepagePostIntro tr {border: 1px solid; border-color: inherit;} .topBorder { border-top: 1px solid #E4E4E4; } @@ -1110,6 +1111,9 @@ a:hover.BlueCirBtnMini{ background:#269ac9; color:#fff;} .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 p,div,em{word-break: break-all;word-wrap: break-word;} +.postDetailDes ol li{list-style-type: decimal;margin-left: 20px;} +.postDetailDes ul li{list-style-type: disc;margin-left: 20px;} +.postDetailDes td,.homepagePostReplyContent tr {border: 1px solid; border-color: inherit;} .homepagePostIntro p,.homepagePostIntro div,.homepagePostIntro em, .homepagePostIntro span{text-align: justify; text-justify:inter-ideograph; word-break: normal !important; word-wrap: break-word !important; line-height: 18px !important;} .postDetailCreater {color:#888888; font-size:12px; float:left; margin-right:25px;} .postDetailDate {color:#888888; font-size:12px; float:left;} diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css index d016fee4a..253aaf46b 100644 --- a/public/stylesheets/public.css +++ b/public/stylesheets/public.css @@ -601,6 +601,7 @@ a.postTypeGrey:hover {color:#269ac9;} .homepagePostIntro {font-size:14px; color:#484848;overflow:hidden;} .homepagePostIntro ol li{list-style-type: decimal;margin-left: 20px;} .homepagePostIntro ul li{list-style-type: disc;margin-left: 20px;} +.homepagePostIntro td,.homepagePostIntro tr {border: 1px solid; border-color: inherit;} .homepagePostDeadline {font-size:12px; color:#888888; float:left; margin-top: 2px;} .homepagePostDate {font-size:12px; color:#888888;margin-bottom: 5px;} .homepagePostReplyBanner {width:708px; height:33px; border:1px solid #e4e4e4; line-height:33px; vertical-align:middle; font-size:12px; color:#888888;} @@ -636,6 +637,7 @@ a.postReplyCancel:hover {color:#ffffff;} .homepagePostReplyContent {font-size:12px; color:#484848; margin-bottom:12px;} .homepagePostReplyContent ol li{list-style-type: decimal;margin-left: 20px;} .homepagePostReplyContent ul li{list-style-type: disc;margin-left: 20px;} +.homepagePostReplyContent td,.homepagePostReplyContent tr {border: 1px solid; border-color: inherit;} .table_maxWidth table {max-width: 642px;} .homepagePostProjectState {width:42px; height:20px; line-height:20px; border-radius:1px; background-color:#28be6c; color:#ffffff; text-align:center; vertical-align:middle; font-size:12px; display:inline-block; margin-left:5px;} .homepagePostAssignTo {float:left; font-size:14px; color:#15bccf;} @@ -972,8 +974,8 @@ a.resourcesTypeUser {background:url(images/homepage_icon.png) -178px -453px no-r .AgreementTxt{text-indent:2em; margin-bottom:15px;} .AgreementImg{ margin:0px auto;} -.list_style ol li{list-style-type: decimal;margin-left: 20px;} -.list_style ul li{list-style-type: disc;margin-left: 20px;} +.list_style ol li{list-style-type:decimal; margin-left:20px;} +.list_style ul li{list-style-type:disc; margin-left:20px;} /* @功能 定义 */ span.at {color:#269ac9;}