This commit is contained in:
z9hang 2015-03-20 16:49:24 +08:00
commit 80c35dcd96
2 changed files with 74 additions and 69 deletions

View File

@ -1,68 +1,68 @@
<script> <script>
function verifyAddress() { function verifyAddress() {
var email = $.trim($('#mail').val()); var email = $.trim($('#mail').val());
var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/; var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
if(email == "") if(email == "")
{ {
$("#valid_email").html("电子邮件不能为空"); $("#valid_email").html("电子邮件不能为空");
} }
else if (filter.test(email)) { else if (filter.test(email)) {
$("#valid_email").html(""); $("#valid_email").html("");
return true; return true;
} }
else else
{ {
$("#valid_email").html("您所填写的电子邮件格式不正确"); $("#valid_email").html("您所填写的邮件格式不正确");
} }
return false; return false;
} }
function senderEmail(obj) function senderEmail(obj)
{ {
if(verifyAddress()) if(verifyAddress())
{ {
obj.parent().submit(); obj.parent().submit();
} }
} }
// if (filter.test(email)&& !(email.value == null)) return true; // if (filter.test(email)&& !(email.value == null)) return true;
// else // else
// { // {
// document.getElementById('valid_email').innerHTML = "您所填写的电子邮件格式不正确"; // document.getElementById('valid_email').innerHTML = "您所填写的电子邮件格式不正确";
// document.getElementById('valid_email').style.color = "#FF0000"; // document.getElementById('valid_email').style.color = "#FF0000";
// return false; // return false;
// } // }
// //
// } // }
</script> </script>
<div class="project_r_h"> <div class="project_r_h">
<h2 class="project_h2"><%= l(:label_invite_join)%></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 >
<a href="#" class="box_close"></a> <a href="#" class="box_close"></a>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<div class="box_main"> <div class="box_main">
<div style="padding-left: 20px;"> <div style="padding-left: 20px;">
<h3 class="box_h3"><%= l(:label_invite_new_user)%></h3> <h3 class="box_h3"><%= l(:label_invite_new_user)%></h3>
<p class="box_p"> <p class="box_p">
<%= l(:label_invite_email_tips)%> <%= 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') do %> <%= form_tag('send_mail_to_member', :controller => 'projects',:action => 'send_mail_to_member', method: 'get') do %>
<span id="valid_email" style="color: #FF0000;"></span> <span id="valid_email" style="color: #FF0000;"></span>
<%= text_field_tag 'mail', '', :class => "fb_item fl", :placeholder => l(:label_input_email), :onkeyup => "verifyAddress();" %> <%= text_field_tag 'mail', '', :class => "fb_item fl", :placeholder => l(:label_input_email), :onkeyup => "verifyAddress();" %>
<div class="cl"></div> <div class="cl"></div>
<div class="cl"></div> <div class="cl"></div>
<a href="#" class="btn_free" onclick="senderEmail($(this));"> <a href="#" class="btn_free" onclick="senderEmail($(this));">
<%= l(:label_send_email)%> <%= l(:label_send_email)%>
</a> </a>
<%#= submit_tag '免费发送', :style => "display:block; width:80px; text-align:center; color:#fff; height:26px; padding-top:3px; margin-bottom:10px;" %> <%#= submit_tag '免费发送', :style => "display:block; width:80px; text-align:center; color:#fff; height:26px; padding-top:3px; margin-bottom:10px;" %>
<% end %> <% end %>
</div> </div>
</div> </div>
</div> </div>

View File

@ -34,7 +34,12 @@
<!--项目暂时单独出来,后面重构--> <!--项目暂时单独出来,后面重构-->
<% if object_flag == '2' %> <% if object_flag == '2' %>
<span class="re_tag f_l"> <span class="re_tag f_l">
<%= link_to tag, :controller => "tags", :action => "index", :q => tag, :object_flag => object_flag, :obj_id => obj.id %></span> <%= link_to tag, :controller => "tags", :action => "index", :q => tag, :object_flag => object_flag, :obj_id => obj.id %>
<% if (ProjectInfo.find_by_project_id(obj.id)).try(:user_id) == User.current.id %>
<%= link_to 'x', :controller => "tags", :action => "remove_tag", :remote => true, :tag_name => tag,
:taggable_id => obj.id, :taggable_type => object_flag %>
<% end %>
</span>
<% else %> <% else %>
<div id="tag"> <div id="tag">
<span class="tag_show"> <span class="tag_show">
@ -47,7 +52,7 @@
<%= link_to 'x', :controller => "tags", :action => "remove_tag", :remote => true, :tag_name => tag, <%= link_to 'x', :controller => "tags", :action => "remove_tag", :remote => true, :tag_name => tag,
:taggable_id => obj.id, :taggable_type => object_flag %> :taggable_id => obj.id, :taggable_type => object_flag %>
</span> </span>
<% end %> <% end %>
<% when '3' %> <% when '3' %>
<% if (ProjectInfo.find_by_project_id(obj.project_id)).try(:user_id) == User.current.id %> <% if (ProjectInfo.find_by_project_id(obj.project_id)).try(:user_id) == User.current.id %>
<span class='del'> <span class='del'>