2010-05-10 22:39:52 +00:00
|
|
|
module Admin::SitesHelper
|
2010-07-23 20:09:54 +00:00
|
|
|
|
2010-05-10 22:39:52 +00:00
|
|
|
def application_domain
|
2011-04-01 00:34:19 +00:00
|
|
|
domain = Locomotive.config.domain
|
2010-05-10 22:39:52 +00:00
|
|
|
domain += ":#{request.port}" if request.port != 80
|
|
|
|
domain
|
|
|
|
end
|
2010-07-23 20:09:54 +00:00
|
|
|
|
2010-05-10 22:39:52 +00:00
|
|
|
def error_on_domain(site, name)
|
|
|
|
if (error = (site.errors[:domains] || []).detect { |n| n.include?(name) })
|
|
|
|
content_tag(:span, error, :class => 'inline-errors')
|
|
|
|
else
|
|
|
|
''
|
|
|
|
end
|
|
|
|
end
|
2010-07-23 20:09:54 +00:00
|
|
|
|
2011-04-01 00:34:19 +00:00
|
|
|
def manage_subdomain_or_domains?
|
2011-04-03 23:59:41 +00:00
|
|
|
Locomotive.config.manage_subdomain? || Locomotive.config.manage_domains?
|
2011-04-01 00:34:19 +00:00
|
|
|
end
|
|
|
|
|
2011-04-05 00:18:17 +00:00
|
|
|
def manage_subdomain?
|
|
|
|
Locomotive.config.manage_subdomain?
|
|
|
|
end
|
|
|
|
|
2011-04-01 00:34:19 +00:00
|
|
|
def manage_domains?
|
2011-04-03 23:59:41 +00:00
|
|
|
Locomotive.config.manage_domains?
|
2011-04-01 00:34:19 +00:00
|
|
|
end
|
|
|
|
|
2011-04-03 23:59:41 +00:00
|
|
|
def multi_sites?
|
|
|
|
Locomotive.config.multi_sites?
|
2011-04-01 00:34:19 +00:00
|
|
|
end
|
|
|
|
|
2010-07-23 20:09:54 +00:00
|
|
|
end
|