项目邀请用户国际化,js判断邮件格式

memcached_alan
whimlex 11 years ago
parent e952490fa0
commit 5f88ffc5d0

@ -1,14 +1,16 @@
<script> <script>
function ismail(mail) { function verifyAddress(obj) {
var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/; var email = document.getElementsByName('mail');
if (filter.test(mail)) return true; var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
else { if (email.value==null||filter.test(email.value)) return true;
alert('您的电子邮件格式不正确'); else {
return false;} document.getElementById('valid_email').innerHTML= <%= l(:label_email_format_error)%>;
} document.getElementById('valid_email').style.color="#FF0000";
return false;}
}
</script> </script>
<div class="project_r_h"> <div class="project_r_h">
<h2 class="project_h2">邀请加入</h2> <h2 class="project_h2"><%= l(:label_invite_join)%></h2>
</div> </div>
<div class="floatbox" style="margin:130px;"> <div class="floatbox" style="margin:130px;">
<div > <div >
@ -16,18 +18,18 @@
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<div class="box_main"> <div class="box_main">
<h3 class="box_h3">发送邮件邀请新用户</h3> <h3 class="box_h3"><%= l(:label_invite_new_user)%></h3>
<p class="box_p"> <p class="box_p">
输入好友邮箱地址Trustie会自动为该邮箱注册用户 <%= l(:label_invite_email_tips)%>
</p> </p>
<div id="is_registed"> <div id="is_registed">
<%= render :partial => 'regested', locals: { :isregisted => false} %> <%= render :partial => 'regested', locals: { :isregisted => false} %>
</div> </div>
<%= form_tag('send_mail_to_member', :controller => 'projects',:action => 'send_mail_to_member', method: 'get',:remote=>true) do %> <%= form_tag('send_mail_to_member', :controller => 'projects',:action => 'send_mail_to_member', method: 'get',:remote=>true) do %>
<%= text_field_tag 'mail', '邮箱', :class => "fb_item fl" %> <p><span id="valid_email"></span></span><%= text_field_tag 'mail', l(:label_email), :class => "fb_item fl" %></p>
<div class="cl"></div> <div class="cl"></div>
<div class="cl"></div> <div class="cl"></div>
<%= submit_tag '免费发送', :style => "display:block; width:80px; text-align:center; color:#fff; height:26px; padding-top:3px; margin-bottom:10px;" %> <%= submit_tag l(:label_send_email_free), :onclick => "verifyAddress(this);" , :style => "display:block; width:80px; text-align:center; color:#fff; height:26px; padding-top:3px; margin-bottom:10px;" %>
<% end %> <% end %>
</div> </div>
</div> </div>

@ -77,6 +77,13 @@ en:
label_repository_plural: Repositories label_repository_plural: Repositories
enumeration_activities: Activities enumeration_activities: Activities
#
# 项目托管平台
#
# 邀请
#
notice_registed_success: 您输入的邮箱为空或者该邮箱已被注册!
# #
# 项目托管平台 # 项目托管平台
@ -88,7 +95,7 @@ en:
field_description: Description field_description: Description
field_identifier: Identifier field_identifier: Identifier
field_enterprise_name: Enterprise field_enterprise_name: Enterprise
label_organization_choose: "- Please select an organization -"
text_length_between: "Length between %{min} and %{max} characters." text_length_between: "Length between %{min} and %{max} characters."
text_project_identifier_info: "Only lower case letters (a-z), numbers, dashes and underscores are allowed, must start with a lower case letter.<br />Once saved, the identifier cannot be changed." text_project_identifier_info: "Only lower case letters (a-z), numbers, dashes and underscores are allowed, must start with a lower case letter.<br />Once saved, the identifier cannot be changed."

@ -43,9 +43,7 @@ zh:
project_module_attachments: 资源 project_module_attachments: 资源
label_invite: 邀请 label_invite: 邀请
label_invite_new_user: "发送邮件邀请新用户"
label_invite_trustie_user: "邀请Trustie注册用户"
label_issue_tracking: 问题跟踪 label_issue_tracking: 问题跟踪
label_release_issue: 发布问题 label_release_issue: 发布问题
@ -79,6 +77,18 @@ zh:
label_repository_plural: 版本库 label_repository_plural: 版本库
enumeration_activities: 活动(时间跟踪) enumeration_activities: 活动(时间跟踪)
#
# 项目托管平台
#
# 邀请
#
label_invite_new_user: "发送邮件邀请新用户"
label_invite_trustie_user: "邀请Trustie注册用户"
label_invite_join: 邀请加入
label_invite_email_tips: 输入好友邮箱地址Trustie会自动为该邮箱注册用户
notice_registed_success: 您输入的邮箱为空或者该邮箱已被注册!
# #
# 项目托管平台 # 项目托管平台
@ -90,10 +100,9 @@ zh:
field_description: 描述 field_description: 描述
field_identifier: 标识 field_identifier: 标识
field_enterprise_name: 组织名称 field_enterprise_name: 组织名称
label_organization_choose: --请选择组织--
text_length_between: "长度必须在 %{min} 到 %{max} 个字符之间。" text_length_between: "长度必须在 %{min} 到 %{max} 个字符之间。"
text_project_identifier_info: "小写字母a-z、数字、破折号-和下划线_可以使用。<br />一旦保存,标识无法修改。" text_project_identifier_info: "小写字母a-z、数字、破折号-和下划线_可以使用。<br />一旦保存,标识无法修改。"
field_is_public: 公开 field_is_public: 公开
field_hidden_repo: 隐藏代码库 field_hidden_repo: 隐藏代码库
button_create: 提交 button_create: 提交

Loading…
Cancel
Save