Sha256: 11c0ae74fb41ae40b34614c2128c6bc2dd3a150c1b3642733eeed129eb5c8c1d

Contents?: true

Size: 1.29 KB

Versions: 12

Compression:

Stored size: 1.29 KB

Contents

- default_page_title ||= nil; on_site_link ||= nil
- current_title = default_page_title || plural(model_class).capitalize
- title current_title
- state_method ||= :state
- tabs = get_collection
.page-header
  .row
    - search_render_show = searchable_model?(model_class) || decorator_class(model_class).list_filters.any?
    %div{ class: "col-md-#{search_render_show ? 4 : 12}" }
      %h1
        = current_title
        = link_to fa_icon(:plus), new_current_model_record_path, class: 'btn btn-primary'
        - if defined? Tramway::Export::Engine
          = render 'tramway/export/button'
    = render 'search', model_class: model_class
%hr
%ul.nav.nav-tabs
  - if params[:search].present?
    %li.nav-item
      = link_to search_tab_title(@records.total_count), '#', class: 'nav-link active'
    %li.nav-item
      = link_to t('helpers.actions.reset'), records_path(model: params[:model], filter: params[:filter]), class: 'nav-link'
  - else
    - tabs.each_with_index do |tab, index|
      %li.nav-item
        = link_to admin_index_path_of_model(model_class, tab, (params[:filter].present? ? params[:filter] : nil)&.permit!), class: "#{active_tab(tab, index)} nav-link" do
          != tab_title(model_class, tab, @counts[tab], state_method)
%div{ id: (params[:search] ? :search : params[:scope]) }
  = render 'list'

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
tramway-admin-1.32.2.5 app/views/tramway/admin/records/index.html.haml
tramway-admin-1.32.2.4 app/views/tramway/admin/records/index.html.haml
tramway-admin-1.32.2.2 app/views/tramway/admin/records/index.html.haml
tramway-admin-1.32.2.1 app/views/tramway/admin/records/index.html.haml
tramway-admin-1.32.2 app/views/tramway/admin/records/index.html.haml
tramway-admin-1.32.1.4 app/views/tramway/admin/records/index.html.haml
tramway-admin-1.32.1.3 app/views/tramway/admin/records/index.html.haml
tramway-admin-1.32.1.2 app/views/tramway/admin/records/index.html.haml
tramway-admin-1.32.1.1 app/views/tramway/admin/records/index.html.haml
tramway-admin-1.32.1 app/views/tramway/admin/records/index.html.haml
tramway-admin-1.32.0.1 app/views/tramway/admin/records/index.html.haml
tramway-admin-1.32 app/views/tramway/admin/records/index.html.haml