Merge branch 'dev_hjq' into szzh

This commit is contained in:
ouyangxuhua 2016-01-08 19:34:36 +08:00
commit 3a62db6475
5 changed files with 12 additions and 23 deletions

View File

@ -312,7 +312,7 @@ class OrganizationsController < ApplicationController
def agree_apply_subdomain def agree_apply_subdomain
@organization = Organization.find(params[:organization_id]) @organization = Organization.find(params[:organization_id])
@organization.update_attribute(:domain, params[:org_domain]) @organization.update_attribute(:domain, params[:org_domain])
if OrgMessage.where("message_type='AgreeApplySubdomain' and organization_id=#{@organization.id} and content=#{params[:org_domain]}").count == 0 if OrgMessage.where("message_type='AgreeApplySubdomain' and organization_id=#{@organization.id} and content=?",params[:org_domain]).count == 0
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]) 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 end
end end

View File

@ -163,7 +163,7 @@
<div class="cl"></div> <div class="cl"></div>
<ul class="copyright mt10"> <ul class="copyright mt10">
<li class="fl mr30">Copyright&nbsp;&copy;&nbsp;2007-2015,&nbsp;All Rights Reserved</li> <li class="fl mr30">Copyright&nbsp;&copy;&nbsp;2007-2016,&nbsp;All Rights Reserved</li>
<li>ICP备09019772</li> <li>ICP备09019772</li>
</ul> </ul>
</div> </div>

View File

@ -1 +1 @@
$("#agree_apply_subdomain").text("已同意申请"); $("#agree_apply_subdomain_<%= params[:act_id] %>").text("已同意申请");

View File

@ -140,7 +140,7 @@
$("#add_subfield_form").submit(); $("#add_subfield_form").submit();
} }
function apply_subdomain(id, domain){ function apply_subdomain(id, domain){
var reg = new RegExp("[a-zA-Z0-9_]{1,}"); var reg = new RegExp("^[a-zA-Z0-9_]{1,}$");
if (reg.exec(domain)){ if (reg.exec(domain)){
$.ajax({ $.ajax({
url:"<%= apply_subdomain_organization_path %>", url:"<%= apply_subdomain_organization_path %>",

View File

@ -12,24 +12,13 @@
<%= ma.content %> <%= ma.content %>
</li> </li>
<li class="homepageHomeworkContentWarn fl"> <li class="homepageHomeworkContentWarn fl">
<% if ma.status == 0 %> <%=link_to (ma.organization.domain.nil? || (ma.organization.domain && ma.organization.domain != ma.content)) ? "同意申请":"已同意申请",
<%=link_to "同意", agree_apply_subdomain_organizations_path( :organization_id => ma.organization_id, :org_domain => ma.content, :user_id => ma.sender_id, :message_id => ma.id ), agree_apply_subdomain_organizations_path( :organization_id => ma.organization_id, :org_domain => ma.content, :user_id => ma.sender_id, :act_id => ma.id ),
:id => 'agree_apply_subdomain', :id => "agree_apply_subdomain_#{ma.id}",
:method => 'post', :method => 'post',
:remote => true, :remote => true,
:class => "green_btn_cir ml10", :class => "green_btn_cir ml10",
:style => "color:#fff" %> :style => "color:#fff" %>
<%=link_to "拒绝", agree_apply_subdomain_organizations_path( :organization_id => ma.organization_id, :org_domain => ma.content, :user_id => ma.sender_id,:message_id => ma.id ),
:id => 'agree_apply_subdomain',
:method => 'post',
:remote => true,
:class => "green_btn_cir ml10",
:style => "color:#fff" %>
<% elsif ma.status == 1 %>
<a href="javascript:void(0);" class="green_btn_cir ml10">已同意</a>
<% elsif ma.status == 2 %>
<a href="javascript:void(0);" class="green_btn_cir ml10">已拒绝</a>
<% end %>
</li> </li>
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li> <li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
</ul> </ul>
@ -40,7 +29,7 @@
<a href="javascript:void(0);"><div class="navHomepageLogo fl"><%= image_tag("/images/trustie_logo1.png", width: "30px", height: "30px", class: "mt3") %></div></a> <a href="javascript:void(0);"><div class="navHomepageLogo fl"><%= image_tag("/images/trustie_logo1.png", width: "30px", height: "30px", class: "mt3") %></div></a>
</li> </li>
<li class="homepageNewsPubType fl"> <li class="homepageNewsPubType fl">
<span class='<%= ma.viewed == 0 ? 'homepageNewsTypeNotRead fl' : 'homepageNewsType fl' %>'>管理员<%= ma.status == 1 ? '同意':'拒绝' %>了您的子域名申请:</span> <span class='<%= ma.viewed == 0 ? 'homepageNewsTypeNotRead fl' : 'homepageNewsType fl' %>'>管理员同意了您的子域名申请:</span>
</li> </li>
<li class="homepageNewsContent fl"> <li class="homepageNewsContent fl">
<%= ma.content %> <%= ma.content %>