diff --git a/app/views/projects/invite_members_by_mail.html.erb b/app/views/projects/invite_members_by_mail.html.erb index 4c6ee47d8..8c951a485 100644 --- a/app/views/projects/invite_members_by_mail.html.erb +++ b/app/views/projects/invite_members_by_mail.html.erb @@ -24,16 +24,24 @@ if(email == "") { $("#valid_email").text("<%= l(:label_input_email_blank)%>"); + return false; } - else if (filter.test(email)) { - $("#valid_email").html(""); - return true; + else if(!filter.test(email)) + { + $("#valid_email").text("<%= l(:label_email_format_error)%>"); + return false; + } + else if(email.split('@')[0].length >= 20) + { + $("#valid_email").text("邮箱名过长,最长为20个字符"); + return false; } else { - $("#valid_email").text("<%= l(:label_email_format_error)%>"); + $("#valid_email").text(""); + return true; } - return false; + } function senderEmail(obj) diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css index 4cc859721..2288c4994 100644 --- a/public/stylesheets/public.css +++ b/public/stylesheets/public.css @@ -418,6 +418,8 @@ div.flash.notice { background-color: #dfffdf; border-color: #9fcf9f; color: #005f00; + word-wrap: break-word; + word-break: break-all } div.flash.warning, .conflict {