From 00633c8331fe519dcdaf6563a8db954116581efd Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Sat, 17 Jan 2015 19:00:32 +0800 Subject: [PATCH 1/5] 1 --- app/controllers/bids_controller.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/controllers/bids_controller.rb b/app/controllers/bids_controller.rb index ec2fb7d77..7e5894b83 100644 --- a/app/controllers/bids_controller.rb +++ b/app/controllers/bids_controller.rb @@ -9,6 +9,8 @@ class BidsController < ApplicationController menu_item :homework_statistics, :only => :homework_statistics menu_item :edit, :only => :edit + + before_filter :can_show_course,only: [] before_filter :can_show_contest,only: [] #Ended by young From abcf06ccc7cbd8e14713c7670247834c0ccd2f35 Mon Sep 17 00:00:00 2001 From: z9hang Date: Mon, 19 Jan 2015 15:00:46 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E8=B5=84=E6=BA=90?= =?UTF-8?q?=E4=B8=8D=E8=83=BD=E5=BC=95=E7=94=A8=E9=97=AE=E9=A2=98=E3=80=82?= =?UTF-8?q?=E5=8E=9F=E5=9B=A0=EF=BC=9A15=E5=B9=B41-3=E6=9C=88=E8=83=BD?= =?UTF-8?q?=E5=B1=9E=E4=BA=8E2014=E5=B9=B4=E7=A7=8B=E5=AD=A3=E5=AD=A6?= =?UTF-8?q?=E6=9C=9F=EF=BC=8C=E4=BB=A3=E7=A0=81=E5=8D=B4=E5=B0=86=E5=85=B6?= =?UTF-8?q?=E5=88=A4=E6=96=AD=E4=B8=BA15=E5=B9=B4=E7=A7=8B=E5=AD=A3?= =?UTF-8?q?=E5=AD=A6=E6=9C=9F=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/courses_helper.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/helpers/courses_helper.rb b/app/helpers/courses_helper.rb index a862753ef..411de1dcf 100644 --- a/app/helpers/courses_helper.rb +++ b/app/helpers/courses_helper.rb @@ -561,12 +561,13 @@ module CoursesHelper def course_in_current_or_next_term course is_current_term = false is_next_term = false - if course.time == Time.now.year && course.term == cur_course_term + year_now = Time.now.month < 3 ? Time.now.year - 1:Time.now.year + if course.time == year_now && course.term == cur_course_term is_current_term = true end - if cur_course_term == "秋季学期" && course.time == (Time.now.year + 1) && course.term == "春季学期" + if cur_course_term == "秋季学期" && course.time == (year_now + 1) && course.term == "春季学期" is_next_term = true - elsif cur_course_term == "春季学期" && course.time == Time.now.year && course.term == "秋季学期" + elsif cur_course_term == "春季学期" && course.time == year_now && course.term == "秋季学期" is_next_term = true end is_current_term || is_next_term From 493b7ca695f7666f8a5edd8ebbd7096bbce268a0 Mon Sep 17 00:00:00 2001 From: z9hang Date: Mon, 19 Jan 2015 16:05:18 +0800 Subject: [PATCH 3/5] =?UTF-8?q?#1821=20=E8=AF=BE=E7=A8=8B--=E4=BD=9C?= =?UTF-8?q?=E4=B8=9A=EF=BC=9A=E5=AF=BC=E5=87=BAexcel=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E9=97=AE=E9=A2=98=20=E8=B0=83=E6=95=B4=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/locales/zh.yml | 2 +- public/stylesheets/course_group.css | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/config/locales/zh.yml b/config/locales/zh.yml index ac7c52fe2..681dfadc1 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -2110,7 +2110,7 @@ zh: excel_homework_list: 作品列表 excel_been_rated: 已评 excel_not_rated: 未评 - label_export_excel: 导出Excel + label_export_excel: 导出列表 label_softapplication: 应用软件 label_attending_contest: 参加竞赛 diff --git a/public/stylesheets/course_group.css b/public/stylesheets/course_group.css index 71f870a9a..b6c7f4f8c 100644 --- a/public/stylesheets/course_group.css +++ b/public/stylesheets/course_group.css @@ -41,8 +41,9 @@ input.f_2 { .st_search{ margin:10px 0;} .st_search span{ font-size:14px; font-weight:bold; color:#606060; margin-right:35px;} .st_search input{ border:1px solid #1c9ec7; height:20px; width:200px;} - a:hover.xls{ background: url('../images/icon_excel.gif') no-repeat scroll 1px 50% transparent !important; - padding: 2px 0px 3px 16px; + a:hover.xls{ /*background: url('../images/icon_excel.gif') no-repeat scroll 1px 50% transparent !important;*/ + /*padding: 2px 0px 3px 16px;*/ + background:#ffffff !important; font-family:微软雅黑 !important; font-size: 12px !important; color: #136b3b !important; From 14a1f31a1270eaef0bbaa6211026dccf203fc9cf Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Mon, 19 Jan 2015 16:43:21 +0800 Subject: [PATCH 4/5] =?UTF-8?q?1=E3=80=81=E9=A1=B9=E7=9B=AE=E5=8A=A8?= =?UTF-8?q?=E6=80=81=20->=20=E8=BF=91=E6=9C=9F=E5=8A=A8=E6=80=81=202?= =?UTF-8?q?=E3=80=81=E4=BF=AE=E5=A4=8D=E6=96=B0=E5=BB=BA=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E6=97=B6=EF=BC=8C=E6=8F=8F=E8=BF=B0=E4=BC=9A?= =?UTF-8?q?=E6=9C=89=E4=B8=80=E8=A1=8C=E7=A9=BA=E7=99=BD=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/courses/_course_form.html.erb | 4 +--- config/locales/zh.yml | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/app/views/courses/_course_form.html.erb b/app/views/courses/_course_form.html.erb index c48d24935..d293f9ed1 100644 --- a/app/views/courses/_course_form.html.erb +++ b/app/views/courses/_course_form.html.erb @@ -127,9 +127,7 @@ <%= l(:label_new_course_description) %>      - +

