diff --git a/app/controllers/words_controller.rb b/app/controllers/words_controller.rb index 6cc622c49..c9c4dcce3 100644 --- a/app/controllers/words_controller.rb +++ b/app/controllers/words_controller.rb @@ -3,6 +3,8 @@ class WordsController < ApplicationController include ApplicationHelper before_filter :find_user, :only => [:new, :create, :destroy, :more, :back] + before_filter :require_login, :only => [:create_reply] + def create if params[:new_form][:user_message].size>0 && User.current.logged? unless params[:user_id].nil? diff --git a/app/models/attachment.rb b/app/models/attachment.rb index aa436965b..999cefdaa 100644 --- a/app/models/attachment.rb +++ b/app/models/attachment.rb @@ -43,7 +43,7 @@ class Attachment < ActiveRecord::Base #elasticsearch kaminari init Kaminari::Hooks.init Elasticsearch::Model::Response::Response.__send__ :include, Elasticsearch::Model::Response::Pagination::Kaminari - settings index: { number_of_shards: 1 } do + 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' diff --git a/app/models/course.rb b/app/models/course.rb index edc5e105b..30a6bb439 100644 --- a/app/models/course.rb +++ b/app/models/course.rb @@ -12,7 +12,7 @@ class Course < ActiveRecord::Base #elasticsearch kaminari init Kaminari::Hooks.init Elasticsearch::Model::Response::Response.__send__ :include, Elasticsearch::Model::Response::Pagination::Kaminari - settings index: { number_of_shards: 1 } do + settings index: { number_of_shards: 5 } do mappings dynamic: 'false' do indexes :name, analyzer: 'smartcn',index_options: 'offsets' indexes :description, analyzer: 'smartcn',index_options: 'offsets' diff --git a/app/models/project.rb b/app/models/project.rb index c68e73369..ff546e098 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -35,7 +35,7 @@ class Project < ActiveRecord::Base #elasticsearch kaminari init Kaminari::Hooks.init Elasticsearch::Model::Response::Response.__send__ :include, Elasticsearch::Model::Response::Pagination::Kaminari - settings index: { number_of_shards: 1 } do + settings index: { number_of_shards: 5 } do mappings dynamic: 'false' do indexes :name, analyzer: 'smartcn',index_options: 'offsets' indexes :description, analyzer: 'smartcn',index_options: 'offsets' diff --git a/app/models/user.rb b/app/models/user.rb index cdec39a3d..9c437a186 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -30,7 +30,7 @@ class User < Principal #elasticsearch kaminari init Kaminari::Hooks.init Elasticsearch::Model::Response::Response.__send__ :include, Elasticsearch::Model::Response::Pagination::Kaminari - settings index: { number_of_shards: 1 } do + settings index: { number_of_shards: 5 } do mappings dynamic: 'false' do indexes :login, analyzer: 'smartcn',index_options: 'offsets' indexes :firstname, analyzer: 'smartcn',index_options: 'offsets' @@ -477,7 +477,7 @@ class User < Principal end if user # user is already in local database - #return nil unless user.active? + return nil if user.locked? return nil unless user.check_password?(password) else # user is not yet registered, try to authenticate with available sources diff --git a/app/views/users/_user_message_course.html.erb b/app/views/users/_user_message_course.html.erb index c2b1b509f..6e8fda92e 100644 --- a/app/views/users/_user_message_course.html.erb +++ b/app/views/users/_user_message_course.html.erb @@ -126,7 +126,7 @@ <% end %> -
  •    截止时间快到了!
  • +
  •    截止时间快到啦
  • <%= time_tag(ma.created_at).html_safe %>
  • <% end %> @@ -158,7 +158,7 @@
  • 匿评截止:<%= ma.course_message.homework_detail_manual.evaluation_end %>  23:59
  • <% unless User.current.allowed_to?(:as_teacher, ma.course_message.course)%> -

    请您尽早完成匿评!如果您在截止日期前未完成匿评,您的最终成绩将被扣除<%= ma.course_message.homework_detail_manual.absence_penalty %>分乘以缺评份数。

    +

    请您尽早完成匿评,如果您在截止日期前未完成匿评,您的最终成绩将被扣除<%= ma.course_message.homework_detail_manual.absence_penalty %>分乘以缺评份数。

    例如,您缺评了两份作品,则您的最终成绩将被扣除 <%= ma.course_message.homework_detail_manual.absence_penalty %> * 2 = <%= ma.course_message.homework_detail_manual.absence_penalty * 2 %>分

    <% end%> @@ -209,7 +209,7 @@ -
  •   您迟交了作品!
  • +
  •   您成功提交了作品(但被标记为迟交啦)
  • <%= time_tag(ma.created_at).html_safe %>
  • <% end %> diff --git a/config/application.rb b/config/application.rb index 61f73ee3d..9e6d41abe 100644 --- a/config/application.rb +++ b/config/application.rb @@ -80,7 +80,7 @@ module RedmineApp elsif RbConfig::CONFIG['target_os'] == 'linux' && ["testtrustie11","agent12"].include?(`hostname`.gsub("\n","")) Elasticsearch::Client.new hosts: ['localhost:9200','192.168.80.11:9200','192.168.80.12:9200'], retry_on_failure: true elsif RbConfig::CONFIG['target_os'] == 'linux' && ["trustie168","trustieserver14","trustieserver16","Trustie18"].include?(`hostname`.gsub("\n","")) - Elasticsearch::Client.new hosts: ['localhost:9200','192.168.80.168:9200','192.168.80.14:9200','192.168.80.16:9200','192.168.80.18:9200'], retry_on_failure: true + Elasticsearch::Client.new hosts: ['localhost:9200','192.168.80.168:9200'], retry_on_failure: true else Elasticsearch::Client.new hosts: ['localhost:9200'], retry_on_failure: true end