Sha256: b0197411280a6ce415f85efb1fc807c28936b5f6bef6f876b90210c11a651867

Contents?: true

Size: 672 Bytes

Versions: 14

Compression:

Stored size: 672 Bytes

Contents

module Admin::SitesHelper

  def application_domain
    domain = Locomotive.config.default_domain
    domain += ":#{request.port}" if request.port != 80
    domain
  end

  def main_site_url(site = current_site, options = {})
    url = "http://#{site.subdomain}.#{Locomotive.config.default_domain}"
    url += ":#{request.port}" if request.port != 80
    url = File.join(url, controller.request.fullpath) if options.has_key?(:uri) && options[:uri]
    url
  end

  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

end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
locomotive_cms-1.0.0.beta.2 app/helpers/admin/sites_helper.rb
locomotive_cms-1.0.0.beta app/helpers/admin/sites_helper.rb
locomotive_cms-0.0.4.beta12 app/helpers/admin/sites_helper.rb
locomotive_cms-0.0.4.beta11 app/helpers/admin/sites_helper.rb
locomotive_cms-0.0.4.beta10 app/helpers/admin/sites_helper.rb
locomotive_cms-0.0.4.beta9 app/helpers/admin/sites_helper.rb
locomotive_cms-0.0.4.beta8 app/helpers/admin/sites_helper.rb
locomotive_cms-0.0.4.beta7 app/helpers/admin/sites_helper.rb
locomotive_cms-0.0.4.beta5 app/helpers/admin/sites_helper.rb
locomotive_cms-0.0.4.beta4 app/helpers/admin/sites_helper.rb
locomotive_cms-0.0.4.beta3 app/helpers/admin/sites_helper.rb
locomotive_cms-0.0.4.beta2 app/helpers/admin/sites_helper.rb
locomotive_cms-0.0.4.beta1 app/helpers/admin/sites_helper.rb
locomotive_cms-0.0.4 app/helpers/admin/sites_helper.rb