Merge branch 'szzh' of https://git.trustie.net/jacknudt/trustieforge into szzh
commit
368e4cd14a
@ -1,3 +1,3 @@
|
|||||||
$("#reply_div_<%= @issue.id %>").html("<%= escape_javascript(render :partial => 'issues/issue_replies', :locals => {:issue => @issue,:replies_all_i=>0}) %>");
|
$("#reply_div_<%= @issue.id %>").html("<%= escape_javascript(render :partial => 'issues/issue_replies', :locals => {:issue => @issue,:replies_all_i=>0}) %>");
|
||||||
$(".homepagePostReplyBannerCount").html('回复(<%= Issue.find( @issue).journals.count %>)')
|
$(".homepagePostReplyBannerCount").html('回复(<%= Issue.find( @issue).journals.count %>)')
|
||||||
sd_create_editor_from_data(<%= @issue.id%>, null, "100%");
|
sd_create_editor_from_data(<%= @issue.id%>, null, "100%","<%=@issue.class.name%>");
|
@ -1,3 +1,3 @@
|
|||||||
$("#reply_div_<%= @issue.id %>").html("<%= escape_javascript(render :partial => 'issues/issue_replies', :locals => {:issue => @issue,:replies_all_i=>0}) %>");
|
$("#reply_div_<%= @issue.id %>").html("<%= escape_javascript(render :partial => 'issues/issue_replies', :locals => {:issue => @issue,:replies_all_i=>0}) %>");
|
||||||
$(".homepagePostReplyBannerCount").html('回复(<%= @issue.journals.count %>)')
|
$(".homepagePostReplyBannerCount").html('回复(<%= @issue.journals.count %>)')
|
||||||
sd_create_editor_from_data(<%= @issue.id%>, null, "100%");
|
sd_create_editor_from_data(<%= @issue.id%>, null, "100%","<%=@issue.class.name%>");
|
@ -0,0 +1,53 @@
|
|||||||
|
#coding=utf-8
|
||||||
|
|
||||||
|
# elasticsearch 在开发环境下也要打开,很烦人的
|
||||||
|
|
||||||
|
if Rails.env.development?
|
||||||
|
|
||||||
|
require 'elasticsearch/model'
|
||||||
|
module Elasticsearch
|
||||||
|
module Model
|
||||||
|
class NoObject
|
||||||
|
|
||||||
|
instance_methods.each do |m|
|
||||||
|
undef_method(m) unless [:object_id, :__send__, :undef_method, :method_missing].include?(m)
|
||||||
|
end
|
||||||
|
|
||||||
|
def method_missing(method, *args, &block)
|
||||||
|
puts "NoObject #{method} #{args}"
|
||||||
|
end
|
||||||
|
|
||||||
|
def NoObject.included(mod)
|
||||||
|
puts "#{self} included in #{mod}"
|
||||||
|
end
|
||||||
|
|
||||||
|
def self.extended(mod)
|
||||||
|
puts "#{self} extended in #{mod}"
|
||||||
|
end
|
||||||
|
|
||||||
|
def initialize
|
||||||
|
puts methods
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def self.included(base)
|
||||||
|
base.instance_eval do
|
||||||
|
def settings(a)
|
||||||
|
end
|
||||||
|
|
||||||
|
def __elasticsearch__
|
||||||
|
@__elasticsearch__ ||= NoObject.new
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
base.class_eval do
|
||||||
|
def __elasticsearch__
|
||||||
|
@__elasticsearch__ ||= NoObject.new
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
@ -1,9 +1,30 @@
|
|||||||
class Subdomain
|
class Subdomain
|
||||||
|
|
||||||
|
def initialize(opt={})
|
||||||
|
@opt = {}.merge(opt)
|
||||||
|
end
|
||||||
|
|
||||||
def matches?(request)
|
def matches?(request)
|
||||||
o = Organization.where(domain: request.subdomain).first
|
puts request.path_parameters
|
||||||
request.path_parameters[:id] = o.id if o
|
o = Secdomain.where(subname: request.subdomain).first
|
||||||
!o.nil?
|
|
||||||
|
if(@opt[:sub])
|
||||||
|
if o && o.sub_type == 2 && request.path_parameters[:sub_dir_name] == 'news'
|
||||||
|
request.path_parameters[:id] = o.pid
|
||||||
|
request.path_parameters[:controller] = 'org_subfields'
|
||||||
|
request.path_parameters[:action] = 'show'
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
if o && o.controller
|
||||||
|
request.path_parameters[:id] = o.pid
|
||||||
|
request.path_parameters[:controller] = o.controller
|
||||||
|
request.path_parameters[:action] = o.action
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
false
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
Loading…
Reference in new issue