From ef2ef7111c9a2f2d0bf64a97efb273a7fe2a63c0 Mon Sep 17 00:00:00 2001
From: lizanle <491823689@qq.com>
Date: Mon, 7 Dec 2015 14:31:05 +0800
Subject: [PATCH 1/9] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=AF=B9=E5=B8=96?=
=?UTF-8?q?=E5=AD=90=E7=9A=84=E5=85=A8=E6=96=87=E6=90=9C=E7=B4=A2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/welcome_controller.rb | 27 +++++---
app/models/memo.rb | 68 +++++++++++++++++--
.../welcome/_search_all_results.html.erb | 16 +++++
.../welcome/_search_memo_results.html.erb | 24 +++++++
app/views/welcome/search.html.erb | 12 +++-
app/views/welcome/search.js.erb | 2 +
lib/tasks/elasticsearch_batch_op.rake | 7 ++
7 files changed, 142 insertions(+), 14 deletions(-)
create mode 100644 app/views/welcome/_search_memo_results.html.erb
diff --git a/app/controllers/welcome_controller.rb b/app/controllers/welcome_controller.rb
index 815a44839..1508fc871 100644
--- a/app/controllers/welcome_controller.rb
+++ b/app/controllers/welcome_controller.rb
@@ -161,7 +161,7 @@ class WelcomeController < ApplicationController
query: @name,
type:"most_fields",
operator: "or",
- fields: ['login', 'firstname','lastname','name','description^0.5','filename']
+ fields: ['login', 'firstname','lastname','name','description^0.5','filename','subject','content^0.5']
}
},
highlight: {
@@ -173,10 +173,12 @@ class WelcomeController < ApplicationController
lastname: {},
name:{},
description:{},
- filename:{}
+ filename:{},
+ subject:{},
+ content:{}
}
}
- },[User,Course,Attachment,Project] ).page(params[:page] || 1).per(20).results
+ },[User,Course,Attachment,Project,Memo] ).page(params[:page] || 1).per(20).results
when 'user'
@users = User.search(@name).page(params[:page] || 1).per(20)
when 'project'
@@ -185,6 +187,8 @@ class WelcomeController < ApplicationController
@courses = Course.search(@name).page(params[:page] || 1).per(20).results
when 'attachment'
@attachments = Attachment.search(@name).page(params[:page] || 1).per(20).results
+ when 'memo'
+ @memos = Memo.search(@name).page(params[:page] || 1).per(20).results
else
@alls = Elasticsearch::Model.search({
query: {
@@ -192,7 +196,7 @@ class WelcomeController < ApplicationController
query: @name,
type:"most_fields",
operator: "or",
- fields: ['login', 'firstname','lastname','name','description^0.5','filename']
+ fields: ['login', 'firstname','lastname','name','description^0.5','filename','subject','content^0.5']
}
},
highlight: {
@@ -204,10 +208,12 @@ class WelcomeController < ApplicationController
lastname: {},
name:{},
description:{},
- filename:{}
+ filename:{},
+ subject:{},
+ content:{}
}
}
- },[User,Course,Attachment,Project] ).page(params[:page] || 1).per(20).results
+ },[User,Course,Attachment,Project,Memo] ).page(params[:page] || 1).per(20).results
end
@@ -216,13 +222,14 @@ class WelcomeController < ApplicationController
@course_count = Course.search(@name).results.total
@attach_count = Attachment.search(@name).results.total
@project_count = Project.search(@name).results.total
+ @memo_count = Memo.search(@name).results.total
@total_count = Elasticsearch::Model.search({
query: {
multi_match: {
query: @name,
type:"most_fields",
operator: "or",
- fields: ['login', 'firstname','lastname','name','description^0.5','filename']
+ fields: ['login', 'firstname','lastname','name','description^0.5','filename','subject','content^0.5']
}
},
highlight: {
@@ -234,10 +241,12 @@ class WelcomeController < ApplicationController
lastname: {},
name:{},
description:{},
- filename:{}
+ filename:{},
+ subject:{},
+ content:{}
}
}
- },[User,Course,Attachment,Project] ).results.total
+ },[User,Course,Attachment,Project,Memo] ).results.total
# search_type = params[:search_type].to_sym unless search_condition.blank?
# search_by = params[:search_by]
#
diff --git a/app/models/memo.rb b/app/models/memo.rb
index 7c4fbdcf1..5d590e228 100644
--- a/app/models/memo.rb
+++ b/app/models/memo.rb
@@ -1,7 +1,9 @@
+require 'elasticsearch/model'
class Memo < ActiveRecord::Base
include Redmine::SafeAttributes
include UserScoreHelper
include ApplicationHelper
+ include Elasticsearch::Model
belongs_to :forum
has_many_kindeditor_assets :assets, :dependent => :destroy
belongs_to :author, :class_name => "User", :foreign_key => 'author_id'
@@ -12,6 +14,18 @@ class Memo < ActiveRecord::Base
validates_length_of :content, maximum: 30000
validate :cannot_reply_to_locked_topic, :on => :create
+
+ #elasticsearch kaminari init
+ Kaminari::Hooks.init
+ Elasticsearch::Model::Response::Response.__send__ :include, Elasticsearch::Model::Response::Pagination::Kaminari
+ settings index: { number_of_shards: 5 } do
+ mappings dynamic: 'false' do
+ indexes :subject, analyzer: 'smartcn',index_options: 'offsets'
+ indexes :content, analyzer: 'smartcn',index_options: 'offsets'
+ indexes :updated_at, type:'date'
+ end
+ end
+
acts_as_tree :counter_cache => :replies_count, :order => "#{Memo.table_name}.created_at ASC"
acts_as_attachable
has_many :user_score_details, :class_name => 'UserScoreDetails',:as => :score_changeable_obj
@@ -47,9 +61,9 @@ class Memo < ActiveRecord::Base
"parent_id",
"replies_count"
- after_create :add_author_as_watcher, :reset_counters!, :send_mail, :send_message
- # after_update :update_memos_forum
- after_destroy :reset_counters!,:delete_kindeditor_assets#,:down_user_score -- 公共区发帖暂不计入得分
+ after_create :add_author_as_watcher, :reset_counters!, :send_mail, :send_message,:create_memo_ealasticsearch_index
+ after_update :update_memo_ealasticsearch_index
+ after_destroy :reset_counters!,:delete_kindeditor_assets,:delete_memo_ealasticsearch_index#,:down_user_score -- 公共区发帖暂不计入得分,
# after_create :send_notification
# after_save :plusParentAndForum
# after_destroy :minusParentAndForum
@@ -57,6 +71,36 @@ class Memo < ActiveRecord::Base
# scope :visible, lambda { |*args|
# includes(:forum => ).where()
# }
+ scope :indexable,lambda {
+ where('parent_id is null')
+ }
+
+ def self.search(query)
+ __elasticsearch__.search(
+ {
+ query: {
+ multi_match: {
+ query: query,
+ type:"most_fields",
+ operator: "or",
+ fields: ['subject','content^0.5']
+ }
+ },
+ sort: {
+ _score:{order: "desc" },
+ updated_at:{order: "desc" }
+ },
+ highlight: {
+ pre_tags: [''],
+ post_tags: [''],
+ fields: {
+ subject: {},
+ content: {}
+ }
+ }
+ }
+ )
+ end
def send_mail
Mailer.run.forum_message_added(self) if Setting.notified_events.include?('forum_message_added')
@@ -203,6 +247,22 @@ class Memo < ActiveRecord::Base
# Author lizanle
# Description 从硬盘上删除资源
def delete_kindeditor_assets
- delete_kindeditor_assets_from_disk self.id,OwnerTypeHelper::MEMO
+ delete_kindeditor_assets_from_disk self.id,OwnerTypeHelper::MEMO
+ end
+
+ def create_memo_ealasticsearch_index
+ if self.parent_id.nil?
+ self.__elasticsearch__.index_document
+ end
+ end
+ def update_memo_ealasticsearch_index
+ if self.parent_id.nil?
+ self.__elasticsearch__.update_document
+ end
+ end
+ def delete_memo_ealasticsearch_index
+ if self.parent_id.nil?
+ self.__elasticsearch__.delete_document
+ end
end
end
diff --git a/app/views/welcome/_search_all_results.html.erb b/app/views/welcome/_search_all_results.html.erb
index 014c6b487..34ef9a8eb 100644
--- a/app/views/welcome/_search_all_results.html.erb
+++ b/app/views/welcome/_search_all_results.html.erb
@@ -72,6 +72,22 @@
+ <% when 'memo'%>
+
<%end %>
<% end %>
+
+
+
diff --git a/app/views/welcome/search.js.erb b/app/views/welcome/search.js.erb
index c53c5d219..5cb446896 100644
--- a/app/views/welcome/search.js.erb
+++ b/app/views/welcome/search.js.erb
@@ -9,5 +9,7 @@ $("#searchContent_3").html('<%= escape_javascript(render :partial => 'search_cou
$("#searchContent_5").html('<%= escape_javascript(render :partial => 'search_project_results',:locals => {:projects=>@projects})%>');
<% when 'attachment'%>
$("#searchContent_4").html('<%= escape_javascript(render :partial => 'search_attachment_results',:locals => {:attachments=>@attachments})%>');
+<% when 'memo'%>
+$("#searchContent_6").html('<%= escape_javascript(render :partial => 'search_memo_results',:locals => {:memos=>@memos})%>');
<%else%>
<%end %>
\ No newline at end of file
diff --git a/lib/tasks/elasticsearch_batch_op.rake b/lib/tasks/elasticsearch_batch_op.rake
index fb2c638bc..91c2ddff9 100644
--- a/lib/tasks/elasticsearch_batch_op.rake
+++ b/lib/tasks/elasticsearch_batch_op.rake
@@ -28,4 +28,11 @@ namespace :importer do
ENV['BATCH']='1000'
Rake::Task["elasticsearch:import:model"].invoke
end
+ task :importmemo do
+ ENV['CLASS']='Memo'
+ ENV['SCOPE']='indexable'
+ ENV['FORCE']='y'
+ ENV['BATCH']='1000'
+ Rake::Task["elasticsearch:import:model"].invoke
+ end
end
\ No newline at end of file
From ad2d9fa374bfd1d4e348de8bdf3f3fda6a1849d7 Mon Sep 17 00:00:00 2001
From: lizanle <491823689@qq.com>
Date: Mon, 7 Dec 2015 15:32:57 +0800
Subject: [PATCH 2/9] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=AF=B9=E5=B8=96?=
=?UTF-8?q?=E5=AD=90=E7=9A=84=E5=85=A8=E6=96=87=E6=90=9C=E7=B4=A2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/users/_user_message_course.html.erb | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/app/views/users/_user_message_course.html.erb b/app/views/users/_user_message_course.html.erb
index 640f98b1f..cc6415c14 100644
--- a/app/views/users/_user_message_course.html.erb
+++ b/app/views/users/_user_message_course.html.erb
@@ -173,19 +173,25 @@
<%=link_to ma.course_message.user.lastname + ma.course_message.user.firstname + "老师",
user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher" %>">关闭了作业匿评:
- <%= link_to "作业题目:" + ma.course_message.name, student_work_index_path(:homework => ma.course_message.id), :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
+ <%= link_to "作业标题:" + ma.course_message.name, student_work_index_path(:homework => ma.course_message.id), :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
:onmouseover =>"message_titile_show($(this),event)",
:onmouseout => "message_titile_hide($(this))"%>
<%= User.current.lastname + User.current.firstname %><%= User.current.allowed_to?(:as_teacher,ma.course_message.course) ? '老师':'同学'%>您好!
- <%= User.current.eql?(ma.course_message.user)?"您":(ma.course_message.user.lastname + ma.course_message.user.firstname+"老师") %>关闭了匿评,作业详情如下:
+ 系统已按缺省策略自动<% if User.current.allowed_to?(:as_teacher,ma.course_message.course)%>帮您<% end %>关闭了匿评。作业信息如下:
- 课程名称:<%= ma.course_message.course.name %>(<%= ma.course_message.course.time.to_s + '年'+ ma.course_message.course.term %>)
- 作业标题:<%= ma.course_message.name %>
+
+
注:缺省情况下,系统将在作业提交截止日期后自动关闭匿评。
+
+ <% if User.current.allowed_to?(:as_teacher,ma.course_message.course)%>
+
祝您的教学活动高效、顺利、愉快!
+ <% end %>
<%= time_tag(ma.created_at).html_safe %>
From 9e01f02a661890fe6700192da1dd8873d4d8fcae Mon Sep 17 00:00:00 2001
From: lizanle <491823689@qq.com>
Date: Mon, 7 Dec 2015 15:52:22 +0800
Subject: [PATCH 3/9] =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E9=A2=98=E7=9B=AE?=
=?UTF-8?q?=E7=BB=9F=E4=B8=80=E6=94=B9=E4=B8=BA=E4=BD=9C=E4=B8=9A=E6=A0=87?=
=?UTF-8?q?=E9=A2=98=20=20=E4=BD=9C=E4=B8=9A=E5=8C=BF=E8=AF=84=E6=88=AA?=
=?UTF-8?q?=E6=AD=A2=E6=B6=88=E6=81=AF=E6=94=B9=E9=80=A0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/users/_user_message_course.html.erb | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/app/views/users/_user_message_course.html.erb b/app/views/users/_user_message_course.html.erb
index cc6415c14..4d838d4d1 100644
--- a/app/views/users/_user_message_course.html.erb
+++ b/app/views/users/_user_message_course.html.erb
@@ -45,12 +45,12 @@
<% if !User.current.allowed_to?(:as_teacher, ma.course_message.course) && cur_user_works_for_homework(ma.course_message).nil? %>
- <%= link_to "作业题目:" + ma.course_message.name, new_student_work_path(:homework => ma.course_message.id),
+ <%= link_to "作业标题:" + ma.course_message.name, new_student_work_path(:homework => ma.course_message.id),
:class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
:onmouseover =>"message_titile_show($(this),event)",
:onmouseout => "message_titile_hide($(this))" %>
<% else %>
- <%= link_to "作业题目:" + ma.course_message.name, student_work_index_path(:homework => ma.course_message.id),
+ <%= link_to "作业标题:" + ma.course_message.name, student_work_index_path(:homework => ma.course_message.id),
:class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
:onmouseover => "message_titile_show($(this),event)",
:onmouseout => "message_titile_hide($(this))" %>
@@ -103,7 +103,7 @@
user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher", :title => "#{ma.course_message.user.lastname + ma.course_message.user.firstname}老师" %>
">发布的作业:
- <%= link_to "作业题目:" + ma.course_message.name, student_work_index_path(:homework => ma.course_message.id),
+ <%= link_to "作业标题:" + ma.course_message.name, student_work_index_path(:homework => ma.course_message.id),
:class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
:onmouseover => "message_titile_show($(this),event)",
:onmouseout => "message_titile_hide($(this))" %>
@@ -142,7 +142,7 @@
">启动了作业匿评:
- <%= link_to "作业题目:" + ma.course_message.name, student_work_index_path(:homework => ma.course_message.id), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
+ <%= link_to "作业标题:" + ma.course_message.name, student_work_index_path(:homework => ma.course_message.id), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
:onmouseover => "message_titile_show($(this),event)",
:onmouseout => "message_titile_hide($(this))" %>
@@ -180,14 +180,14 @@
<%= User.current.lastname + User.current.firstname %><%= User.current.allowed_to?(:as_teacher,ma.course_message.course) ? '老师':'同学'%>您好!
- 系统已按缺省策略自动<% if User.current.allowed_to?(:as_teacher,ma.course_message.course)%>帮您<% end %>关闭了匿评。作业信息如下:
+ 该作业已经被关闭了匿评。作业信息如下:
- 课程名称:<%= ma.course_message.course.name %>(<%= ma.course_message.course.time.to_s + '年'+ ma.course_message.course.term %>)
- 作业标题:<%= ma.course_message.name %>
-
注:缺省情况下,系统将在作业提交截止日期后自动关闭匿评。
+
注:缺省情况下,系统将在作业提交截止日期后14天自动关闭匿评。
<% if User.current.allowed_to?(:as_teacher,ma.course_message.course)%>
祝您的教学活动高效、顺利、愉快!
@@ -208,7 +208,7 @@
">启动作业匿评失败
- <%= link_to "作业题目:" + ma.course_message.name, student_work_index_path(:homework => ma.course_message.id), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
+ <%= link_to "作业标题:" + ma.course_message.name, student_work_index_path(:homework => ma.course_message.id), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
:onmouseover => "message_titile_show($(this),event)",
:onmouseout => "message_titile_hide($(this))" %>
@@ -391,7 +391,7 @@
">发布的作业:
- <%= link_to "作业题目:" + ma.course_message.homework_common.name, student_work_index_path(:homework => ma.course_message.homework_common_id),
+ <%= link_to "作业标题:" + ma.course_message.homework_common.name, student_work_index_path(:homework => ma.course_message.homework_common_id),
:class => "#{ma.viewed==0 ? "newsBlack" : "newsGrey"}",
:onmouseover => "message_titile_show($(this),event)",
:onmouseout => "message_titile_hide($(this))" %>
From ee661bb6d4c5e9eeacf89ac4081a61aca8c22955 Mon Sep 17 00:00:00 2001
From: lizanle <491823689@qq.com>
Date: Mon, 7 Dec 2015 16:21:00 +0800
Subject: [PATCH 4/9] =?UTF-8?q?input=E5=85=89=E5=85=89=E6=A0=87=E5=88=B0?=
=?UTF-8?q?=E6=9C=80=E5=90=8E=E7=9A=84=E6=8A=98=E4=B8=AD=E8=A7=A3=E5=86=B3?=
=?UTF-8?q?=E6=96=B9=E6=A1=88?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/users/search_user_course.js.erb | 4 +++-
app/views/users/search_user_project.js.erb | 3 +++
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/app/views/users/search_user_course.js.erb b/app/views/users/search_user_course.js.erb
index 60ddd6d9c..2a0c98cad 100644
--- a/app/views/users/search_user_course.js.erb
+++ b/app/views/users/search_user_course.js.erb
@@ -15,4 +15,6 @@ $('#ajax-modal').siblings().remove();
$('#ajax-modal').before("");
$('#ajax-modal').parent().css("top","").css("left","");
$('#ajax-modal').parent().addClass("popbox").addClass("resourceUploadPopup");
-$('#ajax-modal').css("padding-left","16px").css("padding-bottom","16px");
\ No newline at end of file
+$('#ajax-modal').css("padding-left","16px").css("padding-bottom","16px");
+var val = $("#search_course_input").val();
+$("#search_course_input").val("").focus().val(val);
diff --git a/app/views/users/search_user_project.js.erb b/app/views/users/search_user_project.js.erb
index 26a0f265c..f38d9edc8 100644
--- a/app/views/users/search_user_project.js.erb
+++ b/app/views/users/search_user_project.js.erb
@@ -12,3 +12,6 @@ $('#ajax-modal').before("
Date: Mon, 7 Dec 2015 17:29:14 +0800
Subject: [PATCH 5/9] =?UTF-8?q?=E8=B5=84=E6=BA=90=E5=BA=93=E7=9B=91?=
=?UTF-8?q?=E5=90=AC=E5=9B=9E=E8=BD=A6=E9=94=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/users/user_resource.html.erb | 33 +++++++++++++-------------
config/routes.rb | 2 +-
2 files changed, 18 insertions(+), 17 deletions(-)
diff --git a/app/views/users/user_resource.html.erb b/app/views/users/user_resource.html.erb
index a6d8d18c7..ae17eb733 100644
--- a/app/views/users/user_resource.html.erb
+++ b/app/views/users/user_resource.html.erb
@@ -361,12 +361,11 @@
if(user_id === '<%= User.current.id%>') {
res_name = line.children().eq(1).children().attr('title');
res_link = line.children().eq(1).html();
- line.children().eq(1).html('<%= form_tag(url_for(:controller => 'users',:action => 'rename_resource',:method => 'post',:remote=>true,:id=>@user.id),:id=>"res_name_form" ) do%>' +
+ line.children().eq(1).html(
' '+
- '<% end %>');
+ '"/> ');
$("#res_name").focus();
$("html,body").animate({scrollTop:$("#res_name").offset().top},1000)
}else{
@@ -382,6 +381,8 @@
return str.slice(0, i + 1);
}
+
+
//恢复编辑状态到链接状态
//如果当前是编辑状态,任何的不在输入框里的单击右键事件都需要将编辑状态变回链接状态
//如果是编辑状态,且做了修改,那么久要进行修改,并且将修改值经过处理替换到页面显示
@@ -395,22 +396,22 @@
if( name && name != res_name.trim()){
if(confirm('确定修改为 '+name)){
- $.post(
- '<%=rename_resource_user_path(@user) %>',
- "res_name="+$('#res_name').val()+"&res_id="+$("#res_id").val(),
- function (data){
- if(data != 'fail'){//修改成功,那么将链接恢复,并且将链接的显示内容改变。链接可以不变
+ $.ajax({
+ url: '<%=rename_resource_user_path(@user) %>'+ "?res_name="+$('#res_name').val() + "&res_id=" + $("#res_id").val(),
+ type:'get',
+ success:function (data)
+ {
+ if (data != 'fail') {//修改成功,那么将链接恢复,并且将链接的显示内容改变。链接可以不变
last_line.children().eq(1).html(res_link);
- last_line.children().eq(1).children().attr('title',name);
- last_line.children().eq(1).children().attr('href',data);
- last_line.children().eq(1).children().html(name.length > 17? name.substring(0,17)+'...' : name);
- }else{
+ last_line.children().eq(1).children().attr('title', name);
+ last_line.children().eq(1).children().attr('href', data);
+ last_line.children().eq(1).children().html(name.length > 17 ? name.substring(0, 17) + '...' : name);
+ } else {
last_line.children().eq(1).html(res_link);
res_link = null; //如果修改失败,恢复之后将res_link置空
}
- },
- 'text'
- );
+ }
+ } );
}else{
last_line.children().eq(1).html(res_link);
res_link = null; //如果没有做修改,恢复之后将res_link置空
diff --git a/config/routes.rb b/config/routes.rb
index f6fe95a33..623a42f38 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -478,7 +478,7 @@ RedmineApp::Application.routes.draw do
post "add_exist_file_to_course"
post "add_exist_file_to_project"
get 'resource_preview'
- post 'rename_resource'
+ get 'rename_resource'
get 'search_user_project'
get 'user_resource_type'
get 'user_ref_resource_search'
From 92bc3361fe79f09e0046231e8ac53e8172cadf09 Mon Sep 17 00:00:00 2001
From: lizanle <491823689@qq.com>
Date: Tue, 8 Dec 2015 15:33:17 +0800
Subject: [PATCH 6/9] =?UTF-8?q?=E5=8C=BF=E8=AF=84=E5=A4=B1=E8=B4=A5?=
=?UTF-8?q?=E6=B6=88=E6=81=AF=E6=94=B9=E5=8F=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/users/_user_message_course.html.erb | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/app/views/users/_user_message_course.html.erb b/app/views/users/_user_message_course.html.erb
index 4d838d4d1..1ca8f5e1a 100644
--- a/app/views/users/_user_message_course.html.erb
+++ b/app/views/users/_user_message_course.html.erb
@@ -208,7 +208,7 @@
">启动作业匿评失败
- <%= link_to "作业标题:" + ma.course_message.name, student_work_index_path(:homework => ma.course_message.id), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
+ <%= link_to truncate(ma.course_message.name,:length=>25)+'(失败原因:提交作品的人数低于2人)', student_work_index_path(:homework => ma.course_message.id), :class => "#{ma.viewed == 0 ? "c_red" : "newsGrey "}",
:onmouseover => "message_titile_show($(this),event)",
:onmouseout => "message_titile_hide($(this))" %>
@@ -219,7 +219,6 @@
- - 失败原因:提交作品的人数低于2人
- 课程名称:<%= ma.course_message.course.name %>(<%= ma.course_message.course.time.to_s + '年' + ma.course_message.course.term %>)
- 作业标题:<%= ma.course_message.name %>
- 提交截止:<%= ma.course_message.end_time%> 23:59
From c1d82d6348084f217ba51ec83076083afacae4ce Mon Sep 17 00:00:00 2001
From: lizanle <491823689@qq.com>
Date: Wed, 9 Dec 2015 09:39:07 +0800
Subject: [PATCH 7/9] =?UTF-8?q?=E8=BE=93=E5=85=A5=E6=A1=86=20=E5=92=8C=20?=
=?UTF-8?q?=20ke=E5=AF=B9=E9=BD=90?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/news/_project_form.html.erb | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/app/views/news/_project_form.html.erb b/app/views/news/_project_form.html.erb
index 269420bfe..81012e749 100644
--- a/app/views/news/_project_form.html.erb
+++ b/app/views/news/_project_form.html.erb
@@ -1,18 +1,19 @@
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
-
-
-
+
+
+
-
<% if is_new %>
<%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %>
- <%= f.kindeditor :description,:width=>'91%',:editor_id=>'project_news_description_editor' %>
+ <%= f.kindeditor :description,:width=>'90%',:editor_id=>'project_news_description_editor' %>
<% else %>
- <%= f.kindeditor :description,:width=>'91%', :editor_id=>'project_news_description_editor', :owner_id => @news.id, :owner_type => OwnerTypeHelper::NEWS %>
+ <%= f.kindeditor :description,:width=>'90%', :editor_id=>'project_news_description_editor', :owner_id => @news.id, :owner_type => OwnerTypeHelper::NEWS %>
<% end %>
From 6c02115f3fb9e02436d40dcbd6b07ca2eeea4f2a Mon Sep 17 00:00:00 2001
From: lizanle <491823689@qq.com>
Date: Wed, 9 Dec 2015 10:17:30 +0800
Subject: [PATCH 8/9] =?UTF-8?q?=E4=B8=8D=E5=85=81=E8=AE=B8=E4=BF=AE?=
=?UTF-8?q?=E6=94=B9=E7=99=BB=E5=BD=95=E5=90=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/my_controller.rb | 2 +-
app/views/my/account.html.erb | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/controllers/my_controller.rb b/app/controllers/my_controller.rb
index 16d516f82..f462a64e7 100644
--- a/app/controllers/my_controller.rb
+++ b/app/controllers/my_controller.rb
@@ -118,7 +118,7 @@ class MyController < ApplicationController
@user.safe_attributes = params[:user]
@user.pref.attributes = params[:pref]
@user.pref[:no_self_notified] = (params[:no_self_notified] == '1')
- @user.login = params[:login]
+ #@user.login = params[:login]
unless @user.user_extensions.nil?
if @user.user_extensions.identity == 2
@user.firstname = params[:enterprise_name]
diff --git a/app/views/my/account.html.erb b/app/views/my/account.html.erb
index be178607f..fa9171496 100644
--- a/app/views/my/account.html.erb
+++ b/app/views/my/account.html.erb
@@ -30,7 +30,7 @@
-
- - <%= f.text_field :login,:no_label=>true, :required => true, :nh_required=>"1", :name => "login",:class=>"w210"%>
+ - <%= f.text_field :login,:no_label=>true, :required => true, :nh_required=>"1",:disabled=>'disabled', :name => "login",:class=>"w210"%>
- <%= f.text_field :mail,:no_label=>true, :required => true,:nh_required=>"1",:class=>"w210"%>
-
From 2fbad38522fd095ed76a91bdfbded5961fe98d00 Mon Sep 17 00:00:00 2001
From: lizanle <491823689@qq.com>
Date: Wed, 9 Dec 2015 12:57:25 +0800
Subject: [PATCH 9/9] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=8E=92=E5=BA=8F?=
=?UTF-8?q?=E5=8F=82=E6=95=B0=20=E7=94=A8=E4=BA=8E=E6=8E=92=E5=BA=8F?=
=?UTF-8?q?=E7=9A=84=E5=AD=97=E6=AE=B5=E6=9C=80=E5=A5=BD=E4=B8=8D=E8=A6=81?=
=?UTF-8?q?=E5=88=86=E8=AF=8D=20=E4=B8=8D=E7=84=B6=E5=B0=B1=E6=98=AF?=
=?UTF-8?q?=E5=A4=9A=E5=80=BC=E5=AD=97=E6=AE=B5=E7=9A=84=E6=8E=92=E5=BA=8F?=
=?UTF-8?q?=E4=BC=9A=E6=B5=AA=E8=B4=B9=E5=A4=A7=E9=87=8F=E7=9A=84=E5=86=85?=
=?UTF-8?q?=E5=AD=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/models/attachment.rb | 2 +-
app/models/course.rb | 2 +-
app/models/memo.rb | 2 +-
app/models/project.rb | 2 +-
app/models/user.rb | 2 +-
5 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/app/models/attachment.rb b/app/models/attachment.rb
index 999cefdaa..8d4a1a524 100644
--- a/app/models/attachment.rb
+++ b/app/models/attachment.rb
@@ -46,7 +46,7 @@ class Attachment < ActiveRecord::Base
settings index: { number_of_shards: 5 } do
mappings dynamic: 'false' do
indexes :filename, analyzer: 'smartcn',index_options: 'offsets'
- indexes :downloads, analyzer: 'smartcn',index_options: 'offsets'
+ indexes :downloads, index:"not_analyzed",index_options: 'offsets'
end
end
diff --git a/app/models/course.rb b/app/models/course.rb
index 30a6bb439..8647b82df 100644
--- a/app/models/course.rb
+++ b/app/models/course.rb
@@ -16,7 +16,7 @@ class Course < ActiveRecord::Base
mappings dynamic: 'false' do
indexes :name, analyzer: 'smartcn',index_options: 'offsets'
indexes :description, analyzer: 'smartcn',index_options: 'offsets'
- indexes :updated_at, analyzer: 'smartcn',index_options: 'offsets',type:"date"
+ indexes :updated_at, index:"not_analyzed",type:"date"
end
end
diff --git a/app/models/memo.rb b/app/models/memo.rb
index 5d590e228..2ead1cbb6 100644
--- a/app/models/memo.rb
+++ b/app/models/memo.rb
@@ -22,7 +22,7 @@ class Memo < ActiveRecord::Base
mappings dynamic: 'false' do
indexes :subject, analyzer: 'smartcn',index_options: 'offsets'
indexes :content, analyzer: 'smartcn',index_options: 'offsets'
- indexes :updated_at, type:'date'
+ indexes :updated_at,index:"not_analyzed" ,type:'date'
end
end
diff --git a/app/models/project.rb b/app/models/project.rb
index ff546e098..6495dbe26 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -39,7 +39,7 @@ class Project < ActiveRecord::Base
mappings dynamic: 'false' do
indexes :name, analyzer: 'smartcn',index_options: 'offsets'
indexes :description, analyzer: 'smartcn',index_options: 'offsets'
- indexes :updated_on, analyzer: 'smartcn',index_options: 'offsets', type:'date'
+ indexes :updated_on, index:"not_analyzed", type:'date'
end
end
diff --git a/app/models/user.rb b/app/models/user.rb
index 9c437a186..17b66a43d 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -35,7 +35,7 @@ class User < Principal
indexes :login, analyzer: 'smartcn',index_options: 'offsets'
indexes :firstname, analyzer: 'smartcn',index_options: 'offsets'
indexes :lastname, analyzer: 'smartcn',index_options: 'offsets'
- indexes :last_login_on, analyzer: 'smartcn',index_options: 'offsets',type: 'date'
+ indexes :last_login_on, index:"not_analyzed",type: 'date'
end
end