Sha256: 2185349997cb9ecc975e6646b894121cf496d638be3bd2f2df94300f5ae1c42b

Contents?: true

Size: 701 Bytes

Versions: 89

Compression:

Stored size: 701 Bytes

Contents

module MultiSite::SiteChooserHelper

def sites_chooser_thing
  return "" unless current_user.admin? && defined?(Site) && defined?(controller) && controller.sited_model? && controller.template_name == 'index' && Site.several?
  options = Site.all.map{ |site| "<li>" + link_to( site.name, "#{request.path}?site_id=#{site.id}", :class => site == current_site ? 'fg' : '') + "</li>" }.join("")
  chooser = %{<div id="site_chooser">}
  #chooser << link_to("sites", admin_sites_url, {:id => 'show_site_list', :class => 'expandable'})
  chooser << %{<ul id="nav"><li>Current Site: #{current_site.name}}
  chooser << %{<ul class="expansion">#{options}</ul></li></ul>}
  chooser << %{</div>}
  chooser
end

end

Version data entries

89 entries across 89 versions & 1 rubygems

Version Path
trusty-cms-6.3.1 vendor/extensions/multi-site-extension/lib/multi_site/site_chooser_helper.rb
trusty-cms-7.0.2 vendor/extensions/multi-site-extension/lib/multi_site/site_chooser_helper.rb
trusty-cms-7.0.1 vendor/extensions/multi-site-extension/lib/multi_site/site_chooser_helper.rb
trusty-cms-7.0.0 vendor/extensions/multi-site-extension/lib/multi_site/site_chooser_helper.rb
trusty-cms-6.3 vendor/extensions/multi-site-extension/lib/multi_site/site_chooser_helper.rb
trusty-cms-6.2.1 vendor/extensions/multi-site-extension/lib/multi_site/site_chooser_helper.rb
trusty-cms-6.2.2.1 vendor/extensions/multi-site-extension/lib/multi_site/site_chooser_helper.rb
trusty-cms-6.2.0 vendor/extensions/multi-site-extension/lib/multi_site/site_chooser_helper.rb
trusty-cms-6.1.2 vendor/extensions/multi-site-extension/lib/multi_site/site_chooser_helper.rb
trusty-cms-6.1.1 vendor/extensions/multi-site-extension/lib/multi_site/site_chooser_helper.rb
trusty-cms-6.0.5 vendor/extensions/multi-site-extension/lib/multi_site/site_chooser_helper.rb
trusty-cms-6.0.4 vendor/extensions/multi-site-extension/lib/multi_site/site_chooser_helper.rb
trusty-cms-6.0.3 vendor/extensions/multi-site-extension/lib/multi_site/site_chooser_helper.rb
trusty-cms-6.0.2 vendor/extensions/multi-site-extension/lib/multi_site/site_chooser_helper.rb
trusty-cms-6.0.1 vendor/extensions/multi-site-extension/lib/multi_site/site_chooser_helper.rb
trusty-cms-5.6.1 vendor/extensions/multi-site-extension/lib/multi_site/site_chooser_helper.rb
trusty-cms-6.0.0 vendor/extensions/multi-site-extension/lib/multi_site/site_chooser_helper.rb
trusty-cms-5.6.0 vendor/extensions/multi-site-extension/lib/multi_site/site_chooser_helper.rb
trusty-cms-5.5.9 vendor/extensions/multi-site-extension/lib/multi_site/site_chooser_helper.rb
trusty-cms-5.5.8 vendor/extensions/multi-site-extension/lib/multi_site/site_chooser_helper.rb