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
@organization = Organization.find(params[:organization_id])
@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])
end
end

View File

@ -163,7 +163,7 @@
<div class="cl"></div>
<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>
</ul>
</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();
}
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)){
$.ajax({
url:"<%= apply_subdomain_organization_path %>",

View File

@ -12,24 +12,13 @@
<%= ma.content %>
</li>
<li class="homepageHomeworkContentWarn fl">
<% if ma.status == 0 %>
<%=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" %>
<%=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 %>
<%=link_to (ma.organization.domain.nil? || (ma.organization.domain && ma.organization.domain != ma.content)) ? "同意申请":"已同意申请",
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_#{ma.id}",
:method => 'post',
:remote => true,
:class => "green_btn_cir ml10",
:style => "color:#fff" %>
</li>
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
</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>
</li>
<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 class="homepageNewsContent fl">
<%= ma.content %>