Sha256: 60aeff1e02878ff43072e61da424a3681b44dfb379debc3c480c423cc5f00ae2

Contents?: true

Size: 806 Bytes

Versions: 1

Compression:

Stored size: 806 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

1 entries across 1 versions & 1 rubygems

Version Path
brainsome_typus-4.0.0.beta10 app/helpers/admin/resources_helper.rb