组织子域名申请流程问题
This commit is contained in:
parent
4e2f82a187
commit
2520058a5d
|
@ -636,7 +636,7 @@ class OrganizationsController < ApplicationController
|
|||
end
|
||||
def apply_subdomain
|
||||
organization = Organization.find(params[:id])
|
||||
@applied_message_count = AppliedMessage.where(:applied_id => organization.id, :name => params[:domain].downcase, :status => 1).count
|
||||
@applied_message_count = AppliedMessage.where(:applied_id => organization.id, :name => params[:domain].downcase, :status => 0).count
|
||||
# 如果申请过该名字,怎不能重复申请
|
||||
if @applied_message_count > 0
|
||||
@flag = 1
|
||||
|
@ -670,7 +670,7 @@ class OrganizationsController < ApplicationController
|
|||
end
|
||||
# 自己处理自己的消息则不需要另外发送消息
|
||||
if User.current.id != @applied_message.applied_user_id
|
||||
AppliedMessage.create(:user_id => @applied_message.applied_user_id, :applied_id => organization_id, :applied_type => 'Organization', :viewed => 0, :satus => 2, :applied_user_id => User.current.id, :name => org_domain.downcase)
|
||||
OrgMessage.create(:user_id => params[:user_id], :organization_id => organization_id, :message_type => 'AgreeApplySubdomain', :message_id => organization_id, :sender_id => User.current.id, :viewed => 0, :content => params[:org_domain])
|
||||
end
|
||||
@applied_message.status = 2
|
||||
@applied_message.updated_at = Time.now
|
||||
|
@ -696,7 +696,7 @@ class OrganizationsController < ApplicationController
|
|||
applied_messages.update_all(:status => 4, :viewed => true, :updated_at => Time.now)
|
||||
# 自己处理自己的消息则不需要另外发送消息
|
||||
if User.current.id != @applied_message.applied_user_id
|
||||
AppliedMessage.create(:user_id => @applied_message.applied_user_id, :applied_id => organization_id, :applied_type => 'Organization', :viewed => 0, :satus => 4, :applied_user_id => User.current.id, :name => org_domain.downcase)
|
||||
OrgMessage.create(:user_id => params[:user_id], :organization_id => organization_id, :message_type => 'DisagreeApplySubdomain', :message_id => organization_id, :sender_id => User.current.id, :viewed => 0, :content => params[:org_domain])
|
||||
end
|
||||
@applied_message.status = 4
|
||||
@applied_message.updated_at = Time.now
|
||||
|
|
|
@ -221,6 +221,7 @@
|
|||
},
|
||||
success:function(){
|
||||
if(!$is_exist){
|
||||
$("#apply_hint").text("");
|
||||
$.ajax({
|
||||
url:"<%= apply_subdomain_organization_path %>",
|
||||
type:'post',
|
||||
|
|
|
@ -41,3 +41,19 @@
|
|||
<li class="homepageNewsTime fr"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||
</ul>
|
||||
<% end %>
|
||||
<% if ma.message_type == 'DisagreeApplySubdomain'%>
|
||||
<ul class="homepageNewsList fl">
|
||||
<div class="longMessageWidth">
|
||||
<li class="homepageNewsPortrait fl">
|
||||
<div class="navHomepageLogo fl"><%= image_tag("/images/trustie_logo1.png", width: "30px", height: "30px", class: "mt3") %></div>
|
||||
</li>
|
||||
<li class="homepageNewsPubType fl">
|
||||
<span class='homepageNewsType fl'>管理员拒绝了您的子域名申请:</span>
|
||||
</li>
|
||||
<li class="messageInformationContents">
|
||||
<%= ma.content %>
|
||||
</li>
|
||||
</div>
|
||||
<li class="homepageNewsTime fr"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||
</ul>
|
||||
<% end %>
|
||||
|
|
Loading…
Reference in New Issue