Sha256: e5d626e6d1b72fbabdfd35f0550d08e1dc4250c3cff473075a2dff8bce1f8820

Contents?: true

Size: 804 Bytes

Versions: 9

Compression:

Stored size: 804 Bytes

Contents

module Admin::ResourcesHelper

  def admin_search(resource = @resource, params = params)
    if (typus_search = resource.typus_defaults_for(:search)) && typus_search.any?

      hidden_filters = params.dup
      rejections = %w(controller action locale utf8 sort_order order_by search page)
      hidden_filters.delete_if { |k, v| rejections.include?(k) }

      render "helpers/admin/resources/search", :hidden_filters => hidden_filters
    end
  end

  def build_sidebar
    app_name = @resource.typus_application
    resources = admin_user.application(app_name).map(&:constantize).delete_if { |k| k.typus_options_for(:hide_from_sidebar) }

    if resources.any?
      render "helpers/admin/resources/sidebar", :resources => resources
    else
      render "admin/dashboard/sidebar"
    end
  end

end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
brainsome_typus-4.0.0.beta9 app/helpers/admin/resources_helper.rb
brainsome_typus-4.0.0.beta8 app/helpers/admin/resources_helper.rb
brainsome_typus-4.0.0.beta7 app/helpers/admin/resources_helper.rb
brainsome_typus-4.0.0.beta6 app/helpers/admin/resources_helper.rb
brainsome_typus-4.0.0.beta5 app/helpers/admin/resources_helper.rb
brainsome_typus-4.0.0.beta4 app/helpers/admin/resources_helper.rb
brainsome_typus-4.0.0.beta3 app/helpers/admin/resources_helper.rb
brainsome_typus-4.0.0.beta2 app/helpers/admin/resources_helper.rb
brainsome_typus-4.0.0.beta1 app/helpers/admin/resources_helper.rb