From ad0b14b7684990e8240ac79caf1f480355a9a20c Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Wed, 26 Aug 2015 22:11:39 +0800 Subject: [PATCH 01/65] schema --- db/schema.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/db/schema.rb b/db/schema.rb index 6aa6da41d..e2eec5d6b 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -1535,6 +1535,7 @@ ActiveRecord::Schema.define(:version => 20150826061843) do t.string "identity_url" t.string "mail_notification", :default => "", :null => false t.string "salt", :limit => 64 + t.integer "gid" end add_index "users", ["auth_source_id"], :name => "index_users_on_auth_source_id" From 3ae4d012849cb7c56be40310e554da139c0b23d9 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Wed, 26 Aug 2015 20:23:17 +0800 Subject: [PATCH 02/65] . --- app/controllers/homework_common_controller.rb | 45 ++++++++----------- app/views/homework_common/new.html.erb | 25 +++++++++++ 2 files changed, 44 insertions(+), 26 deletions(-) diff --git a/app/controllers/homework_common_controller.rb b/app/controllers/homework_common_controller.rb index 87c1e288b..2e9925916 100644 --- a/app/controllers/homework_common_controller.rb +++ b/app/controllers/homework_common_controller.rb @@ -115,23 +115,16 @@ class HomeworkCommonController < ApplicationController end end - # uri = URI('http://test.gitlab.trustie.net/api/questions.json') - # req = Net::HTTP::Post.new(uri, initheader = {'Content-Type' =>'application/json'}) - # req.body = question.to_json - # res = Net::HTTP.start(uri.hostname, uri.port) do |http| - # http.request(req) + # uri = URI('http://192.168.80.21:8080/api/questions.json') + # body = question.to_json + # res = Net::HTTP.new(uri.host, uri.port).start do |client| + # request = Net::HTTP::Post.new(uri.path) + # request.body = body + # request["Content-Type"] = "application/json" + # client.request(request) # end - - uri = URI('http://192.168.80.21:8080/api/questions.json') - body = question.to_json - res = Net::HTTP.new(uri.host, uri.port).start do |client| - request = Net::HTTP::Post.new(uri.path) - request.body = body - request["Content-Type"] = "application/json" - client.request(request) - end - result = JSON.parse(res.body) - homework_detail_programing.question_id = result["id"] if result["status"] && result["status"] == 0 + # result = JSON.parse(res.body) + # homework_detail_programing.question_id = result["id"] if result["status"] && result["status"] == 0 homework.homework_detail_programing = homework_detail_programing else @@ -254,15 +247,15 @@ class HomeworkCommonController < ApplicationController question[:input] << test.input question[:output] << test.output end - uri = URI("http://192.168.80.21:8080/api/questions/#{@homework_detail_programing.question_id}.json") - body = question.to_json - res = Net::HTTP.new(uri.host, uri.port).start do |client| - request = Net::HTTP::Put.new(uri.path) - request.body = body - request["Content-Type"] = "application/json" - client.request(request) - end - result = JSON.parse(res.body) + # uri = URI("http://192.168.80.21:8080/api/questions/#{@homework_detail_programing.question_id}.json") + # body = question.to_json + # res = Net::HTTP.new(uri.host, uri.port).start do |client| + # request = Net::HTTP::Put.new(uri.path) + # request.body = body + # request["Content-Type"] = "application/json" + # client.request(request) + # end + # result = JSON.parse(res.body) end @homework.save_attachments(params[:attachments]) @@ -406,4 +399,4 @@ class HomeworkCommonController < ApplicationController student_works += student_works student_works[index + 1 .. index + n] end -end \ No newline at end of file +end diff --git a/app/views/homework_common/new.html.erb b/app/views/homework_common/new.html.erb index 6fc0fff0e..464490462 100644 --- a/app/views/homework_common/new.html.erb +++ b/app/views/homework_common/new.html.erb @@ -14,4 +14,29 @@ <%= link_to '取消',homework_common_index_path(:course => @course.id),:class => 'grey_btn fl'%> <% end%> + + + +
第<%= @student_work.student_work_tests.count - index%>次测试
<%= format_time(test.created_at) %> +第<%= @student_work.student_work_tests.count - index%>次测试
<%= test.created_at.to_s(:db) %>t |
From acf5db70674d8e6bfa70cdcab6306bb706d6143e Mon Sep 17 00:00:00 2001
From: suntao <719450423@qq.com>
Date: Mon, 31 Aug 2015 17:50:50 +0800
Subject: [PATCH 11/65] =?UTF-8?q?placeholder=E6=98=BE=E7=A4=BA=E7=AD=89?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/account/lost_password.html.erb | 2 +-
app/views/users/_user_homework_form.html.erb | 2 +-
public/stylesheets/new_user.css | 14 +++++++-------
3 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/app/views/account/lost_password.html.erb b/app/views/account/lost_password.html.erb
index 0e4ddd1ff..9881dd186 100644
--- a/app/views/account/lost_password.html.erb
+++ b/app/views/account/lost_password.html.erb
@@ -1,6 +1,6 @@
<%= stylesheet_link_tag 'new_user'%>
-
+ 忘记密码
diff --git a/app/views/users/_user_homework_form.html.erb b/app/views/users/_user_homework_form.html.erb
index 8340306e0..ef3cbca3e 100644
--- a/app/views/users/_user_homework_form.html.erb
+++ b/app/views/users/_user_homework_form.html.erb
@@ -9,7 +9,7 @@
<%= link_to "导入作业", user_import_homeworks_user_path(User.current.id),:class => "BlueCirBtn fl mr10",:remote => true%>
diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css
index 13cff4a66..19cfafd0d 100644
--- a/public/stylesheets/new_user.css
+++ b/public/stylesheets/new_user.css
@@ -405,7 +405,7 @@ a.resourcesTypeAtt {background:url(images/homepage_icon.png) -180px -49px no-rep
/*.resourcesUploadBox:hover {background-color:#0781b4;}*/
/* 个人主页右边部分*/
.homepageSearchIcon {width:30px; height:32px; background:url(images/nav_icon.png) -8px 3px no-repeat; float:left;}
-input.homepageSearchIcon:hover {cursor: pointer;}
+input.homepageSearchIcon:hover {cursor: pointer;background:url(../images/nav_icon.png) -49px 3px no-repeat;}
a.homepagePostTypeQuiz {background:url(images/homepage_icon.png) -90px -124px no-repeat; padding-left:23px;}
a.homepagePostTypeAssignment {background:url(images/homepage_icon.png) -93px -318px no-repeat; padding-left:23px;}
a.replyGrey {color:#888888; display:inline-block;}
@@ -532,8 +532,8 @@ a.coursesLineGrey:hover {color:#ffffff;}
a.homepageMenuText {color:#484848; font-size:16px; margin-left:20px;}
.homepageLeftLabelContainer {width:238px; border:1px solid #dddddd; background-color:#ffffff; margin-top:10px;}
.homepageLabelText {color:#484848; font-size:16px; margin-left:10px; margin-bottom:12px; display:block;}
-.homepageRightBanner {width:720px; height:30px; margin:0px auto;}
-.NewsBannerName {font-size:16px; color:#4b4b4b; display:block; width:150px; float:left; margin-top:4px;}
+.homepageRightBanner {width:720px; margin:0px auto;}
+.NewsBannerName {font-size:16px; color:#4b4b4b; display:block; width:150px; float:left;}
.newsType {width:60px; background-color:#ffffff; float:left; list-style:none; position:absolute; border:1px solid #eaeaea; border-radius:5px; top:15px; padding:5px 10px; left:-40px; font-size:12px; color:#888888; display:none; line-height:2; z-index:9999;}
.newsReadSetting {width:700px; background-color:#f6f6f6; border-bottom:1px solid #eeeeee; margin:10px auto; height:39px; line-height:39px; vertical-align:middle; font-size:14px; color:#7a7a7a; padding-left:10px;}
.homepageNewsList {width:710px; height:49px; line-height:49px; vertical-align:middle; border-bottom:1px dashed #eaeaea; margin-left:10px;}
@@ -611,7 +611,7 @@ a.postOptionLink:hover {color:#ffffff; background-color:#269ac9;}
.homepagePostReplyPublisher {font-size:12px; color:#484848; margin-bottom:12px;}
.homepagePostReplyContent {font-size:12px; color:#484848; margin-bottom:12px;}
.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; height:30px; line-height:30px; vertical-align:middle;}
+.homepagePostAssignTo {float:left; font-size:14px; color:#269ac9;}
.homepagePostFileAtt {height:22px; line-height:22px; vertical-align:middle; background:url(../images/homepage_icon.png) -85px -150px no-repeat; padding-left:35px; font-size:14px; margin-right:25px;}
.homepagePostImageAtt {height:22px; line-height:22px; vertical-align:middle; background:url(../images/homepage_icon.png) -86px -195px no-repeat; padding-left:35px; font-size:14px; margin-right:25px;}
.postAttSize {color:#888888; font-size:12px;}
@@ -689,9 +689,9 @@ a.referenceTypeBlock {color:#888888; display:inline-block; padding:0px 20px;}
/*20150826忘记密码 LB*/
-.BgBox{ width:968px; border:1px solid #dddddd; background:#fff; padding:15px; padding-top:10px;margin: 20px auto}
+.BgBox{ width:968px; border:1px solid #dddddd; background:#fff; padding:15px; padding-top:10px;margin: 10px auto 20px auto;}
.BgBox_h2{ font-size:16px; color:#484848; width:968px;border-bottom:1px solid #e3e3e3; padding-bottom:5px;}
-.NomalInput{width:308px; height:38px; border:1px solid #98a1a6; outline:none; color:#888888; font-size:14px;}
+.NomalInput{width:308px; height:38px; border:1px solid #98a1a6 !important; outline:none; color:#888888; font-size:14px;}
.BgBoxCon{ width:310px; margin:80px auto;}
.BgBoxConP{ font-size:14px; color:#484848;}
.LoginButton {width:315px; height:40px; background-color:#269ac9; font-size:14px; text-align:center; line-height:40px; vertical-align:middle;}
@@ -870,7 +870,7 @@ a.box_close{background:url(../images/img_floatbox.png) -22px 0 no-repeat;}
.uppic_btn:hover {background-color: #329cbd;}
/*20150820课程作业 LB*/
-.HomeWork {width:708px; background-color:#ffffff; padding:15px; border:1px solid #dddddd;}
+.HomeWork {width:718px; background-color:#ffffff; padding:15px; border:1px solid #dddddd;}
.RightBanner {width:708px; height:34px; border-bottom:1px solid #e9e9e9;}
select.InputBox,input.InputBox,textarea.InputBox{ border:1px solid #d9d9d9; color:#888888; height:28px; line-height:28px; padding-left:5px; font-size:14px;}
a.BlueCirBtn{ display:block;width:75px; height:28px; background-color:#ffffff; line-height:28px; vertical-align:middle; text-align:center; border:1px solid #15bccf; color:#15bccf; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px;}
From e917a68bd3eb4d5f946bd481e3ac98a153c8b192 Mon Sep 17 00:00:00 2001
From: suntao <719450423@qq.com>
Date: Tue, 1 Sep 2015 09:13:34 +0800
Subject: [PATCH 12/65] =?UTF-8?q?=E6=B6=88=E6=81=AF=E9=A1=B5=E9=9D=A2li?=
=?UTF-8?q?=E9=97=B4=E8=B7=9D=E8=B0=83=E6=95=B4=EF=BC=8C=E5=9B=9E=E5=A4=8D?=
=?UTF-8?q?=E5=9D=97=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
public/stylesheets/new_user.css | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css
index e719e557b..1e729cce2 100644
--- a/public/stylesheets/new_user.css
+++ b/public/stylesheets/new_user.css
@@ -539,9 +539,9 @@ a.homepageMenuText {color:#484848; font-size:16px; margin-left:20px;}
.homepageNewsList {width:710px; height:49px; line-height:49px; vertical-align:middle; border-bottom:1px dashed #eaeaea; margin-left:10px;}
.homepageNewsPortrait {width:40px; display:block; margin-top:7px;}
.homepageNewsPublisher { max-width:100px; font-size:12px; color:#269ac9; display:block; padding-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; float:left; }
-.homepageNewsType {width:100px; padding-left: 5px; font-size:12px; color:#888888; display:block;}
-.homepageNewsPubType {width:215px; font-size:12px; color:#888888; display: block;}
-.homepageNewsContent {width:355px; max-width:395px; margin-right:10px; font-size:12px; color:#4b4b4b; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;max-height: 49px; }
+.homepageNewsType {width:110px; padding-left: 5px; font-size:12px; color:#888888; display:block;}
+.homepageNewsPubType {width:220px; font-size:12px; color:#888888; display: block;}
+.homepageNewsContent {width:365px; max-width:365px; margin-right:10px; font-size:12px; color:#4b4b4b; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;max-height: 49px; }
.homepageNewsTime {width:75px; font-size:12px; color:#888888; display:block; text-align:right;}
a.homepageWhite {color:#ffffff;}
a.homepageWhite:hover {color:#a1ebff}
@@ -608,7 +608,7 @@ a.postOptionLink {color:#616060; display:block; width:55px; padding:0px 15px;}
a.postOptionLink:hover {color:#ffffff; background-color:#269ac9;}
.homepagePostReplyPortrait {float:left; width:45px;}
.homepagePostReplyDes {float:left; width:595px; margin-left:15px;}
-.homepagePostReplyPublisher {font-size:12px; color:#484848; margin-bottom:12px;}
+.homepagePostReplyPublisher {font-size:12px; color:#484848; margin-bottom:5px;}
.homepagePostReplyContent {font-size:12px; color:#484848; margin-bottom:12px;}
.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;}
From b3919256fa22f002e56ef796f6c207912d9ce111 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Tue, 1 Sep 2015 09:17:12 +0800
Subject: [PATCH 13/65] 111
---
app/controllers/users_controller.rb | 2 -
app/views/users/_course_news.html.erb | 23 +--------
app/views/users/_user_activities.html.erb | 58 -----------------------
3 files changed, 1 insertion(+), 82 deletions(-)
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index 0058e6e4c..5260cd8d1 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -627,9 +627,7 @@ class UsersController < ApplicationController
end
def show
-
@page = params[:page] ? params[:page].to_i + 1 : 0
-
user_project_ids = @user.projects.visible.empty? ? "(-1)" : "(" + @user.projects.visible.map{|project| project.id}.join(",") + ")"
user_course_ids = @user.courses.visible.empty? ? "(-1)" : "(" + @user.courses.visible.map{|course| course.id}.join(",") + ")"
course_types = "('Message','News','HomeworkCommon','poll')"
diff --git a/app/views/users/_course_news.html.erb b/app/views/users/_course_news.html.erb
index d6c32def6..bc090fa03 100644
--- a/app/views/users/_course_news.html.erb
+++ b/app/views/users/_course_news.html.erb
@@ -1,4 +1,4 @@
-
-
+
<%= calendar_for('homework_end_time')%>
+
<%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id), :alt => "用户头像" %>
@@ -42,25 +42,7 @@
<%if count>2 %>
<% end %>
-
- <%#= render :partial => 'course_news_reply',:locals => { :contest => @contest, :journals => @jour, :state => false}%>
-
-
<% replies_all_i = 0 %>
<% unless activity.comments.empty? %>
@@ -79,9 +61,6 @@
<%= link_to comment.try(:author).try(:realname), user_path(comment.author_id), :class => "newsBlue mr10 f14" %>
<% end %>
<%= format_date(comment.created_on) %>
- <%#= link_to_if_authorized_course l(:button_delete), {:controller => 'comments', :action => 'destroy', :id => activity, :comment_id => comment},
- :data => {:confirm => l(:text_are_you_sure)}, :method => :delete, :title => l(:button_delete) %>
-
<%= comment.comments.html_safe %>
diff --git a/public/javascripts/init_KindEditor.js b/public/javascripts/init_KindEditor.js
new file mode 100644
index 000000000..38aabda79
--- /dev/null
+++ b/public/javascripts/init_KindEditor.js
@@ -0,0 +1,100 @@
+function init_editor(params){
+ var editor = params.kindutil.create(params.textarea, {
+ resizeType : 1,minWidth:"1px",width:"100%",height:"80px",
+ items:['emoticons'],
+ afterChange:function(){//按键事件
+ nh_check_field({content:this,contentmsg:params.contentmsg,textarea:params.textarea});
+ },
+ afterCreate:function(){
+ var toolbar = $("div[class='ke-toolbar']",params.div_form);
+ $(".ke-outline>.ke-toolbar-icon",toolbar).append('表情');
+ params.toolbar_container.append(toolbar);
+ }
+ }).loadPlugin('paste');
+ return editor;
+}
+
+function nh_check_field(params){
+ var result=true;
+ if(params.content!=undefined){
+ if(params.content.isEmpty()){
+ result=false;
+ }
+ if(params.content.html()!=params.textarea.html() || params.issubmit==true){
+ params.textarea.html(params.content.html());
+ params.content.sync();
+ if(params.content.isEmpty()){
+ params.contentmsg.html('内容不能为空');
+ params.contentmsg.css({color:'#ff0000'});
+ }else{
+ params.contentmsg.html('填写正确');
+ params.contentmsg.css({color:'#008000'});
+ }
+ params.contentmsg.show();
+ }
+ }
+ return result;
+}
+function init_form(params){
+ params.form.submit(function(){
+ var flag = false;
+ if(params.form.attr('data-remote') != undefined ){
+ flag = true
+ }
+ var is_checked = nh_check_field({
+ issubmit:true,
+ content:params.editor,
+ contentmsg:params.contentmsg,
+ textarea:params.textarea
+ });
+ if(is_checked){
+ if(flag){
+ return true;
+ }else{
+ $(this)[0].submit();
+ return false;
+ }
+ }
+ return false;
+ });
+}
+function nh_reset_form(params){
+ params.form[0].reset();
+ params.textarea.empty();
+ if(params.editor != undefined){
+ params.editor.html(params.textarea.html());
+ }
+ params.contentmsg.hide();
+}
+
+function init_KindEditor_data(id){
+ KindEditor.ready(function (K) {
+ $("div[nhname='new_message_" + id + "']").each(function () {
+ var params = {};
+ params.kindutil = K;
+ params.div_form = $(this);
+ params.form = $("form", params.div_form);
+ if (params.form == undefined || params.form.length == 0) {
+ return;
+ }
+ params.textarea = $("textarea[nhname='new_message_textarea']", params.div_form);
+ params.contentmsg = $("p[nhname='contentmsg']", params.div_form);
+ params.toolbar_container = $("div[nhname='toolbar_container']", params.div_form);
+ params.cancel_btn = $("#new_message_cancel_btn");
+ params.submit_btn = $("#new_message_submit_btn");
+
+ if (params.textarea.data('init') == undefined) {
+ params.editor = init_editor(params);
+ init_form(params);
+ params.cancel_btn.click(function () {
+ nh_reset_form(params);
+ });
+ params.submit_btn.click(function () {
+ params.form.submit();
+ });
+ params.textarea.data('init', 1);
+ $(this).show();
+ }
+ });
+ });
+}
\ No newline at end of file
diff --git a/public/javascripts/user.js b/public/javascripts/user.js
index b032221f8..6a5d93139 100644
--- a/public/javascripts/user.js
+++ b/public/javascripts/user.js
@@ -1,74 +1,5 @@
//个人动态
$(function(){
- function init_editor(params){
- var editor = params.kindutil.create(params.textarea, {
- resizeType : 1,minWidth:"1px",width:"100%",height:"80px",
- items:['emoticons'],
- afterChange:function(){//按键事件
- nh_check_field({content:this,contentmsg:params.contentmsg,textarea:params.textarea});
- },
- afterCreate:function(){
- var toolbar = $("div[class='ke-toolbar']",params.div_form);
- $(".ke-outline>.ke-toolbar-icon",toolbar).append('表情');
- params.toolbar_container.append(toolbar);
- }
- }).loadPlugin('paste');
- return editor;
- }
-
- function nh_check_field(params){
- var result=true;
- if(params.content!=undefined){
- if(params.content.isEmpty()){
- result=false;
- }
- if(params.content.html()!=params.textarea.html() || params.issubmit==true){
- params.textarea.html(params.content.html());
- params.content.sync();
- if(params.content.isEmpty()){
- params.contentmsg.html('内容不能为空');
- params.contentmsg.css({color:'#ff0000'});
- }else{
- params.contentmsg.html('填写正确');
- params.contentmsg.css({color:'#008000'});
- }
- params.contentmsg.show();
- }
- }
- return result;
- }
- function init_form(params){
- params.form.submit(function(){
- var flag = false;
- if(params.form.attr('data-remote') != undefined ){
- flag = true
- }
- var is_checked = nh_check_field({
- issubmit:true,
- content:params.editor,
- contentmsg:params.contentmsg,
- textarea:params.textarea
- });
- if(is_checked){
- if(flag){
- return true;
- }else{
- $(this)[0].submit();
- return false;
- }
- }
- return false;
- });
- }
- function nh_reset_form(params){
- params.form[0].reset();
- params.textarea.empty();
- if(params.editor != undefined){
- params.editor.html(params.textarea.html());
- }
- params.contentmsg.hide();
- }
-
KindEditor.ready(function(K){
$("a[nhname='reply_btn']").live('click',function(){
var params = {};
@@ -167,110 +98,4 @@ $(function(){
});
});
});
-function init_list_more_div(params){
- var p=params;
- p.exbtn.click(function(){
- var isclose = p.container.data('isclose');
- var hasmore = p.container.data('hasmore');
- if(isclose == '1'){
- $("div[nhname='rec']",p.container).show();
- p.container.data('isclose','0');
- change_status_4_list_more_div(params);
- return;
- }
- if(hasmore == '0'){
- change_status_4_list_more_div(params,'get');
- return;
- }
- var url = p.container.data('url');
- if($("div[nhname='rec']",p.container).length > 0){
- var lastid = $("div[nhname='rec']",p.container).filter(':last').data('id');
- url += "?lastid="+lastid;
- var lasttime = $("div[nhname='rec']",p.container).filter(':last').data('time');
- if(lasttime != undefined){
- url += "&lasttime="+lasttime;
- }
- }
- $.ajax( {url:url,dataType:'text',success:function(data){
- var html = $(" "+data+" ");
- var lens = $("div[nhname='rec']",html).length;
- if(lens < p.size){
- p.container.data('hasmore','0');
- }
- if(lens>0){
- var currpage = parseInt(p.container.data('currpage'))+1;
- p.container.data('currpage',currpage);
- p.container.append(html.html())
- }
- change_status_4_list_more_div(params,'get');
- p.div.show();
- }} );
- });
- p.clbtn.click(function(){
- var i=0;
- $("div[nhname='rec']",p.container).each(function(){
- i++;
- if(i> p.size){
- $(this).hide();
- }
- });
- p.container.data('isclose','1');
- change_status_4_list_more_div(params);
- });
- p.exbtn.click();
-}
-function change_status_4_list_more_div(params,opt){
- var p=params;
- if($("div[nhname='rec']",p.container).length == 0 && opt != 'get'){
- p.exbtn.click();
- return;
- }
- var show_lens = $("div[nhname='rec']",p.container).length - $("div[nhname='rec']",p.container).filter(':hidden').length;
- if( show_lens > p.size ){
- p.clbtn.show();
- }else{
- p.clbtn.hide();
- }
- if($("div[nhname='rec']",p.container).length == 0){
- p.exbtn.html(p.nodatamsg);
- }else if( p.container.data('hasmore') == '1' || p.container.data('isclose')=='1' ){
- p.exbtn.html('点击展开更多');
- }else{
- p.exbtn.html('没有更多了');
- }
-}
-function init_list_more_div_params(div){
- var params = {};
- params.div = div;
- params.container = $("div[nhname='container']",div);
- params.exbtn = $("a[nhname='expand']",div);
- params.clbtn = $("a[nhname='close']",div);
- params.size = params.container.data('pagesize');
- params.nodatamsg = params.container.data('nodatamsg');
- if( params.size == undefined ){
- params.size = 13;
- }
- return params;
-}
-$(function(){
- $("div[nhname='list_more_div']").each(function(){
- var params = init_list_more_div_params($(this));
- init_list_more_div(params)
- });
-});
-
-$(function(){
- $(".newsType").mouseover(function(){
- $(".resourcesIcon").css({background:"url(images/resource_icon_list.png) 0px -25px no-repeat"});
- });
- $(".newsType").mouseout(function(){
- $(".resourcesIcon").css({background:"url(images/resource_icon_list.png) 0px 0px no-repeat"});
- });
- $(".resourcesSelected").mouseover(function(){
- $(".resourcesIcon").css({background:"url(images/resource_icon_list.png) 0px -25px no-repeat"});
- });
- $(".resourcesSelected").mouseout(function(){
- $(".resourcesIcon").css({background:"url(images/resource_icon_list.png) 0px 0px no-repeat"});
- });
-});
//个人动态 end
\ No newline at end of file
diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css
index 1e729cce2..54280b1c4 100644
--- a/public/stylesheets/new_user.css
+++ b/public/stylesheets/new_user.css
@@ -587,7 +587,7 @@ a.postTypeGrey:hover {color:#269ac9;}
.homepagePostReplyBannerCount{width:255px; display:inline-block; margin-left:20px;}
.homepagePostReplyBannerTime{width:85px; display:inline-block;}
.homepagePostReplyBannerMore{width:330px; display:inline-block; text-align:right;}
-.homepagePostReplyInputContainer {width:670px; margin:0px auto;}
+.homepagePostReplyInputContainer {width:670px; margin: 10px auto 0 auto;}
.homepagePostReplyInput {width:663px; height:45px; max-width:663px; max-height:45px; border:1px solid #d9d9d9; outline:none; margin:20px auto 10px auto;}
.homepagePostReplyEmotion {background:url(../images/homepage_icon.png) -90px -88px no-repeat; width:50px; height:24px; float:left; padding-left:30px;}
.homepagePostReplySubmit {float:right; width:45px; height:24px; text-align:center; line-height:24px; vertical-align:middle; font-size:12px; color:#ffffff; background-color:#269ac9;}
@@ -955,6 +955,20 @@ img.ui-datepicker-trigger {
.is_public{display: none !important;}
.ui-corner-left{background: #64bdd9;}
+/*回复框*/
+div.ke-toolbar{display:none;width:400px;border:none;background:none;padding:0px 0px;}
+span.ke-toolbar-icon{line-height:26px;font-size:14px;padding-left:26px;}
+span.ke-toolbar-icon-url{background-image:url( /images/public_icon.png )}
+div.ke-toolbar .ke-outline{padding:0px 0px;line-height:26px;font-size:14px;}
+span.ke-icon-emoticons{background-position:0px -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.respond-form .reply_btn{margin-left:565px;margin-top:5px;}
+div.recall_con{width:570px;}
+div.recall_con .reply_btn{margin-left:525px;margin-top:5px;}
+.fr.cr{ clear: right}
+
From b89a80d04e27b408058367d8233d19b0ad9e8baf Mon Sep 17 00:00:00 2001
From: cxt
<%= link_to "导入作业", user_import_homeworks_user_path(User.current.id),:class => "BlueCirBtn fl mr10",:remote => true%>
- 截止日期:
<%= calendar_for('homework_end_time')%>
From 62360175d18223d88e2fcec54b57bbfbdc962651 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Tue, 1 Sep 2015 11:25:52 +0800
Subject: [PATCH 20/65] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E9=80=9A=E7=9F=A5?=
=?UTF-8?q?=E5=9B=9E=E5=A4=8D=E6=97=B6=EF=BC=8C=E6=89=80=E6=9C=89=E5=9B=9E?=
=?UTF-8?q?=E5=A4=8D=E6=A1=86=E9=83=BD=E4=BC=9A=E6=8F=90=E4=BA=A4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/users/_course_news.html.erb | 10 +++++-----
public/javascripts/init_KindEditor.js | 10 +++++-----
2 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/app/views/users/_course_news.html.erb b/app/views/users/_course_news.html.erb
index fb9561df6..3b19eded1 100644
--- a/app/views/users/_course_news.html.erb
+++ b/app/views/users/_course_news.html.erb
@@ -48,11 +48,11 @@
diff --git a/public/javascripts/init_KindEditor.js b/public/javascripts/init_KindEditor.js
index 38aabda79..fc02146bb 100644
--- a/public/javascripts/init_KindEditor.js
+++ b/public/javascripts/init_KindEditor.js
@@ -77,11 +77,11 @@ function init_KindEditor_data(id){
if (params.form == undefined || params.form.length == 0) {
return;
}
- params.textarea = $("textarea[nhname='new_message_textarea']", params.div_form);
- params.contentmsg = $("p[nhname='contentmsg']", params.div_form);
- params.toolbar_container = $("div[nhname='toolbar_container']", params.div_form);
- params.cancel_btn = $("#new_message_cancel_btn");
- params.submit_btn = $("#new_message_submit_btn");
+ params.textarea = $("textarea[nhname='new_message_textarea_" + id + "']", params.div_form);
+ params.contentmsg = $("p[nhname='contentmsg_" + id + "']", params.div_form);
+ params.toolbar_container = $("div[nhname='toolbar_container_" + id + "']", params.div_form);
+ params.cancel_btn = $("#new_message_cancel_btn_" + id);
+ params.submit_btn = $("#new_message_submit_btn_" + id);
if (params.textarea.data('init') == undefined) {
params.editor = init_editor(params);
From b3e3737fb5ae7e9477ef868cb6f692f551721353 Mon Sep 17 00:00:00 2001
From: lizanle <491823689@qq.com>
Date: Tue, 1 Sep 2015 11:29:43 +0800
Subject: [PATCH 21/65] =?UTF-8?q?=E5=8F=91=E5=B8=83=E4=BD=9C=E4=B8=9A?=
=?UTF-8?q?=E6=97=B6=E4=BB=8E=E8=B5=84=E6=BA=90=E5=BA=93=E9=80=89=E6=8B=A9?=
=?UTF-8?q?=E8=B5=84=E6=BA=90=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/users_controller.rb | 95 ++++++++++++++++++-
app/views/users/_show_user_resource.html.erb | 83 ++++++++++++----
.../users/_user_homework_attachment.html.erb | 3 +-
.../users/import_resources_to_homework.js.erb | 16 ++++
app/views/users/user_homeworks.html.erb | 4 +
app/views/users/user_import_resource.js.erb | 13 +--
.../users/user_ref_resource_search.js.erb | 2 +
app/views/users/user_resource_type.js.erb | 2 +
config/routes.rb | 3 +
public/stylesheets/new_user.css | 8 +-
10 files changed, 196 insertions(+), 33 deletions(-)
create mode 100644 app/views/users/import_resources_to_homework.js.erb
create mode 100644 app/views/users/user_ref_resource_search.js.erb
create mode 100644 app/views/users/user_resource_type.js.erb
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index 0058e6e4c..a88068be7 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -381,15 +381,108 @@ class UsersController < ApplicationController
#用户从资源库导入资源到作业
def user_import_resource
- user_course_ids = User.current.courses.map { |c| c.id} #我的资源库的话,那么应该是我上传的所有资源 加上 我加入的课程的所有资源
+ @user = User.current
+ user_course_ids = @user.courses.map { |c| c.id} #我的资源库的话,那么应该是我上传的所有资源 加上 我加入的课程的所有资源
@attachments = Attachment.where("(author_id = #{params[:id]} and container_type in('Project','Principal','Course','Issue','Document','Message','News','StudentWorkScore','HomewCommon')) "+
"or (container_type = 'Course' and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')}))").order("created_on desc")
+ @type = params[:type]
+ @homework_id = params[:homework_id]
+ @limit = 7
+ @is_remote = true
+ @atta_count = @attachments.count
+ @atta_pages = Paginator.new @atta_count, @limit, params['page'] || 1
+ @offset ||= @atta_pages.offset
+ #@curse_attachments_all = @all_attachments[@offset, @limit]
+ @attachments = paginateHelper @attachments,7
+ respond_to do |format|
+ format.js
+ end
+ end
+
+ #引入资源列表根据类型过滤
+ def user_resource_type
+ if User.current.id.to_i != params[:id].to_i
+ render_403
+ return
+ end
+ if(params[:type].nil? || params[:type] == "1") #全部
+ user_course_ids = User.current.courses.map { |c| c.id} #我的资源库的话,那么应该是我上传的所有资源 加上 我加入的课程的所有资源
+ @attachments = Attachment.where("(author_id = #{params[:id]} and container_type in('Project','Principal','Course','Issue','Document','Message','News','StudentWorkScore','HomewCommon')) "+
+ "or (container_type = 'Course' and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')}))").order("created_on desc")
+ elsif params[:type] == "2" #课程资源
+ user_course_ids = User.current.courses.map { |c| c.id}
+ @attachments = Attachment.where("(author_id = #{params[:id]} and container_type = 'Course') or (container_type = 'Course' and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')})) ").order("created_on desc")
+ elsif params[:type] == "3" #项目资源
+ @attachments = Attachment.where("author_id = #{params[:id]} and container_type = 'Project'").order("created_on desc")
+ elsif params[:type] == "4" #附件
+ @attachments = Attachment.where("author_id = #{params[:id]} and container_type in('Issue','Document','Message','News','StudentWorkScore','HomewCommon')").order("created_on desc")
+ elsif params[:type] == "5" #用户资源
+ @attachments = Attachment.where("author_id = #{params[:id]} and container_type = 'Principal'").order("created_on desc")
+ end
+ @type = params[:type]
+ @limit = 7
+ @is_remote = true
+ @atta_count = @attachments.count
+ @atta_pages = Paginator.new @atta_count, @limit, params['page'] || 1
+ @offset ||= @atta_pages.offset
+ #@curse_attachments_all = @all_attachments[@offset, @limit]
+ @attachments = paginateHelper @attachments,7
respond_to do |format|
format.js
end
end
+ #引入资源列表根据关键词过滤
+ def user_ref_resource_search
+ search = params[:search].to_s.strip.downcase
+ if(params[:type].nil? || params[:type] == "1") #全部
+ user_course_ids = User.current.courses.map { |c| c.id} #我的资源库的话,那么应该是我上传的所有资源 加上 我加入的课程的所有资源 取交集并查询
+ @attachments = Attachment.where("((author_id = #{params[:id]} and container_type in('Project','Principal','Course','Issue','Document','Message','News','StudentWorkScore','HomewCommon')) "+
+ " or (container_type = 'Course' and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')}))) and (filename like '%#{search}%') ").order("created_on desc")
+ elsif params[:type] == "2" #课程资源
+ user_course_ids = User.current.courses.map { |c| c.id}
+ @attachments = Attachment.where("(author_id = #{params[:id]} and container_type = 'Course') or (container_type = 'Course' and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')})) and (filename like '%#{search}%') ").order("created_on desc")
+ elsif params[:type] == "3" #项目资源
+ @attachments = Attachment.where("author_id = #{params[:id]} and container_type = 'Project' and (filename like '%#{search}%')").order("created_on desc")
+ elsif params[:type] == "4" #附件
+ @attachments = Attachment.where("author_id = #{params[:id]} and container_type in('Project','Issue','Document','Message','News','StudentWorkScore','HomewCommon') and (filename like '%#{search}%')").order("created_on desc")
+ elsif params[:type] == "5" #用户资源
+ @attachments = Attachment.where("author_id = #{params[:id]} and container_type = 'Principal' and (filename like '%#{search}%')").order("created_on desc")
+ end
+ @type = params[:type]
+ @limit = 7
+ @is_remote = true
+ @atta_count = @attachments.count
+ @atta_pages = Paginator.new @atta_count, @limit, params['page'] || 1
+ @offset ||= @atta_pages.offset
+ #@curse_attachments_all = @all_attachments[@offset, @limit]
+ @attachments = paginateHelper @attachments,7
+ respond_to do |format|
+ format.js
+ end
+ end
+
+ #将资源批量引入
+ def import_resources_to_homework
+ @attachments = []
+ unless params[:checkbox1].nil? || params[:checkbox1].blank?
+ params[:checkbox1].each do |id|
+ atta = Attachment.find(id)
+ att_copy = atta.copy
+ att_copy.container_id = nil
+ att_copy.container_type = nil
+ att_copy.copy_from = atta.id
+ att_copy.save
+ @attachments << att_copy
+ end
+ end
+ respond_to do |format|
+ format.js
+ end
+ end
+
+
include CoursesHelper
def user_courses
diff --git a/app/views/users/_show_user_resource.html.erb b/app/views/users/_show_user_resource.html.erb
index a27a51d65..a3c82d995 100644
--- a/app/views/users/_show_user_resource.html.erb
+++ b/app/views/users/_show_user_resource.html.erb
@@ -1,26 +1,67 @@
-
+
+
\ No newline at end of file
+ <% end %>
+
diff --git a/app/views/users/_user_homework_attachment.html.erb b/app/views/users/_user_homework_attachment.html.erb
index 1613b144e..00d80dd22 100644
--- a/app/views/users/_user_homework_attachment.html.erb
+++ b/app/views/users/_user_homework_attachment.html.erb
@@ -46,8 +46,9 @@
-
+ 资源库
+ 引用资源库资源
+
+
+
+
+
+
+
+ <%= form_tag(import_resources_to_homework_user_path(user),:method => 'post',:remote=>'true') do %>
+
+
+ <%= render :partial => 'resources_list' ,:locals=>{ :attachments => @attachments} %>
-
-
+
+
- <%= form_tag(user_select_homework_users_path, :multipart => true,:remote => true,:name=>"select_homework_form",:id=>'select_homework_form') do %>
-
- <%= render :partial => 'users/show_user_homework_form', :locals => {:user_homeworks => @user_homeworks}%>
-
-
- <% end%>
-
+
上传附件
- <%#= link_to "资源库", user_import_resource_user_path(User.current.id),:class => "FilesBtn fl mr15 mt3",:remote => true%>
+ <%= link_to "资源库",{:controller => 'users',:action=>'user_import_resource',:id=>User.current.id,:homework_id=>container.id},:class => "FilesBtn fl mr15 mt3",:remote => true%>
<% content_for :header_tags do %>
diff --git a/app/views/users/import_resources_to_homework.js.erb b/app/views/users/import_resources_to_homework.js.erb
new file mode 100644
index 000000000..b77590095
--- /dev/null
+++ b/app/views/users/import_resources_to_homework.js.erb
@@ -0,0 +1,16 @@
+<% unless @attachments.empty?%>
+ <% @attachments.each_with_index do |attachment, i| %>
+ $("#attachments_fields").append(
+ ''+
+ '<%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => "filename link_file", :readonly=>"readonly")%>'+
+ '<%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 254, :placeholder => l(:label_optional_description), :class => "description", :style=>"display: inline-block;") %>'+
+ '<%= l(:field_is_public)%>:'+
+ '<%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public,attachment.is_public == 1 ? true : false,:class => "is_public")%>'+
+ '<%= link_to(" ".html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => "js"), :method => "delete", :remote => true, :class => "remove-upload") unless attachment.id.nil? %>'+
+ '<%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %>'+
+ ''+
+ '')
+
+ <% end %>
+ hideModal();
+<% end %>
\ No newline at end of file
diff --git a/app/views/users/user_homeworks.html.erb b/app/views/users/user_homeworks.html.erb
index 74e4df4f0..d401ea314 100644
--- a/app/views/users/user_homeworks.html.erb
+++ b/app/views/users/user_homeworks.html.erb
@@ -19,6 +19,10 @@
$("#homework_attachments").html("<%= escape_javascript(render :partial => 'users/user_homework_attachment', :locals => { :container => HomeworkCommon.new })%>");
homework_description_editor.html("");
}
+
+ function checkAllBox(doc){
+
+ }
<% if User.current.user_extensions && User.current.user_extensions.identity == 0 && User.current.allowed_to?(:add_course, nil, :global => true)%>
diff --git a/app/views/users/user_import_resource.js.erb b/app/views/users/user_import_resource.js.erb
index ce70d68ad..dc3682d30 100644
--- a/app/views/users/user_import_resource.js.erb
+++ b/app/views/users/user_import_resource.js.erb
@@ -1,7 +1,8 @@
-$('#ajax-modal').html('<%= escape_javascript(render :partial => 'users/show_user_homeworks') %>');
-showModal('ajax-modal', '580px');
-$('#ajax-modal').css('height','300px').css("width","580px");
+$('#ajax-modal').html('<%= escape_javascript(render :partial => 'users/show_user_resource',:locals => {:user => @user,:homework_id=>@homework_id}) %>');
+showModal('ajax-modal', '730px');
+$('#ajax-modal').css('height','500px').css("width","730px");
$('#ajax-modal').siblings().remove();
-$('#ajax-modal').before("" +
-"![]() + <%= l(:label_no_data) %> + <% else %> <% attachments.each do |attach| %>
-
+
+
<%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id), :alt => "用户头像" %>
@@ -12,7 +12,6 @@
<% end %>
TO
<%= link_to activity.course.name.to_s+" | 课程讨论区", course_boards_path(activity.course), :class => "newsBlue ml15 mr5"%>
- <%#= link_to activity.course.name.to_s+"(课程讨论区)", course_path(activity.course), :class => "newsBlue ml15 mr5"%>
<% if activity.parent_id.nil? %>
@@ -26,14 +25,14 @@
- 帖子描述:
+
+
<% activity= activity.parent_id.nil? ? activity:activity.parent%>
<% replies_all_i = 0 %>
<% unless activity.children.empty? %>
- 帖子描述:
<% if activity.parent_id.nil? %>
<%= activity.content.to_s.html_safe%>
<% else %>
<%= activity.parent.content.to_s.html_safe%>
<% end %>
-
+
-
+ <%#=format_date(activity.updated_on)%>
<%if count>2 %>
-
+
<% end %>
-
-
+
+
+
+
+
+
diff --git a/app/views/layouts/_footer.html.erb b/app/views/layouts/_footer.html.erb
index 5cd79f6d8..d6368b4a0 100644
--- a/app/views/layouts/_footer.html.erb
+++ b/app/views/layouts/_footer.html.erb
@@ -1,9 +1,9 @@
关于我们+
+
+
+
+
++ Trustie是一个面向高校创新实践的在线协作社区,是在中国高校推行大规模开放在线研究(Massive Open Online Research, MOORE)的支撑平台,也简称Trustie平台。老师、学生和科研人员可以在此开展各种在线协同学习、协同作业、协同开发等活动。 + ++ MOORE是国防科学技术大学杨学军院士提出的一个面向高校科研教学活动的新型创新实践概念,为全面支持高校人才培养和科学研究提供了一种新思路。MOORE是对大规模在线开放课程(Massive Open Online Course, MOOC)的拓展,是课堂教学与创新实践深度结合的全新模式,可以看作MOOC2.0。 + ++ 2005年开始,Trustie研制团队围绕网络时代的软件开发效率和质量这一核心问题展开研究,经过十年的磨砺与攻关,逐步揭示出以大众化协同开发、开放式资源共享、持续性可信评估为核心的互联网大规模协同机理,提出了全新的软件开发群体化方法。2008年起,研制团队开始探索如何将这种协同机理引入软件人才培养。MOORE概念的提出为研制团队的人才培养实践提供了新的发展方向和应用模式,使Trustie技术和工具能够更直接、更有效地与高校人才培养对接,形成了今天已被大量师生接受的在线人才培养平台。 + ++ 研制团队认为MOORE的创新人才培养模式(如图1左图)是将互联网大规模协同机理与高校创新实践活动相结合的全新人才培养方法和模式,研制团队并基于本平台的架构形成了对MOORE核心机理的三方面认识(如图1右图)。 + +
+
+ ![]() 图1 基于MOORE的创新人才培养模式与核心机理 ++ 目前,Trustie平台已经初步展现出大规模开放在线研究的生态系统蓝图,其核心是在线教学实践平台和在线协同研究平台,如图2。Trustie在线教学实践平台是支持教师和学生围绕课堂学习开展实践的平台(如图2),Trustie在线协同研究平台是支持开发小组围绕实践任务或研究工作开展分布式协作的平台(如图2)。两个核心平台为一名"新手"大学生成长为具有一定创新能力的"创客"提供了从学习到研究的一个渐进式成长环境(如图2)。 + ++ 特别是,根据师生的实际需要,Trustie平台提供了私有模式和公开模式,支持针对未公开成果实施有效知识产权保护为前提的交流分享(如图2)。随着越来越多的高校、课程和研究小组的加入,MOORE创新实践模式的生态效益将不断显现出来。 + +
+
+ ![]() 图2 基于MOORE的支撑平台和生态系统 ++ 研制团队特别感谢高校老师和学生的积极反馈、无私创意。平台的很多实用便捷的功能都是老师们积极参与和设计的结果,汇聚了大量师生的宝贵贡献,是研制团队和用户群体共同成长的结果。 + +
+ Trustie平台的基本思路是将开源模式与中国高校人才培养活动相结合,但其本质上是一种O2O(Online To Offline)的创新人才培养模式,只有在以下两个方面同步推进,才能在持续解决实际需求的过程中快速发展: + 研制团队认为,Trustie平台是一种"互联网+"思维在高校教育领域的大型探索性实践。作为一种互联网应用,Trustie平台自身的开发也采取了互联网模式:Trustie研制团队采用了"网构化软件开发模式",坚持"每周一更"的快速上线、快速体验模式,以最大程度上贴近用户实际需求提升。欢迎高校师生一同投身创新实践,共同见证MOORE创新生态的早日形成。 + + |