注册成功提示页与账号未激活提示页,增加‘更换邮箱的功能’

This commit is contained in:
daiao 2017-02-23 09:32:13 +08:00
parent 807129aeff
commit fa7b15db47
7 changed files with 118 additions and 12 deletions

View File

@ -279,6 +279,14 @@ class AccountController < ApplicationController
render :json => result
end
def change_email
user = User.find params[:user_id].to_i
user.update_attributes(:mail => params[:value])
result = {:email => user.mail}
render :json => result
end
def email_activation

View File

@ -0,0 +1,72 @@
<div id="muban_popup_box" style="width:400px;">
<div class="muban_popup_top">
<h3 class="fl">更换邮箱</h3>
<a href="javascript:void(0);" class="muban_icons_close fr" onclick="hideModal()"></a>
<div class="cl"></div>
</div>
<div class="sy_popup_con" style="width:380px;">
<ul class="sy_popup_add" >
<li class="center mb5" style="line-height:20px;text-align: center;">
<li style="margin-left: 40px">
<span class="c_red f12"></span>&nbsp;原邮箱&nbsp;&nbsp;:&nbsp;
<span style="width: 200px"><%= user.mail %></span>
</li>
<div class="c1"></div>
<li style="margin-left: 40px">
<span class="c_red f12"></span>&nbsp;新邮箱&nbsp;&nbsp;:&nbsp;
<input type="text" style="width:200px" id="user_mail" name="user[mail]" placeholder="请输入邮箱地址">
<p class="new_login_error fl" id="mail_req" style="display: none;margin-left: 68px;">请输入正确的邮箱</p>
</li>
</li>
<div class="clear"></div>
<li class="mt10">
<label class="mr27">&nbsp;</label>
<a href="javascript:void(0);" class="sy_btn_grey fl" onclick="hideModal()">取&nbsp;&nbsp;消</a>
<a href="javascript:void(0);" class="sy_btn_blue fl ml20" onclick="submit_user_emails()">确&nbsp;&nbsp;定</a>
<div class="cl"></div>
</li>
</ul>
</div>
</div>
<script type="text/javascript">
var $mail_correct = false;
var $mail = $('#user_mail');
$mail.blur(function (event) {
if (/^[a-zA-Z0-9]+([._\\]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/.test(this.value) == false){
$('#mail_req').html( '<span style="color: #c00202">邮件格式不对</span>').show();
$mail_correct = false;
return ;
}
if ($(this).is('#user_mail')) {
$.get('<%= account_valid_ajax_path %>',
{ valid: "mail",
value: this.value },
function (data) {
if (data.valid) {
$('#mail_req').html( '<span style="color: green">'+data.message+'</span>' );
$mail_correct = true;
} else {
$('#mail_req').html( '<span style="color: #c00202">'+data.message+'</span>' );
$mail_correct = false;
}
$('#mail_req').css('display','block');
});
}
});
function submit_user_emails(){
if($mail_correct == false){
return
}else{
$.get('<%= account_change_email_path(:user_id => @user.id) %>',
{ valid: "mail",
value: document.getElementById("user_mail").value },
function (data){
$("#user_email_show").html(data.email);
hideModal();
return;
});
}
}
</script>

View File

@ -1,15 +1,17 @@
<div class="new_content">
<div class="email_verify">
<p class="email_verify_prompt"><span class="icons_email_prompt"></span>您的账号尚未激活,请先进入您的注册邮箱,激活您的账号。</p>
<p class="email_verify_prompt"><span class="icons_email_prompt"></span>您的账号尚未激活,请先进入您的注册邮箱<span class="c_red" id="user_email_show"><%= @user.mail %></span>,激活您的账号。</p>
<button class="email_verify_btn mt30 ml30" onclick = "resendMail('<%= resendmail_path(@user) %>','<%= @user.id %>');">重新发送激活邮件</button>
<%#= link_to l(:label_mail_resend), { :controller => 'account', :action => 'resendmail',:user => @user}, :class=>"email_verify_btn mt30 ml30", :remote => true, :method => 'get' %>
<ul class="email_prompt_txt ml30 mt30">
<ul class="email_prompt_txt ml30 mt30" style="width:580px">
<p class="email_prompt_p">如果您尚未收到激活邮件,请按照以下步骤操作:</p>
<li>检查邮箱的“订阅邮件”、“垃圾邮件”,可能会发现激活邮件。 </li>
<li>如果激活邮件已无效,请点击重新发送激活邮件按钮。</li>
<li>如果您无法收到激活邮件,请您直接给我们管理员留言:</li>
<div class=" mt10">
<textarea style="resize: none;" class="email_prompt_mes" placeholder="请管理员尽快帮我解决邮箱激活问题"></textarea>
<li>如果重发注册验证邮箱邮件仍然没有收到,请<a href="javascript:void(0);" class="link-blue" onclick="change_user_email()">更换邮箱地址</a>,重新发送激活邮件</li>
<li>如果您始终无法收到激活邮件,请直接给我们留言:</li>
<div class="mt10">
<textarea style="resize: none;width: 570px;" class="email_prompt_mes" placeholder="请管理员尽快帮我解决邮箱激活问题"></textarea>
<div class="c1"></div>
<button class="email_sub_btn fr" onclick="leave_email_activation_message('<%= leave_email_activation_message_path(1)%>','<%= @user.id %>');">确定</button>
<div class="cl"></div>
</div>
@ -17,6 +19,10 @@
</div>
</div>
<script type="text/javascript">
function change_user_email(){
var htmlvalue = "<%= j (render :partial => 'account/change_user_email', :locals => {:user => @user}) %>";
pop_box_new(htmlvalue,520,316);
}
function resendMail(url,id)
{
$.get(

View File

@ -5,7 +5,7 @@
<div class="email_verify" style="width: 580px;">
<p class="fb f18" style="color:green;"><i class="icon-ok mr5 f18"></i>注册成功!
<span style=" color:#3b94d6; font-size:12px; font-weight:normal;">请在24小时内点击邮件中的链接来激活您的账号。</span></p>
<p class="f14 mt30 mb5">请登录邮箱(<span class="c_red"><%= @user.mail %></span>)收取账号激活邮件。<br/>点击邮件中的激活链接,方可使用该账号
<p class="f14 mt30 mb5">请登录邮箱(<span class="c_red" id="user_email_show"><%= @user.mail %></span>)收取账号激活邮件。<br/>点击邮件中的激活链接,方可使用该账号
</p>
<p>
<a href="http://mail.<%= email %>" class="btn btn-blue" target="_blank"><%= l(:label_check_email)%></a>
@ -14,14 +14,15 @@
<ul class="email_prompt_txt mt30" style="width: 580px;">
<p class="email_prompt_p">如果您一直收不到激活邮件,请按照以下步骤操作:</p>
<li>1.请确认是否填写了正确的邮箱地址 </li>
<li>2.请注意查看邮箱中的“订阅邮件”、“垃圾邮件”可能Trustie的邮件被误杀了</li>
<li>3.请点击重新发送激活邮件按钮</li>
<li>4.如果您无法收到激活邮件,请直接给我们留言:</li>
<li>请确认是否填写了正确的邮箱地址 </li>
<li>请注意查看邮箱中的“订阅邮件”、“垃圾邮件”可能Trustie的邮件被误杀了</li>
<li>请点击重新发送激活邮件按钮</li>
<li>如果重发注册验证邮箱邮件仍然没有收到,请<a href="javascript:void(0);" class="link-blue" onclick="change_user_email()">更换邮箱地址</a>,重新发送激活邮件</li>
<li>如果您始终无法收到激活邮件,请直接给我们留言:</li>
<div class="mt10 clearfix">
<% get_memo %>
<%= form_for(@new_memo, :url => mail_feedback_forum_path(@public_forum, :user_id => @user.id), :remote => true) do |f| %>
<%= f.text_area :subject, :id => "subject", :class => "email_prompt_mes", :style => "width: 568px;", :placeholder => l(:label_feedback_tips) %>
<%= f.text_area :subject, :id => "subject", :class => "email_prompt_mes", :style => "width: 568px;", :placeholder => l(:label_email_feedback_tips) %>
<%= f.hidden_field :content, :id => 'hidden', :required => true , :value => l(:label_feedback_value) %>
<span class="c_red fl" id="mail_valid_feedback_tip" style="display: none;">内容不能为空</span>
<a href="javascript:void(0);" class="btn btn-blue fr" onclick="f_submit();">确定</a>
@ -33,6 +34,11 @@
</div>
<script>
function change_user_email(){
var htmlvalue = "<%= j (render :partial => 'account/change_user_email', :locals => {:user => @user}) %>";
pop_box_new(htmlvalue,520,316);
}
function regex_mv_name()
{
var name = $.trim($("#subject").val());
@ -51,7 +57,6 @@
function f_submit()
{
if(regex_mv_name()){
alert("222");
$("#new_memo").submit();
}
}

View File

@ -367,6 +367,7 @@ zh:
label_technical_support: "QQ 在线支持:"
label_feedback_success: "您的意见已经反馈到公共贴吧的新手讨论吧,我们会第一时间解决您的问题,谢谢支持!"
label_feedback_value: "该帖来自用户反馈:)"
label_email_feedback_tips: "请留下您的联系方式(注册邮箱除外),否则我们无法及时联系到您。请管理员尽快帮我解决邮箱激活问题"

View File

@ -519,6 +519,7 @@ RedmineApp::Application.routes.draw do
match 'account/lost_password', :via => [:get, :post], :as => 'lost_password'
match 'account/activate', :via => :get
match 'account/valid_ajax', :via => :get
match 'account/change_email', :via => :get
match 'account/email_valid', :to => 'account#email_valid', :via => :get
match 'account/resendmail', :to => 'account#resendmail', :via=> :get, :as => 'resendmail'
match 'projects/:id/wiki', :to => 'wikis#edit', :via => :post

View File

@ -425,3 +425,16 @@ a.export_icon:hover {background: url(/images/item.png) -58px -60px no-repeat;}
.homework-user-leftnav-li:hover{ height: 25px; line-height: 40px; padding-left: 25px; background:#f4f4f4; background:url(/images/user/home-user-left.png) 0px -186px no-repeat; font-size: 14px; position: relative; }
.separator_short{margin-top: 5px; margin-bottom: 5px; margin-left: 37px; width: 433px; display: block; border-bottom: 1px solid #d9d9d9;}
.separator_long{margin-top: 5px; margin-bottom: 5px; margin-left: 37px; width: 522px; display: block; border-bottom: 1px solid #d9d9d9;}
/* 模板弹框 20161013byLB */
#muban_popup_box{ background:#fff;padding-bottom:15px;-webkit-border-radius:5px;-moz-border-radius:5px;-o-border-radius:5px;border-radius:5px;box-shadow: 0px 2px 8px rgba(146, 153, 169, 0.5);}
.muban_popup_top{background:#3b94d6;height:40px;-webkit-border-radius: 5px 5px 0px 0px;-moz-border-radius: 5px 5px 0px 0px;-o-border-radius: 5px 5px 0px 0px;border-radius: 5px 5px 0px 0px;}
.muban_popup_top h3{ font-size:16px; color:#fff; font-weight:normal; line-height:40px; padding-left:10px; }
a.muban_icons_close{width:20px; height:20px;display:block;background: url(/images/sy/sy_icons_close.png) 0 0px no-repeat; margin:8px 10px 0 0;}
a:hover.muban_icons_close{background: url(/images/sy/sy_icons_close.png) -40px 0px no-repeat;}
#muban_popup_box input,#muban_popup_box select{ border:1px solid #c8c8c8; height: 28px; color: #888;}
#muban_popup_box label.pop_box_label{width: 100px; text-align: right; display: inline-block;}
input.radio-width90{ width: 90px; }
#muban_popup_box label.pop_box_label_l {width: 100px; text-align: left; display: inline-block;}
.sy_popup_con{ margin:30px auto 0;font-size:14px; width:330px;}
.sy_popup_add li{ line-height:40px;}
.sy_popup_add label{ display:block; float:left; width:85px; text-align:right; line-height:40px;}