diff --git a/config/locales/zh.yml b/config/locales/zh.yml index ac7c52fe2..061baa932 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -748,7 +748,7 @@ zh: label_news_view_all: 查看所有新闻 label_news_added: 新闻已添加 label_settings: 配置 - label_overview: 项目动态 + label_overview: 近期动态 label_course_overview: "课程动态" label_question_student: 作业交流 #bai label_homework_commit: 提交作业 #huang From 40d6c3b19cdb06be75220d60f9669ae592941681 Mon Sep 17 00:00:00 2001 From: alan <547533434@qq.com> Date: Tue, 20 Jan 2015 16:33:59 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E3=80=8A=E9=82=AE?= =?UTF-8?q?=E7=AE=B1=E5=9C=B0=E5=9D=80=E9=AA=8C=E8=AF=81=E6=98=AF=E5=90=A6?= =?UTF-8?q?=E5=AD=98=E5=9C=A8=E5=8F=8A=E5=9B=BD=E9=99=85=E5=8C=96=E7=9A=84?= =?UTF-8?q?=E7=BC=96=E5=86=99=E3=80=8B=E5=8A=9F=E8=83=BD=20Signed-off-by:?= =?UTF-8?q?=20alan=20<547533434@qq.com>?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Gemfile | 4 +++- app/controllers/account_controller.rb | 3 +++ app/models/user.rb | 2 +- config/application.rb | 5 +++++ config/environments/development.rb | 2 +- config/locales/en.yml | 11 +++++++++++ config/locales/zh.yml | 17 +++++++++++++++++ 7 files changed, 41 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index 6c2101345..5045cb822 100644 --- a/Gemfile +++ b/Gemfile @@ -18,6 +18,7 @@ gem "builder", "3.0.0" gem 'acts-as-taggable-on', '2.4.1' gem 'spreadsheet' gem 'ruby-ole' +gem 'email_verifier' group :development do gem 'better_errors', path: 'lib/better_errors' @@ -51,7 +52,8 @@ group :development, :test do gem 'ruby-prof', '~> 0.15.1' unless RUBY_PLATFORM =~ /w32/ gem 'pry' gem 'pry-nav' - + gem 'rspec-rails' , '2.13.1' + gem 'guard-rspec','2.5.0' end diff --git a/app/controllers/account_controller.rb b/app/controllers/account_controller.rb index 6c95294d7..69c2d3002 100644 --- a/app/controllers/account_controller.rb +++ b/app/controllers/account_controller.rb @@ -345,7 +345,10 @@ class AccountController < ApplicationController if user.save and token.save UserStatus.create(:user_id => user.id, :changsets_count => 0, :watchers_count => 0) Mailer.register(token).deliver + + flash[:notice] = l(:notice_account_register_done) + render action: 'email_valid', locals: {:mail => user.mail} else yield if block_given? diff --git a/app/models/user.rb b/app/models/user.rb index 52619b038..bef65fe54 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -188,7 +188,7 @@ class User < Principal validates_confirmation_of :password, :allow_nil => true validates_inclusion_of :mail_notification, :in => MAIL_NOTIFICATION_OPTIONS.collect(&:first), :allow_blank => true validate :validate_password_length - + validates_email_realness_of :mail before_create :set_mail_notification before_save :update_hashed_password before_destroy :remove_references_before_destroy diff --git a/config/application.rb b/config/application.rb index d37a9eae2..716e3875d 100644 --- a/config/application.rb +++ b/config/application.rb @@ -16,6 +16,11 @@ module RedmineApp # Application configuration should go into files in config/initializers # -- all .rb files in that directory are automatically loaded. + # verifier if email is real + EmailVerifier.config do |config| + config.verifier_email = "lizanle521@126.com" + end + # Custom directories with classes and modules you want to be autoloadable. config.autoload_paths += %W(#{config.root}/lib) diff --git a/config/environments/development.rb b/config/environments/development.rb index 9d3cbf244..8bec9789c 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -13,7 +13,7 @@ RedmineApp::Application.configure do config.action_controller.perform_caching = false # Don't care if the mailer can't send - config.action_mailer.raise_delivery_errors = false + config.action_mailer.raise_delivery_errors = true config.active_support.deprecation = :log end diff --git a/config/locales/en.yml b/config/locales/en.yml index dd79a546c..d25ba6ae2 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -71,6 +71,14 @@ en: one: "almost 1 year" other: "almost %{count} years" + errors: + messages: + email_verifier: + email_not_real: must point to a real mail account + out_of_mail_server: appears to point to dead mail server + no_mail_server: appears to point to domain which doesn't handle e-mail + failure: could not be checked if is real + exception: could not be sent number: format: separator: "." @@ -130,6 +138,9 @@ en: circular_dependency: "This relation would create a circular dependency" cant_link_an_issue_with_a_descendant: "An issue cannot be linked to one of its subtasks" + + + actionview_instancetag_blank_option: Please select attachment_all: "All" diff --git a/config/locales/zh.yml b/config/locales/zh.yml index ac7c52fe2..ea045f29b 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -2,6 +2,10 @@ # Chinese (China) translations for Ruby on Rails # by tsechingho (http://github.com/tsechingho) zh: + + + + # Text direction: Left-to-Right (ltr) or Right-to-Left (rtl) direction: ltr jquery: @@ -30,6 +34,17 @@ zh: - :month - :day + + errors: + messages: + email_verifier: + email_not_real: 必须指定一个真实的邮箱地址 + out_of_mail_server: 指向了一个已停用的邮箱服务器 + no_mail_server: 域名地址没有邮件功能 + failure: 邮箱地址不能被验证 + exception: 邮箱不能发送成功 + + time: formats: default: "%Y年%b%d日 %A %H:%M:%S" @@ -138,6 +153,8 @@ zh: circular_dependency: "此关联将导致循环依赖" cant_link_an_issue_with_a_descendant: "问题不能关联到它的子任务" + + actionview_instancetag_blank_option: 请选择 attachment_all: "全部"