This commit is contained in:
z9hang 2015-03-07 16:20:28 +08:00
commit 610746301f
6 changed files with 27 additions and 8 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

@ -1,16 +1,22 @@
<div class="project_r_h">
<h2 class="project_h2">邀请加入</h2>
</div>
<div class="floatbox" style="margin:120px;">
<div class="floatbox" style="margin:100px;">
<div ><a href="#" class="box_close"></a></div>
<div class="cl"></div>
<div class="box_main">
<h3 class="box_h3">发送邮件邀请新用户</h3>
<p class="box_p">输入好友邮箱地址Trustie帮您免费发送</p>
<p style="padding-lef:20px;"><%= form_tag('send_mail_to_member', :controller => 'projects',:action => 'send_mail_to_member', method: 'get',:remote=>true) do %></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 >
<%= text_field_tag 'mail', '邮箱', :class => "fb_item fl" %>
</li>
<div class="cl"></div>
<%= submit_tag '免费发送', :style=> "display:block; width:80px; text-align:center; color:#fff; height:26px; padding-top:3px; margin-bottom:10px;" %>
<div class="cl"></div>
</ul>
<%= submit_tag '免费发送', :class=> "btn_free" %>
<% end %>
</div>

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: 加入成功