Sha256: 236193ad6996141745a1a8f0d1e2fb861f9a5a106a771caf9f43375c373770cd

Contents?: true

Size: 1.54 KB

Versions: 15

Compression:

Stored size: 1.54 KB

Contents

= breadcrumb[:current] 
%ul.dropdown-menu
  - if breadcrumb[:parent_object].present?
    - if breadcrumb[:parent_object].respond_to?(breadcrumb[:resource])
      - breadcrumb[:parent_object].send(breadcrumb[:resource]).limit(limit).each do |resource|
        %li= link_to resource, {controller: breadcrumb[:resource], action: 'show', id: resource} if can?(:read, resource)
      - - total_breadcrumb_data = breadcrumb[:parent_object].send(breadcrumb[:resource]).count
      - if total_breadcrumb_data > limit
        %li= link_to "- - #{t('see_all')} (#{total_breadcrumb_data} data) - -".html_safe, {controller: breadcrumb[:resource], action: 'index', "#{breadcrumb[:parent_object].class.name.underscore}_id" => breadcrumb[:parent_object].id} if can?(:read, breadcrumb[:resource].classify.constantize)
    - else
      - resource = breadcrumb[:parent_object].send(breadcrumb[:resource].singularize)
      %li= link_to resource, {controller: breadcrumb[:resource], action: 'show', id: resource} if can?(:read, resource)
  - else
    - breadcrumb[:resource].classify.constantize.limit(limit).each do |parent_resource|
      %li= link_to parent_resource, {controller: breadcrumb[:resource], action: 'show', id: parent_resource} if can?(:read, parent_resource)
    - total_breadcrumb_data = breadcrumb[:resource].classify.constantize.count
    - if total_breadcrumb_data > limit
      %li= link_to "- - #{t('see_all')} (#{total_breadcrumb_data} data) - -".html_safe, {controller: breadcrumb[:resource], action: 'index'} if can?(:read, breadcrumb[:resource].classify.constantize)

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
rich_table_component-0.0.18 app/views/rich_table_component/component/_breadcrumbs_dropdown.html.haml
rich_table_component-0.0.17 app/views/rich_table_component/component/_breadcrumbs_dropdown.html.haml
rich_table_component-0.0.16 app/views/rich_table_component/component/_breadcrumbs_dropdown.html.haml
rich_table_component-0.0.15 app/views/rich_table_component/component/_breadcrumbs_dropdown.html.haml
rich_table_component-0.0.14 app/views/rich_table_component/component/_breadcrumbs_dropdown.html.haml
rich_table_component-0.0.13 app/views/rich_table_component/component/_breadcrumbs_dropdown.html.haml
rich_table_component-0.0.10 app/views/rich_table_component/component/_breadcrumbs_dropdown.html.haml
rich_table_component-0.0.9 app/views/rich_table_component/component/_breadcrumbs_dropdown.html.haml
rich_table_component-0.0.8 app/views/rich_table_component/component/_breadcrumbs_dropdown.html.haml
rich_table_component-0.0.7 app/views/rich_table_component/component/_breadcrumbs_dropdown.html.haml
rich_table_component-0.0.6 app/views/rich_table_component/component/_breadcrumbs_dropdown.html.haml
rich_table_component-0.0.5 app/views/rich_table_component/component/_breadcrumbs_dropdown.html.haml
rich_table_component-0.0.4 app/views/rich_table_component/component/_breadcrumbs_dropdown.html.haml
rich_table_component-0.0.3 app/views/rich_table_component/component/_breadcrumbs_dropdown.html.haml
rich_table_component-0.0.2 app/views/rich_table_component/component/_breadcrumbs_dropdown.html.haml