2015-03-25 17:28:22 +08:00
|
|
|
<script type="text/javascript" src="/javascripts/jQuery.autoMail.js"></script>
|
|
|
|
<script type="text/javascript">
|
|
|
|
$(document).ready(function(){
|
|
|
|
$("#mail").mailAutoComplete({
|
|
|
|
boxClass: "out_box", //外部box样式
|
|
|
|
listClass: "list_box", //默认的列表样式
|
|
|
|
focusClass: "focus_box", //列表选样式中
|
|
|
|
markCalss: "mark_box", //高亮样式
|
|
|
|
autoClass: false,
|
|
|
|
textHint: true //提示文字自动隐藏
|
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
<style type="text/css">
|
|
|
|
.out_box{border:1px solid #ccc; background:#fff; font:12px/20px Tahoma;}
|
|
|
|
.list_box{border-bottom:1px solid #eee; padding:0 5px; cursor:pointer;}
|
|
|
|
.focus_box{background:#83DAF6;}
|
|
|
|
.mark_box{color:#FF7143;}
|
|
|
|
</style>
|
2015-03-12 15:13:41 +08:00
|
|
|
<script>
|
2015-03-12 18:04:12 +08:00
|
|
|
function verifyAddress() {
|
2015-03-13 15:46:00 +08:00
|
|
|
var email = $.trim($('#mail').val());
|
2015-03-12 17:48:31 +08:00
|
|
|
var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
|
2015-03-13 15:46:00 +08:00
|
|
|
if(email == "")
|
|
|
|
{
|
2015-03-26 10:47:03 +08:00
|
|
|
$("#valid_email").text("<%= l(:label_input_email_blank)%>");
|
2015-09-07 15:23:34 +08:00
|
|
|
return false;
|
2015-03-13 15:46:00 +08:00
|
|
|
}
|
2015-09-07 15:23:34 +08:00
|
|
|
else if(!filter.test(email))
|
|
|
|
{
|
|
|
|
$("#valid_email").text("<%= l(:label_email_format_error)%>");
|
|
|
|
return false;
|
|
|
|
}
|
2015-09-17 15:24:12 +08:00
|
|
|
else if(email.length > 25)
|
2015-09-07 15:23:34 +08:00
|
|
|
{
|
2015-09-17 15:24:12 +08:00
|
|
|
$("#valid_email").text("邮箱名过长,最长为25个字符");
|
2015-09-07 15:23:34 +08:00
|
|
|
return false;
|
2015-03-12 18:04:12 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-09-07 15:23:34 +08:00
|
|
|
$("#valid_email").text("");
|
|
|
|
return true;
|
2015-03-12 17:48:31 +08:00
|
|
|
}
|
2015-09-07 15:23:34 +08:00
|
|
|
|
2015-03-13 15:46:00 +08:00
|
|
|
}
|
|
|
|
|
2015-10-09 11:25:21 +08:00
|
|
|
function verifyLastName() {
|
|
|
|
var last_name = $.trim($('#last_name').val());
|
|
|
|
if(last_name.length > 30)
|
2015-10-09 10:33:10 +08:00
|
|
|
{
|
2015-10-09 11:25:21 +08:00
|
|
|
$("#valid_email").text("用户姓氏过长,最长为30个字符");
|
2015-10-09 10:33:10 +08:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
$("#valid_email").text("");
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2015-10-09 11:25:21 +08:00
|
|
|
function verifyFirstName() {
|
|
|
|
var first_name = $.trim($('#first_name').val());
|
|
|
|
if(first_name.length > 30)
|
2015-10-09 10:33:10 +08:00
|
|
|
{
|
2015-10-09 11:25:21 +08:00
|
|
|
$("#valid_email").text("用户名字过长,最长为30个字符");
|
2015-10-09 10:33:10 +08:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
$("#valid_email").text("");
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2015-03-13 15:46:00 +08:00
|
|
|
function senderEmail(obj)
|
|
|
|
{
|
2015-10-09 11:25:21 +08:00
|
|
|
if(verifyAddress() && verifyFirstName() && verifyLastName() )
|
2015-03-13 15:46:00 +08:00
|
|
|
{
|
|
|
|
obj.parent().submit();
|
|
|
|
}
|
2015-03-12 18:04:12 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-06-04 10:34:39 +08:00
|
|
|
// if (filter.test(email)&& !(email.value == null)) return true;
|
|
|
|
// else
|
|
|
|
// {
|
|
|
|
// document.getElementById('valid_email').innerHTML = "您所填写的电子邮件格式不正确";
|
|
|
|
// document.getElementById('valid_email').style.color = "#FF0000";
|
|
|
|
// return false;
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// }
|
2015-03-12 15:13:41 +08:00
|
|
|
</script>
|
2015-03-09 11:31:42 +08:00
|
|
|
<div class="project_r_h">
|
2015-03-13 09:46:05 +08:00
|
|
|
<h2 class="project_h2"><%= l(:label_invite_join)%></h2>
|
2015-03-09 11:31:42 +08:00
|
|
|
</div>
|
2015-04-09 10:25:46 +08:00
|
|
|
<div class="box_main">
|
2015-06-04 10:34:39 +08:00
|
|
|
<p class="box_p">
|
|
|
|
<%= l(:label_invite_email_tips)%>
|
|
|
|
</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') do %>
|
|
|
|
<span id="valid_email" style="color: #FF0000;"></span>
|
|
|
|
<ul>
|
|
|
|
<li>
|
|
|
|
<%= text_field_tag 'mail', '', :class => "fb_item fl", :placeholder => l(:label_input_email), :onkeyup => "this.value=this.value.replace(' ','')", :style => "ime-mode:disabled;", :onblur => "verifyAddress(this);" %>
|
|
|
|
</li>
|
2015-10-09 10:33:10 +08:00
|
|
|
<li>
|
2015-10-09 11:25:21 +08:00
|
|
|
<%= text_field_tag 'last_name', '', :class => "fb_item_first_name fl", :placeholder => l(:label_input_email_lastname), :onkeyup => "this.value=this.value.replace(' ','')", :style => "ime-mode:disabled;", :onblur => "verifyLastName(this);" %>
|
2015-10-09 10:33:10 +08:00
|
|
|
</li>
|
|
|
|
<li>
|
2015-10-09 11:25:21 +08:00
|
|
|
<%= text_field_tag 'first_name', '', :class => "fb_item_last_name fl", :placeholder => l(:label_input_email_firstname), :onkeyup => "this.value=this.value.replace(' ','')", :style => "ime-mode:disabled;", :onblur => "verifyFirstName(this);" %>
|
2015-10-09 10:33:10 +08:00
|
|
|
</li>
|
|
|
|
<li>
|
2015-10-09 11:25:21 +08:00
|
|
|
<select class="fb_item_gender fl" id="gender" name="gender"><option value="">性别</option><option value="0">男</option><option value="1">女</option></select>
|
2015-10-09 10:33:10 +08:00
|
|
|
</li>
|
2015-06-04 10:34:39 +08:00
|
|
|
</ul>
|
|
|
|
<div class="cl"></div>
|
|
|
|
<a href="#" class="btn_free" onclick="senderEmail($(this));">
|
|
|
|
<%= l(:label_send_email)%>
|
|
|
|
</a>
|
|
|
|
<% end %>
|
2015-09-16 17:25:06 +08:00
|
|
|
|
2015-06-04 10:34:39 +08:00
|
|
|
<%# 邀请用户的状态 %>
|
2015-09-16 17:25:06 +08:00
|
|
|
<% unless @inviter_lists.blank? %>
|
|
|
|
<div class="section">
|
|
|
|
<div class="section-header">
|
2015-09-18 15:57:29 +08:00
|
|
|
<div class="desc">项目成员邀请状态列表</div>
|
2015-09-16 17:25:06 +08:00
|
|
|
</div>
|
|
|
|
<div class="invitations-records">
|
|
|
|
<% @inviter_lists.each do |inviter_list| %>
|
|
|
|
<table>
|
|
|
|
<tbody>
|
2015-09-17 14:37:45 +08:00
|
|
|
<% if inviter_list.user != nil %>
|
2015-09-16 17:25:06 +08:00
|
|
|
<tr>
|
|
|
|
<td class="email"><%= inviter_list.user.mail %></td>
|
|
|
|
<td class="text-name">
|
|
|
|
<% if inviter_list.user.active? %>
|
|
|
|
<%=link_to inviter_list.user.name, user_path(inviter_list.user), :class => "c_eblue" %>
|
|
|
|
<% else %>
|
|
|
|
<span class="unactive"><%= inviter_list.user.name %></span>
|
|
|
|
<% end %>
|
|
|
|
</td>
|
|
|
|
<td class="text-status"><%= status_for_ivitied(inviter_list, @project) %></td>
|
|
|
|
<!--<td class="text-time"><%#= time_tag(inviter_list.created_at).html_safe %></td>-->
|
|
|
|
</tr>
|
2015-09-17 14:37:45 +08:00
|
|
|
<% end %>
|
2015-09-16 17:25:06 +08:00
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
|
2015-06-04 10:34:39 +08:00
|
|
|
<% unless @inviter_lists.blank? %>
|
2015-06-05 14:24:50 +08:00
|
|
|
<div>
|
2015-06-06 11:39:22 +08:00
|
|
|
<% unless @inviters_count.nil? %>
|
|
|
|
<span class="status_inviter">已加入项目的用户</span><br/>
|
|
|
|
<% @inviters.each do |inv| %>
|
|
|
|
<%= inv.name unless inv.nil? %><br/>
|
2015-06-04 10:34:39 +08:00
|
|
|
<% end %>
|
2015-06-05 14:24:50 +08:00
|
|
|
<% end %>
|
|
|
|
</br>
|
2015-06-05 14:51:36 +08:00
|
|
|
<% unless @waiters_count.nil? %>
|
2015-06-04 10:34:39 +08:00
|
|
|
<span class="status_inviter">等待加入项目的用户</span><br/>
|
2015-06-06 11:39:22 +08:00
|
|
|
<% @waiters.each do |wai| %>
|
|
|
|
<%= wai.name unless wai.nil?%><br/>
|
2015-06-04 10:34:39 +08:00
|
|
|
<% end %>
|
2015-06-05 14:24:50 +08:00
|
|
|
<% end %>
|
|
|
|
</div>
|
2015-06-04 10:34:39 +08:00
|
|
|
<% end %>
|
|
|
|
</div>
|
2015-04-17 10:58:40 +08:00
|
|
|
|
2015-04-09 10:25:46 +08:00
|
|
|
|
2015-06-03 18:11:52 +08:00
|
|
|
|