鼠标经过弹框消息提示
This commit is contained in:
parent
5e4a659cba
commit
7658844a28
|
@ -79,7 +79,7 @@ class MembersController < ApplicationController
|
|||
# 添加成功后所有管理员收到的消息状态都要更新
|
||||
applied_messages = AppliedMessage.where(:applied_id => @applied_message.applied_id, :project_id => @applied_message.project_id, :status => 1,
|
||||
:applied_type => "AppliedProject")
|
||||
applied_messages.update_all(:status => 7)
|
||||
applied_messages.update_all(:status => 7, :viewed => true)
|
||||
@applied_message = AppliedMessage.find(params[:applied_message_id])
|
||||
# 添加成功后,申请人收到消息
|
||||
AppliedMessage.create(:user_id => @applied_message.applied_user_id, :applied_type => "AppliedProject", :applied_id => applied_project.id ,
|
||||
|
@ -105,12 +105,12 @@ class MembersController < ApplicationController
|
|||
applied_project = @applied_message.applied
|
||||
# 发送消息给被拒者,user_id对应的收到信息的用户
|
||||
AppliedMessage.create(:user_id => @applied_message.applied_user_id, :applied_type => "AppliedProject", :applied_id => applied_project.id ,:status => 4,
|
||||
:viewed => true, :applied_user_id => @applied_message.user_id, :role => applied_project.role, :project_id => applied_project.project_id)
|
||||
:viewed => false, :applied_user_id => @applied_message.user_id, :role => applied_project.role, :project_id => applied_project.project_id)
|
||||
|
||||
# 拒绝功后所有管理员收到的消息状态都要更新
|
||||
applied_messages = AppliedMessage.where(:applied_id => @applied_message.applied_id, :project_id => @applied_message.project_id, :status => 1,
|
||||
:applied_type => "AppliedProject")
|
||||
applied_messages.update_all(:status => 5)
|
||||
:applied_type => "AppliedProject")
|
||||
applied_messages.update_all(:status => 5, :viewed => true)
|
||||
@applied_message = AppliedMessage.find(params[:applied_message_id])
|
||||
# AppliedMessage.create(:user_id => @applied_message.user_id, :applied_type => "AppliedProject", :applied_id => applied_project.id ,:status => 5,
|
||||
# :viewed => true, :applied_user_id => @applied_message.applied_user_id, :role => applied_project.role, :project_id => applied_project.project_id)
|
||||
|
|
|
@ -80,6 +80,19 @@ module UsersHelper
|
|||
# end
|
||||
end
|
||||
|
||||
def applied_project_status applied_message
|
||||
case applied_message.status
|
||||
when 4
|
||||
"被拒绝"
|
||||
when 5
|
||||
"您已拒绝"
|
||||
when 6
|
||||
"已通过"
|
||||
when 7
|
||||
"您已同意"
|
||||
end
|
||||
end
|
||||
|
||||
# 项目申请消息通过状态判断tip描述
|
||||
def applied_project_tip applied_message
|
||||
case applied_message.status
|
||||
|
@ -92,6 +105,18 @@ module UsersHelper
|
|||
end
|
||||
end
|
||||
|
||||
def applied_project_tip_header applied_message
|
||||
case applied_message.status
|
||||
when 4
|
||||
"婉拒您"
|
||||
when 5,3,2,1,7
|
||||
"申请:"
|
||||
when 6
|
||||
"同意您"
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
def get_resource_origin attach
|
||||
type = attach.container_type
|
||||
content = attach.container
|
||||
|
|
|
@ -88,6 +88,13 @@
|
|||
<% elsif ma.course_message_type == "Exercise" && ma.status == 3 %>
|
||||
<li><a href="<%=exercise_path(:id => ma.course_message.id) %>" target="_blank" title="<%=ma.course_message.user.show_name %>老师 发布的测验:<%=ma.course_message.exercise_name %> 截止时间快到了"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %>老师 </span>发布的测验:<%=ma.course_message.exercise_name %> 截止时间快到了</a></li>
|
||||
<% end %>
|
||||
<% elsif ma.class == AppliedMessage %>
|
||||
<% if ma.applied_type == "AppliedProject" %>
|
||||
<li><%=link_to "<span class='shadowbox_news_user'>#{applied_project_users(ma)}</span>".html_safe, user_path(applied_project_users(ma)), :target => '_blank' %>
|
||||
<span><%= applied_project_tip_header(ma) %>以“<%= applied_project_message_type(ma.role) %>”身份加入<% project = Project.find(ma.project_id) %>
|
||||
<%= link_to project.name, project_path(ma.project_id), :class => "link-blue", :target => '_blank', :title => "#{project.name}" %>
|
||||
</span>
|
||||
<% end %>
|
||||
<% elsif ma.class == ForgeMessage %>
|
||||
<% if ma.forge_message_type == "AppliedProject" %>
|
||||
<li><a href="<%=settings_project_path(:id => ma.project, :tab => "members") %>" target="_blank" title="<%=ma.forge_message.user.show_name %> 申请加入项目:<%= ma.project.name%>"><span class="shadowbox_news_user"><%=ma.forge_message.user.show_name %> </span>申请加入项目:<%= ma.project.name%></a></li>
|
||||
|
|
Loading…
Reference in New Issue