Merge branch 'develop' into cxt_course

This commit is contained in:
cxt 2015-12-03 09:55:18 +08:00
commit 9c4c90e066
7 changed files with 12 additions and 10 deletions

View File

@ -3,6 +3,8 @@
class WordsController < ApplicationController class WordsController < ApplicationController
include ApplicationHelper include ApplicationHelper
before_filter :find_user, :only => [:new, :create, :destroy, :more, :back] before_filter :find_user, :only => [:new, :create, :destroy, :more, :back]
before_filter :require_login, :only => [:create_reply]
def create def create
if params[:new_form][:user_message].size>0 && User.current.logged? if params[:new_form][:user_message].size>0 && User.current.logged?
unless params[:user_id].nil? unless params[:user_id].nil?

View File

@ -43,7 +43,7 @@ class Attachment < ActiveRecord::Base
#elasticsearch kaminari init #elasticsearch kaminari init
Kaminari::Hooks.init Kaminari::Hooks.init
Elasticsearch::Model::Response::Response.__send__ :include, Elasticsearch::Model::Response::Pagination::Kaminari 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 mappings dynamic: 'false' do
indexes :filename, analyzer: 'smartcn',index_options: 'offsets' indexes :filename, analyzer: 'smartcn',index_options: 'offsets'
indexes :downloads, analyzer: 'smartcn',index_options: 'offsets' indexes :downloads, analyzer: 'smartcn',index_options: 'offsets'

View File

@ -12,7 +12,7 @@ class Course < ActiveRecord::Base
#elasticsearch kaminari init #elasticsearch kaminari init
Kaminari::Hooks.init Kaminari::Hooks.init
Elasticsearch::Model::Response::Response.__send__ :include, Elasticsearch::Model::Response::Pagination::Kaminari 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 mappings dynamic: 'false' do
indexes :name, analyzer: 'smartcn',index_options: 'offsets' indexes :name, analyzer: 'smartcn',index_options: 'offsets'
indexes :description, analyzer: 'smartcn',index_options: 'offsets' indexes :description, analyzer: 'smartcn',index_options: 'offsets'

View File

@ -35,7 +35,7 @@ class Project < ActiveRecord::Base
#elasticsearch kaminari init #elasticsearch kaminari init
Kaminari::Hooks.init Kaminari::Hooks.init
Elasticsearch::Model::Response::Response.__send__ :include, Elasticsearch::Model::Response::Pagination::Kaminari 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 mappings dynamic: 'false' do
indexes :name, analyzer: 'smartcn',index_options: 'offsets' indexes :name, analyzer: 'smartcn',index_options: 'offsets'
indexes :description, analyzer: 'smartcn',index_options: 'offsets' indexes :description, analyzer: 'smartcn',index_options: 'offsets'

View File

@ -30,7 +30,7 @@ class User < Principal
#elasticsearch kaminari init #elasticsearch kaminari init
Kaminari::Hooks.init Kaminari::Hooks.init
Elasticsearch::Model::Response::Response.__send__ :include, Elasticsearch::Model::Response::Pagination::Kaminari 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 mappings dynamic: 'false' do
indexes :login, analyzer: 'smartcn',index_options: 'offsets' indexes :login, analyzer: 'smartcn',index_options: 'offsets'
indexes :firstname, analyzer: 'smartcn',index_options: 'offsets' indexes :firstname, analyzer: 'smartcn',index_options: 'offsets'
@ -477,7 +477,7 @@ class User < Principal
end end
if user if user
# user is already in local database # user is already in local database
#return nil unless user.active? return nil if user.locked?
return nil unless user.check_password?(password) return nil unless user.check_password?(password)
else else
# user is not yet registered, try to authenticate with available sources # user is not yet registered, try to authenticate with available sources

View File

@ -126,7 +126,7 @@
</ul> </ul>
<% end %> <% end %>
</div> </div>
<li class="homepageHomeworkContentWarn fl"> &nbsp;&nbsp; 截止时间快到了!</li> <li class="homepageHomeworkContentWarn fl"> &nbsp;&nbsp; 截止时间快到</li>
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li> <li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
</ul> </ul>
<% end %> <% end %>
@ -158,7 +158,7 @@
<li>匿评截止:<span style="color:Red;"><%= ma.course_message.homework_detail_manual.evaluation_end %>&nbsp;&nbsp;23:59</span></li> <li>匿评截止:<span style="color:Red;"><%= ma.course_message.homework_detail_manual.evaluation_end %>&nbsp;&nbsp;23:59</span></li>
</ul> </ul>
<% unless User.current.allowed_to?(:as_teacher, ma.course_message.course)%> <% unless User.current.allowed_to?(:as_teacher, ma.course_message.course)%>
<p>请您尽早完成匿评如果您在截止日期前未完成匿评,您的最终成绩将被扣除<%= ma.course_message.homework_detail_manual.absence_penalty %>分乘以缺评份数。</p> <p>请您尽早完成匿评如果您在截止日期前未完成匿评,您的最终成绩将被扣除<%= ma.course_message.homework_detail_manual.absence_penalty %>分乘以缺评份数。</p>
<p>例如,您缺评了两份作品,则您的最终成绩将被扣除 <%= ma.course_message.homework_detail_manual.absence_penalty %> * 2 = <%= ma.course_message.homework_detail_manual.absence_penalty * 2 %>分</p> <p>例如,您缺评了两份作品,则您的最终成绩将被扣除 <%= ma.course_message.homework_detail_manual.absence_penalty %> * 2 = <%= ma.course_message.homework_detail_manual.absence_penalty * 2 %>分</p>
<% end%> <% end%>
</div> </div>
@ -209,7 +209,7 @@
<div style="display: none" class="message_title_red system_message_style"> <div style="display: none" class="message_title_red system_message_style">
<p> <p>
<%= User.current.lastname + User.current.firstname %><%= User.current.allowed_to?(:as_teacher, ma.course_message.course) ? '老师':'同学'%>您好! <%= 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 + "老师") %>启动作业匿评失败 <%= User.current.eql?(ma.course_message.user) ?"您":(ma.course_message.user.lastname + ma.course_message.user.firstname + "老师") %>启动作业匿评失败
</p> </p>
<ul class="ul_normal_color"> <ul class="ul_normal_color">
@ -404,7 +404,7 @@
</ul> </ul>
<p>如需获得最终成绩,请您联系主讲老师对您的作品进行单独评分!</p> <p>如需获得最终成绩,请您联系主讲老师对您的作品进行单独评分!</p>
</div> </div>
<li class="homepageHomeworkContentWarn fl"> &nbsp;&nbsp;您迟交了作品!</li> <li class="homepageHomeworkContentWarn fl"> &nbsp;&nbsp;您成功提交了作品(但被标记为迟交啦)</li>
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li> <li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
</ul> </ul>
<% end %> <% end %>

View File

@ -80,7 +80,7 @@ module RedmineApp
elsif RbConfig::CONFIG['target_os'] == 'linux' && ["testtrustie11","agent12"].include?(`hostname`.gsub("\n","")) 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 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","")) 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 else
Elasticsearch::Client.new hosts: ['localhost:9200'], retry_on_failure: true Elasticsearch::Client.new hosts: ['localhost:9200'], retry_on_failure: true
end end