parent
b43acd3a46
commit
c9d52571f0
|
@ -383,16 +383,26 @@ class ProjectsController < ApplicationController
|
|||
@is_zhuce = false
|
||||
flash[:notice] = l(:notice_email_sent, :value => email)
|
||||
end
|
||||
|
||||
# 邮箱地址已被注册
|
||||
elsif !User.find_by_mail(params[:mail].to_s).nil?
|
||||
user = User.find_by_mail(params[:mail].to_s)
|
||||
if !user.member_of?(@project)
|
||||
# 如果已经邀请过该用户,则不重复发送
|
||||
if InviteList.where("project_id =? and mail =?", @project.id, params[:mail].to_s).first.nil?
|
||||
invite_list = InviteList.where("project_id =? and mail =?", @project.id, params[:mail].to_s).first
|
||||
if invite_list.nil?
|
||||
email = params[:mail]
|
||||
Mailer.request_member_to_project(email, @project, User.current).deliver
|
||||
flash[:notice] = l(:notice_email_sent, :value => email)
|
||||
else
|
||||
flash[:error] = l(:notice_email_invited)
|
||||
# 已经发送过了,则隔24小时才能再次发送
|
||||
if Time.now - invite_list.created_at > 10800
|
||||
email = params[:mail]
|
||||
Mailer.request_member_to_project(email, @project, User.current).deliver
|
||||
flash[:notice] = l(:notice_email_sent, :value => email)
|
||||
else
|
||||
flash[:error] = l(:notice_email_invited)
|
||||
end
|
||||
end
|
||||
else
|
||||
flash[:error] = l(:label_member_of_project, :value => email)
|
||||
|
@ -409,22 +419,22 @@ class ProjectsController < ApplicationController
|
|||
# 发送邮件邀请新用户页面对应方法
|
||||
def invite_members_by_mail
|
||||
if User.current.member_of?(@project) || User.current.admin?
|
||||
@inviter_lists = InviteList.where(project_id:@project.id).all
|
||||
@inviters = []
|
||||
@waiters = []
|
||||
unless @inviter_lists.blank?
|
||||
@inviter_lists.each do|inviter_list|
|
||||
unless inviter_list.user.nil?
|
||||
if inviter_list.user.member_of?(@project)
|
||||
@inviters << inviter_list.user
|
||||
@inviters_count = @inviters.size
|
||||
else
|
||||
@waiters << inviter_list.user
|
||||
@waiters_count = @waiters.size
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@inviter_lists = InviteList.where(project_id:@project.id)
|
||||
# @inviters = []
|
||||
# @waiters = []
|
||||
# unless @inviter_lists.blank?
|
||||
# @inviter_lists.each do|inviter_list|
|
||||
# unless inviter_list.user.nil?
|
||||
# if inviter_list.user.member_of?(@project)
|
||||
# @inviters << inviter_list.user
|
||||
# @inviters_count = @inviters.size
|
||||
# else
|
||||
# @waiters << inviter_list.user
|
||||
# @waiters_count = @waiters.size
|
||||
# end
|
||||
# end
|
||||
# end
|
||||
# end
|
||||
@is_zhuce = false
|
||||
respond_to do |format|
|
||||
format.html
|
||||
|
|
|
@ -75,6 +75,17 @@ module ProjectsHelper
|
|||
return result
|
||||
end
|
||||
|
||||
# 被邀请成员的状态
|
||||
def status_for_ivitied(ivite_list, project)
|
||||
if ivite_list.user.member_of?(project)
|
||||
value = "已经加入了项目!"
|
||||
elsif ivite_list.user.active?
|
||||
value = "邀请已发送,等待用户加入!"
|
||||
else
|
||||
value = "账号尚未激活,等待用户应答!"
|
||||
end
|
||||
end
|
||||
|
||||
# Added by young
|
||||
def course_settings_tabs
|
||||
tabs = [{:name => 'info', :action => :edit_project, :partial => 'projects/edit', :label => :label_information_plural, :course=>'1'},
|
||||
|
|
|
@ -85,7 +85,37 @@
|
|||
<%= l(:label_send_email)%>
|
||||
</a>
|
||||
<% end %>
|
||||
|
||||
<%# 邀请用户的状态 %>
|
||||
<% unless @inviter_lists.blank? %>
|
||||
<div class="section">
|
||||
<div class="section-header">
|
||||
<div class="desc">邀请成员加入项目进度列表</div>
|
||||
</div>
|
||||
<div class="invitations-records">
|
||||
<% @inviter_lists.each do |inviter_list| %>
|
||||
<table>
|
||||
<tbody>
|
||||
<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>
|
||||
</tbody>
|
||||
</table>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
|
||||
<% unless @inviter_lists.blank? %>
|
||||
<div>
|
||||
<% unless @inviters_count.nil? %>
|
||||
|
|
|
@ -53,7 +53,7 @@ zh:
|
|||
notice_not_authorized_message: 您访问的消息不存在!
|
||||
notice_email_sent: "邮件已发送至 %{value}"
|
||||
notice_email_login_used: 无法自动为该邮箱注册新用户,该邮箱地址已经有人作为登录名使用!
|
||||
notice_email_invited: 已经向该邮箱发送过邀请,正在等待对方的回复!
|
||||
notice_email_invited: 已经向该邮箱发送过邀请,正在等待对方的回复,三小时后您可以再次发送邀请!
|
||||
notice_email_error: "发送邮件时发生错误 (%{value})"
|
||||
notice_feeds_access_key_reseted: 您的RSS存取键已被重置。
|
||||
notice_api_access_key_reseted: 您的API访问键已被重置。
|
||||
|
|
|
@ -51,6 +51,99 @@ a:hover.icon_removem{background:url(../images/img_floatbox.png) -22px -61px no-
|
|||
a.btn_free{ background:#ff5722; display:block; text-align:center; color:#fff; padding:3px 0; width:80px; margin-bottom:10px;}
|
||||
a:hover.btn_free{ background:#d63502;}
|
||||
.status_inviter{color: #3CA5C6;font-weight: bold; font-size: 14px }
|
||||
/*邮件邀请新列表*/
|
||||
.section{background-color: #FFF;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
-moz-border-top-colors: none;
|
||||
-moz-border-right-colors: none;
|
||||
-moz-border-bottom-colors: none;
|
||||
-moz-border-left-colors: none;
|
||||
border-image: none;
|
||||
border-color: #DAE1E8 #D3DDE5 #B6C8D8;
|
||||
box-shadow: 0px 1px 0px 0px rgba(56, 61, 72, 0.09);
|
||||
margin-bottom: 14px;
|
||||
border-radius: 3px;
|
||||
margin-top: 20px;}
|
||||
|
||||
.section .section-header {
|
||||
/*font-size: 24px;*/
|
||||
font-weight: 200;
|
||||
line-height: 32px;
|
||||
}
|
||||
|
||||
.section .section-header div.desc {
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
line-height: 25px;
|
||||
padding: 20px 15px;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.invitations-records {
|
||||
border-top: 1px solid #DFE4E8;
|
||||
}
|
||||
|
||||
.invitations-records table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
.invitations-records tr {
|
||||
border-bottom: 1px solid #EAEDED;
|
||||
}
|
||||
.invitations-records td.email {
|
||||
width: 178px;
|
||||
}
|
||||
.invitations-records td {
|
||||
transition-property: background;
|
||||
transition-duration: 0.3s;
|
||||
}
|
||||
.invitations-records td, .invitations-records th {
|
||||
padding: 15px;
|
||||
position: relative;
|
||||
}
|
||||
/*th, td {*/
|
||||
/*text-align: left;*/
|
||||
/*vertical-align: top;*/
|
||||
/*}*/
|
||||
.invitations-records td.email {
|
||||
max-width: 150px;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.invitations-records td.text-name {
|
||||
max-width: 150px;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
width: 150px;
|
||||
}
|
||||
.invitations-records td.text-name span.unactive {
|
||||
max-width: 150px;
|
||||
color: #888;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.invitations-records td.text-status {
|
||||
max-width: 290px;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
color: #7CAD37;
|
||||
font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
|
||||
width: 290px;
|
||||
}
|
||||
.invitations-records td.text-time {
|
||||
max-width: 80px;
|
||||
font-size: 12px;
|
||||
color: #888;
|
||||
display: block;
|
||||
text-align: right;
|
||||
width: 80px;
|
||||
}
|
||||
/*成员邀请*/
|
||||
.invi_search{ }
|
||||
.invi_search_input{ border:1px solid #15bccf; width:180px; height:24px; color:#9b9b9b; padding-left:5px; margin-bottom:10px;}
|
||||
|
|
|
@ -131,6 +131,7 @@ a:hover.c_orange{color: #d33503;}
|
|||
a.c_lorange{color:#ff9900;}
|
||||
a:hover.c_lorange{color:#fff;}
|
||||
a.c_blue{ color:#15bccf;}
|
||||
a.c_eblue{color: #3784D3}
|
||||
a.c_setting_blue{color: #0781B4}
|
||||
a.c_dblue{ color:#09658c;}
|
||||
a:hover.c_dblue{ color:#15bccf;}
|
||||
|
|
Loading…
Reference in New Issue