From b68e227531bd4adcfeb834ea08dea3cb06276b83 Mon Sep 17 00:00:00 2001
From: yuanke <249218296@qq.com>
Date: Wed, 22 Jun 2016 14:04:47 +0800
Subject: [PATCH] =?UTF-8?q?=E6=B2=A1=E6=BF=80=E6=B4=BB=E7=9A=84=E5=B8=90?=
=?UTF-8?q?=E5=8F=B7=E7=95=8C=E9=9D=A2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/account_controller.rb | 15 +-
app/controllers/users_controller.rb | 6 +
app/controllers/words_controller.rb | 20 +++
app/views/account/email_activation.html.erb | 52 ++++++
config/routes.rb | 5 +-
public/stylesheets/header.css | 176 ++++++++++++++++++++
6 files changed, 270 insertions(+), 4 deletions(-)
create mode 100644 app/views/account/email_activation.html.erb
diff --git a/app/controllers/account_controller.rb b/app/controllers/account_controller.rb
index 33d988e35..8bf40d472 100644
--- a/app/controllers/account_controller.rb
+++ b/app/controllers/account_controller.rb
@@ -239,14 +239,21 @@ class AccountController < ApplicationController
end
def resendmail
+ status = 1
user = User.find(params[:user]) if params[:user]
token = Token.new(:user => user, :action => "register")
if token.save
Mailer.run.register(token)
-
else
yield if block_given?
+ status = 0
end
+ render :json => status
+ end
+
+ def email_activation
+
+
end
private
@@ -264,6 +271,7 @@ class AccountController < ApplicationController
if user.nil?
invalid_credentials
elsif user.status == 2
+ @user = user
invalid_credentials_new
elsif user.new_record?
onthefly_creation_failed(user, {:login => user.login, :auth_source_id => user.auth_source_id })
@@ -375,8 +383,9 @@ class AccountController < ApplicationController
def invalid_credentials_new
logger.warn "Failed login for '#{params[:username]}' from #{request.remote_ip} at #{Time.now.utc}"
- flash[:error] = l(:notice_account_invalid_creditentials_new)
- render signin_path(:login=>true)
+ # flash[:error] = l(:notice_account_invalid_creditentials_new)
+ # render signin_path(:login=>true)
+ render :action => 'email_activation'
end
# Register a user for email activation.
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index 87c7d8f54..ed8a9fa36 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -1239,6 +1239,12 @@ class UsersController < ApplicationController
render :layout=>'new_base_user'
end
+ #给某人留言
+ def feedBackTo
+
+
+ end
+
def user_comments
end
diff --git a/app/controllers/words_controller.rb b/app/controllers/words_controller.rb
index 22b7f1f52..3b540f0d0 100644
--- a/app/controllers/words_controller.rb
+++ b/app/controllers/words_controller.rb
@@ -337,6 +337,26 @@ class WordsController < ApplicationController
UserExtensions.introduction(user, message)
redirect_to user_url(user.id)
end
+
+ #邮箱激活问题留言 留言成功给出提示框
+ def leave_email_activation_message
+ status = 1 #成功
+ me = User.find(params[:user])
+ if me
+ @user = User.find(params[:id])
+ if params[:text].size>0 && @user
+ # @user.add_jour(me, params[:text])
+ #私信
+ message = "【未收到激活邮件的用户反馈,用户邮箱:"+me.mail+"】
"+params[:text]
+ @user.journals_for_messages << JournalsForMessage.new(:user_id => me.id, :notes => message, :reply_id => 0, :status => true, :is_readed => false, :private => 1)
+ else
+ status = 0
+ end
+ render :json => status
+ else
+ render_403
+ end
+ end
private
diff --git a/app/views/account/email_activation.html.erb b/app/views/account/email_activation.html.erb
new file mode 100644
index 000000000..abd010a96
--- /dev/null
+++ b/app/views/account/email_activation.html.erb
@@ -0,0 +1,52 @@
+
+
+
您的账号尚未激活,请先进入您的注册邮箱,激活您的账号。
+
+ <%#= link_to l(:label_mail_resend), { :controller => 'account', :action => 'resendmail',:user => @user}, :class=>"email_verify_btn mt30 ml30", :remote => true, :method => 'get' %>
+
+ 如果您尚未收到激活邮件,请按照以下步骤操作:
+ - 检查邮箱的“订阅邮件”、“垃圾邮件”,可能会发现激活邮件。
+ - 如果激活邮件已无效,请点击重新发送激活邮件按钮。
+ - 如果您无法收到激活邮件,请您直接给我们管理员留言:
+
+
+
+
+
diff --git a/config/routes.rb b/config/routes.rb
index ec8fa2337..6e720ffba 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -489,10 +489,13 @@ RedmineApp::Application.routes.draw do
match 'account/activate', :via => :get
match 'account/valid_ajax', :via => :get
match 'account/email_valid', :to => 'account#email_valid', :via => :get
- match 'account/resendmail', :to => 'account#resendmail', :via=> :get
+ match 'account/resendmail', :to => 'account#resendmail', :via=> :get, :as => 'resendmail'
match 'projects/:id/wiki', :to => 'wikis#edit', :via => :post
match 'projects/:id/wiki/destroy', :to => 'wikis#destroy', :via => [:get, :post]
+ #激活邮箱反馈问题
+ match 'users/:id/leave_email_activation_message', :to => 'words#leave_email_activation_message', :via => :get, :as => "leave_email_activation_message"
+
# boards
match 'boards/:board_id/topics/new', :to => 'messages#new', :via => [:get, :post], :as => 'new_board_message'
match 'boards/:id/join_to_org_subfields', :to => 'boards#join_to_org_subfields'
diff --git a/public/stylesheets/header.css b/public/stylesheets/header.css
index 767d76cb2..5700d0b00 100644
--- a/public/stylesheets/header.css
+++ b/public/stylesheets/header.css
@@ -117,3 +117,179 @@ a.f_grey:hover {color:#000000 !important;}
#loginInButton {height:54px; padding-left:10px; padding-right:10px; text-align:center; line-height:54px; vertical-align:middle; color:#ffffff; font-size:16px;}
#loginSignButton:hover {background-color:#297fb8;}
#loginInButton:hover {background-color:#297fb8;}
+
+/* 邮箱验证 */
+.email_verify body,h1,h2,h3,h4,h5,h6,hr,p,blockquote,dl,dt,dd,ul,ol,li,pre,form,fieldset,legend,button,input,textarea,th,td{ margin:0; padding:0;}
+.mt30{ margin-top:30px;}
+.ml30{ margin-left:30px;}
+.new_content{
+ width:1000px;
+ margin:10px auto;
+ padding:30px 0;
+ background-color:#fff;
+}
+.email_verify{
+ width:720px;
+ margin:0px auto;
+}
+.email_verify_prompt{
+ border:2px solid #dd0000;
+ background:#ffe3e3 url(../images/icons_prompt.png) 25px 10px no-repeat;;
+ height:35px;
+ line-height:35px;
+ padding-left:45px;
+ color:#8b0000;
+ font-size:14px;
+}
+.email_verify_btn{
+ border-style:none;
+ height:35px;
+ padding:0 15px;
+ line-height:35px;
+ color:#fff;
+ background:#3a95d7;
+ text-align:center;
+ -webkit-border-radius:5px;
+ -moz-border-radius:5px;
+ -o-border-radius:5px;
+ border-radius:5px;
+ font-size:14px;
+}
+.email_verify_btn:hover{
+ background:#017bd3;
+}
+.email_sub_btn{
+ border-style:none;
+ height:30px;
+ padding:0 25px;
+ line-height:30px;
+ color:#fff;
+ background:#3a95d7;
+ text-align:center;
+ -webkit-border-radius:5px;
+ -moz-border-radius:5px;
+ -o-border-radius:5px;
+ border-radius:5px;
+ font-size:14px;
+}
+.email_sub_btn:hover{
+ background:#017bd3;
+}
+.email_prompt_p{
+ font-size:14px;
+ color:#000;
+ margin-bottom:10px;
+}
+.email_prompt_txt{ width:480px;}
+.email_prompt_txt li{
+ margin-left:15px;
+ list-style-type: disc;
+ color:#777;
+ line-height:1.9;
+ font-size:14px;
+}
+.email_prompt_mes{
+ border:1px solid #ccc;
+ -webkit-border-radius:5px;
+ -moz-border-radius:5px;
+ -o-border-radius:5px;
+ border-radius:5px;
+ width:468px;
+ height:60px;
+ background:#fff;
+ padding:5px;
+ margin-bottom: 5px;
+}
+.email_tanbox{
+ border:2px solid #3a95d7;
+ background:#fff;
+ width:480px;
+
+}
+.email_tancon{
+ width:420px;
+ margin:0 auto;
+ text-align:center;
+ padding:20px 30px;
+ background:#fff;
+}
+.email_tan_title{
+ font-size:18px;
+ color:#3a95d7;
+ font-weight:normal;
+ margin-bottom:5px;
+}
+.email_tan_p{
+ font-size:14px;
+ color:#4c4c4c;
+
+}
+.email_verify_p{
+ font-size:14px;
+ color:#3a95d7;
+}
+
+/***** Ajax indicator ******/
+/*-------resendmail---------*/
+#ajax-indicator {
+ position: absolute; /* fixed not supported by IE */
+ background-color:#eee;
+ border: 1px solid #bbb;
+ top:35%;
+ left:40%;
+ width:20%;
+ font-weight:bold;
+ text-align:center;
+ padding:0.6em;
+ z-index:100000;
+ opacity: 0.5;
+}
+
+html>body #ajax-indicator { position: fixed; }
+
+#ajax-indicator span {
+ background-position: 0% 40%;
+ background-repeat: no-repeat;
+ background-image: url(../images/loading.gif);
+ padding-left: 26px;
+ vertical-align: bottom;
+}
+
+div.modal {
+ border-radius: 5px;
+ background: #fff;
+ z-index: 50;
+ padding: 4px;
+}
+.ui-widget-content {
+ border: 1px solid #ddd;
+ color: #333;
+}
+.ui-widget {
+ font-family: Verdana, sans-serif;
+ font-size: 1.1em;
+}
+.ui-dialog .ui-dialog-content {
+ position: relative;
+ border: 0;
+ padding: .5em 1em;
+ background: none;
+ overflow: auto;
+ zoom: 1;
+}
+.ui-widget-overlay {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+}
+.ui-widget-overlay {
+ background: #666 url(http://forge.trustie.net/stylesheets/jquery/images/xui-bg_diagonals-thick_20_666666_40x40.png.pagespeed.ic.9mfuw_R0z1.png) 50% 50% repeat;
+ opacity: .5;
+ filter: Alpha(Opacity=50);
+}
+.resourceUploadPopup {width:400px; height:auto; border:3px solid #269ac9 !important; padding-left:16px; padding-bottom:16px; background-color:#ffffff; position:absolute; top:50%; left:50%; margin-left:-200px; z-index:1000;}
+a.Blue-btn{ display:block; margin-right:15px;width:65px; height:22px; background-color:#ffffff; line-height:24px; vertical-align:middle; text-align:center; border:1px solid #3598db; color:#3598db; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px;}
+a:hover.Blue-btn{ background:#3598db; color:#fff;}
+/***** end Ajax indicator ******/
\ No newline at end of file