修改《测试版--注册时返回500错误》以及项目邀请时邮箱验证功能

Signed-off-by: alan <547533434@qq.com>
This commit is contained in:
alan 2015-03-07 16:07:48 +08:00
parent 6cf7e156d1
commit 48ac3dbea8
6 changed files with 18 additions and 2 deletions

View File

@ -125,7 +125,7 @@ class AccountController < ApplicationController
#register_by_email_activation(@user)
unless @user.new_record?
flash[:notice] = l(:notice_account_register_done)
render action: 'email_valid', locals: {:mail => user.mail}
render action: 'email_valid', locals: {:mail => @user.mail}
end
when '3'
#register_automatically(@user)

View File

@ -333,13 +333,21 @@ class ProjectsController < ApplicationController
end
def send_mail_to_member
unless params[:mail].nil?
if !params[:mail].nil? && User.find_by_mail(params[:mail].to_s).nil?
email = params[:mail]
Mailer.send_invite_in_project(email, @project, User.current).deliver
@is_zhuce =false
else
@is_zhuce = true
end
respond_to do |format|
format.js
end
end
#发送邮件邀请新用户
def invite_members_by_mail
@is_zhuce =false
respond_to do |format|
format.html
format.js

View File

@ -4,6 +4,9 @@
<div class="box_main">
<h3 class="box_h3">发送邮件邀请新用户</h3>
<p class="box_p">输入好友邮箱地址Trustie帮您免费发送</p>
<div id="is_registed">
<%= render :partial => 'regested', locals: { :isregisted => false} %>
</div>
<%= form_tag('send_mail_to_member', :controller => 'projects',:action => 'send_mail_to_member', method: 'get',:remote=>true) do %>
<ul>
<li >

View File

@ -0,0 +1,3 @@
<% if isregisted %>
<p style="color: #ff0000"><%= l(:notice_registed_success) %></p>
<% end %>

View File

@ -0,0 +1 @@
$("#is_registed").html("<%= escape_javascript( render :partial => 'regested', locals: {:isregisted => @is_zhuce})%>")

View File

@ -181,6 +181,7 @@ zh:
notice_successful_create: 创建成功
notice_successful_update: 更新成功
notice_successful_delete: 删除成功
notice_registed_success: 该邮箱已被注册,请直接邀请注册用户
notice_failed_delete: 删除失败
notice_successful_connection: 连接成功
notice_successful_join: 加入成功