From 1e917cf72f32f28d4dfd663aea05c4f79aa82eae Mon Sep 17 00:00:00 2001
From: daiao <358551898@qq.com>
Date: Wed, 20 Sep 2017 09:34:01 +0800
Subject: [PATCH 01/22] =?UTF-8?q?=E5=AE=9E=E8=AE=ADTPM=E7=BC=96=E8=BE=91?=
=?UTF-8?q?=E9=80=89=E6=8B=A9=E9=A2=98=E5=90=8E=E4=BF=9D=E5=AD=98=EF=BC=8C?=
=?UTF-8?q?=E9=A2=98=E5=B9=B2=E5=92=8C=E5=8F=82=E8=80=83=E7=AD=94=E6=A1=88?=
=?UTF-8?q?=E5=87=BA=E7=8E=B0=E6=A0=B7=E5=BC=8F=E9=94=99=E8=AF=AF?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/challenges/_choose_type.html.erb | 18 ++++-----
..._single_or_multiple_question_show.html.erb | 37 ++++++++++---------
app/views/challenges/choose_type_show.js.erb | 3 +-
3 files changed, 31 insertions(+), 27 deletions(-)
diff --git a/app/views/challenges/_choose_type.html.erb b/app/views/challenges/_choose_type.html.erb
index 320e5ba9f..b1e6f8b02 100644
--- a/app/views/challenges/_choose_type.html.erb
+++ b/app/views/challenges/_choose_type.html.erb
@@ -41,15 +41,15 @@
<%#= render :partial => 'single_or_multiple_question_show'%>
\ No newline at end of file
diff --git a/app/views/challenges/choose_type_show.js.erb b/app/views/challenges/choose_type_show.js.erb
index 2934cbc53..402097644 100644
--- a/app/views/challenges/choose_type_show.js.erb
+++ b/app/views/challenges/choose_type_show.js.erb
@@ -1,6 +1,7 @@
$("#task_content").html("<%= j(render :partial => 'single_or_multiple_question_show')%>");
$("#challenge_choose_tab").html("<%= j(render :partial => "challenges/choose_tab") %>");
+/*
// JS局部刷新时,有可能加载不成功,需要重新加载一次(具体原因不明)
editormd.loadKaTeX(function() {
editormd.markdownToHTML("challenge_choose_subject_show", {
@@ -17,4 +18,4 @@ editormd.loadKaTeX(function() {
flowChart: true, // 默认不解析
sequenceDiagram: true // 默认不解析
})
-});
\ No newline at end of file
+});*/
From d24b6fdb6d679fca7b31b340efa5689aa7a9a984 Mon Sep 17 00:00:00 2001
From: daiao <358551898@qq.com>
Date: Wed, 20 Sep 2017 09:47:36 +0800
Subject: [PATCH 02/22] =?UTF-8?q?=E5=AE=9E=E8=AE=ADtpm=E7=9A=84=E9=A2=84?=
=?UTF-8?q?=E5=A4=87=E7=9F=A5=E8=AF=86=E7=82=B9=E5=87=BB=E6=97=A0=E6=95=88?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/challenges/edit.html.erb | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/app/views/challenges/edit.html.erb b/app/views/challenges/edit.html.erb
index 148133a98..342c17084 100644
--- a/app/views/challenges/edit.html.erb
+++ b/app/views/challenges/edit.html.erb
@@ -56,9 +56,9 @@
">
参考答案
-
- 预备知识
-
+ ">
+ 预备知识
+
">
评分设置
From d1cf530237d896ae21d53e51131ce5e6be1c6051 Mon Sep 17 00:00:00 2001
From: daiao <358551898@qq.com>
Date: Wed, 20 Sep 2017 10:00:47 +0800
Subject: [PATCH 03/22] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E9=A6=96=E9=A1=B5?=
=?UTF-8?q?=E7=9A=84=E5=85=A8=E9=83=A8=E6=98=BE=E7=A4=BA=E7=9A=84=E6=95=B0?=
=?UTF-8?q?=E6=8D=AE=E5=92=8C=E6=A3=80=E7=B4=A2=E7=9A=84=E6=95=B0=E6=8D=AE?=
=?UTF-8?q?=E4=B8=8D=E4=B8=80=E8=87=B4=EF=BC=8C=E5=85=A8=E9=83=A8=E6=98=BE?=
=?UTF-8?q?=E7=A4=BA=E7=9A=84=E6=95=B0=E6=8D=AE=E4=B8=8D=E7=AE=97=E9=9A=90?=
=?UTF-8?q?=E8=97=8F=E7=9A=84?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/shixuns_controller.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb
index c398d388c..b975e6186 100644
--- a/app/controllers/shixuns_controller.rb
+++ b/app/controllers/shixuns_controller.rb
@@ -139,7 +139,7 @@ class ShixunsController < ApplicationController
@sort = "asc"
search = params[:search]
@mail = User.current.mail.blank?
- @shixun_all_count = Shixun.all.count
+ @shixun_all_count = Shixun.where(:hidden => 0).count
@shixuns = Shixun.where("name like ? and hidden = 0", "%#{search}%")
@shixuns.each do |shixun|
shixun[:myshixunCount] = shixun.myshixuns.count
From e86720be6bdcd5d21d2b631af020972dd9584a19 Mon Sep 17 00:00:00 2001
From: daiao <358551898@qq.com>
Date: Wed, 20 Sep 2017 10:19:41 +0800
Subject: [PATCH 04/22] =?UTF-8?q?=E5=85=A8=E9=83=A8=E5=AE=9E=E8=AE=AD?=
=?UTF-8?q?=E6=9C=80=E6=96=B0=E7=9A=84=E6=8E=92=E5=BA=8F=E4=B8=8D=E6=AD=A3?=
=?UTF-8?q?=E7=A1=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/shixuns_controller.rb | 2 +-
app/views/shixuns/_shixun_list.html.erb | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb
index b975e6186..cfbeacef6 100644
--- a/app/controllers/shixuns_controller.rb
+++ b/app/controllers/shixuns_controller.rb
@@ -242,7 +242,7 @@ class ShixunsController < ApplicationController
bsort = params[:sort] || "desc"
@sort = bsort == "desc" ? "asc" : "desc"
if @order == "updated_at"
- order_str = "#{Shixun.table_name}.updated_at #{bsort}"
+ order_str = "#{Shixun.table_name}.updated_at #{@sort}"
else
order_str = "myshixun_count #{bsort}, #{Shixun.table_name}.updated_at #{bsort}"
end
diff --git a/app/views/shixuns/_shixun_list.html.erb b/app/views/shixuns/_shixun_list.html.erb
index 7b425c6be..295a301e4 100644
--- a/app/views/shixuns/_shixun_list.html.erb
+++ b/app/views/shixuns/_shixun_list.html.erb
@@ -2,8 +2,8 @@
">
<%= link_to "最热", search_shixuns_path(:order => "myshixun_count", :shixun_status => @shixun_status, :status => @status, :language => @language, :search => @search, :trainee => @trainee, :major =>@major, :course => @course, :sort => @sort), :remote => true %>
- " id="nav_check_item_2">
- <%= link_to "最新", search_shixuns_path(:order => "created_at", :shixun_status => @shixun_status, :status => @status, :language => @language, :search => @search, :trainee => @trainee, :major =>@major, :course => @course, :sort => @sort), :remote => true %>
+ " id="nav_check_item_2">
+ <%= link_to "最新", search_shixuns_path(:order => "updated_at", :shixun_status => @shixun_status, :status => @status, :language => @language, :search => @search, :trainee => @trainee, :major =>@major, :course => @course, :sort => @sort), :remote => true %>
共<%= @shixuns_count %>个检索结果
From 01b8a72e38a74c372ea23fa5266635e2b217f2a1 Mon Sep 17 00:00:00 2001
From: daiao <358551898@qq.com>
Date: Wed, 20 Sep 2017 10:29:39 +0800
Subject: [PATCH 05/22] =?UTF-8?q?=E9=80=89=E6=8B=A9=E9=A2=98tpi=E4=B8=AD?=
=?UTF-8?q?=E7=9A=84=E6=98=BE=E7=A4=BA=E6=B2=A1=E6=9C=89=E6=8C=89=E7=85=A7?=
=?UTF-8?q?tpm=E7=9A=84=E6=8E=92=E5=BA=8F=E6=9D=A5=E6=98=BE=E7=A4=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
...920022714_modify_position_type_for_challenge_choose.rb | 8 ++++++++
1 file changed, 8 insertions(+)
create mode 100644 db/migrate/20170920022714_modify_position_type_for_challenge_choose.rb
diff --git a/db/migrate/20170920022714_modify_position_type_for_challenge_choose.rb b/db/migrate/20170920022714_modify_position_type_for_challenge_choose.rb
new file mode 100644
index 000000000..94c1b6445
--- /dev/null
+++ b/db/migrate/20170920022714_modify_position_type_for_challenge_choose.rb
@@ -0,0 +1,8 @@
+class ModifyPositionTypeForChallengeChoose < ActiveRecord::Migration
+ def up
+ change_column :challenge_chooses, :position, :integer
+ end
+
+ def down
+ end
+end
From 833be4dbaabb12f9a641ea74d4688679fec080d5 Mon Sep 17 00:00:00 2001
From: daiao <358551898@qq.com>
Date: Wed, 20 Sep 2017 11:16:26 +0800
Subject: [PATCH 06/22] =?UTF-8?q?=E8=AE=AD=E8=B7=AF=E5=BE=84=E7=9A=84?=
=?UTF-8?q?=E7=AE=80=E4=BB=8B=E3=80=81=E5=AD=A6=E4=B9=A0=E9=A1=BB=E7=9F=A5?=
=?UTF-8?q?=EF=BC=8C=E8=AF=B7=E6=94=B9=E4=B8=BA=20ke=20=E7=BC=96=E8=BE=91?=
=?UTF-8?q?=E5=99=A8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/courses_controller.rb | 2 +-
app/views/subjects/new.html.erb | 38 ++++++++++++++++++++++++---
app/views/subjects/show.html.erb | 4 +--
public/javascripts/edu/base_edu.js | 6 +++--
4 files changed, 41 insertions(+), 9 deletions(-)
diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb
index 12cd48c94..8ea6afc5b 100644
--- a/app/controllers/courses_controller.rb
+++ b/app/controllers/courses_controller.rb
@@ -36,7 +36,7 @@ class CoursesController < ApplicationController
before_filter :require_login, :only => [:join, :unjoin]
#before_filter :allow_join, :only => [:join]
require 'bundler/setup'
- require 'simple_xlsx_reader'
+ #require 'simple_xlsx_reader'
# params[:search] 搜索课程的名称
# params[:select] "join" "create" "all" 参与的 创建的 所有的课程
diff --git a/app/views/subjects/new.html.erb b/app/views/subjects/new.html.erb
index 6e2fd1f6f..95e0779bd 100644
--- a/app/views/subjects/new.html.erb
+++ b/app/views/subjects/new.html.erb
@@ -1,3 +1,6 @@
+<%= content_for(:header_tags) do %>
+ <%= import_ke(enable_at: false, prettify: false, init_activity: false) %>
+<% end %>
@@ -23,14 +26,41 @@
-
-
+
+ <%#= hidden_field_tag :asset_id, params[:asset_id], :required => false, :style => 'display:none' %>
+
+ <%= f.kindeditor :description,
+ :editor_id => 'new_subject_description',
+ :owner_id => 0,
+ :owner_type => OwnerTypeHelper::MESSAGE,
+ :width => '80%',
+ :height => 300,
+ :minHeight=>300,
+ :class => 'talk_text fl',
+ :input_html => { :id => 'new_subject_description',
+ :class => 'task task-height-220 panel-box-sizing task-form-80 fl color-grey ml20',
+ :maxlength => 5000 }
+ %>
+
请输入简介
-
-
+
+
+ <%= f.kindeditor :learning_notes,
+ :editor_id => 'new_learning_notes',
+ :owner_id => 0,
+ :owner_type => OwnerTypeHelper::MESSAGE,
+ :width => '80%',
+ :height => 300,
+ :minHeight=>300,
+ :class => 'talk_text fl',
+ :input_html => { :id => 'new_learning_notes',
+ :class => 'task task-height-220 panel-box-sizing task-form-80 fl color-grey ml20',
+ :maxlength => 5000 }
+ %>
+ <
请输入学习须知
diff --git a/app/views/subjects/show.html.erb b/app/views/subjects/show.html.erb
index 7db344b7a..a3593101e 100644
--- a/app/views/subjects/show.html.erb
+++ b/app/views/subjects/show.html.erb
@@ -9,7 +9,7 @@
<% end %>
-
<%= @subject.description.blank? ? "暂未填写" : (@subject.description) %>
+
<%= @subject.description.blank? ? "暂未填写" : (@subject.description.html_safe) %>
<% end %>
@@ -142,7 +142,7 @@
<% end %>
- <%= @subject.learning_notes.blank? ? "暂未填写" : @subject.learning_notes %>
+ <%= @subject.learning_notes.blank? ? "暂未填写" : @subject.learning_notes.html_safe %>
教学团队
diff --git a/public/javascripts/edu/base_edu.js b/public/javascripts/edu/base_edu.js
index 88d9f4eaf..34e761a12 100644
--- a/public/javascripts/edu/base_edu.js
+++ b/public/javascripts/edu/base_edu.js
@@ -1094,19 +1094,21 @@ function submit_new_subject(){
} else{
$("#new_subject_name_notice").hide();
}
- if($("#new_subject_description").val().trim() == ""){
+ if(new_subject_description.isEmpty()){
check = false;
$("#new_subject_description_notice").show();
} else{
$("#new_subject_description_notice").hide();
}
- if($("#new_learning_notes").val().trim() == ""){
+ if(new_learning_notes.isEmpty()){
check = false;
$("#new_learning_notes_notice").show();
} else {
$("#new_learning_notes_notice").hide();
}
if(check){
+ new_subject_description.sync();
+ new_learning_notes.sync();
$("#new_subject").submit();
}
}
From 982c8dde1201b9aaadbec64cf973047268a95a19 Mon Sep 17 00:00:00 2001
From: daiao <358551898@qq.com>
Date: Wed, 20 Sep 2017 11:30:40 +0800
Subject: [PATCH 07/22] =?UTF-8?q?=E5=BA=95=E9=83=A8=E5=AF=BC=E8=88=AA?=
=?UTF-8?q?=E8=BF=9E=E6=8E=A5=E8=B7=B3=E8=BD=AC=E5=87=BA=E9=94=99?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/layouts/_footer.html.erb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/views/layouts/_footer.html.erb b/app/views/layouts/_footer.html.erb
index 0ebd74121..eacd49b71 100644
--- a/app/views/layouts/_footer.html.erb
+++ b/app/views/layouts/_footer.html.erb
@@ -9,7 +9,7 @@
-
+
From a89f462b22086bcc14b9e83ba0a545586ecbaf84 Mon Sep 17 00:00:00 2001
From: daiao <358551898@qq.com>
Date: Wed, 20 Sep 2017 14:06:25 +0800
Subject: [PATCH 08/22] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E9=80=89=E6=8B=A9?=
=?UTF-8?q?=E9=A2=98=E4=BB=BB=E5=8A=A1=E7=9A=84=E6=8A=80=E8=83=BD=E7=82=B9?=
=?UTF-8?q?=E6=94=B9=E6=88=90=E7=9F=A5=E8=AF=86=E7=82=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/challenges/_single_or_multiple_question.html.erb | 2 +-
app/views/challenges/_single_or_multiple_question_show.html.erb | 2 +-
app/views/games/_games_list.html.erb | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/app/views/challenges/_single_or_multiple_question.html.erb b/app/views/challenges/_single_or_multiple_question.html.erb
index 724071dc4..9f51cbabf 100644
--- a/app/views/challenges/_single_or_multiple_question.html.erb
+++ b/app/views/challenges/_single_or_multiple_question.html.erb
@@ -120,7 +120,7 @@