Sha256: 7ee23090347ca21129ccc8d443b3ae404e37eebf3e5f07f78cb26f7f8323b02d

Contents?: true

Size: 1.82 KB

Versions: 1

Compression:

Stored size: 1.82 KB

Contents

- resource = (@_effective_resource || Effective::Resource.new(controller_path))

- if @datatable
  - content_for :datatable do
    = render_datatable(@datatable, charts: false)
  - content_for :datatable_charts do
    - keys = @datatable._charts.keys
    - ks = keys.size
    - if ks.positive?
      .row
        - @datatable._charts.keys.each do |k|
          %div{ class: "#{col_class_num('xl', ks, 3)} #{col_class_num('lg', ks, 2)} #{col_class_num('md', ks, 6)} #{col_class_num('sm', ks, 6)}"}
            .card.card-secondary
              .card-header
                %h3.card-title= I18n.t([@datatable.class.name.underscore, 'charts', k].join('.'))
                .card-tools.text-right
                  %button.btn.btn-tool{ type: :button, 'data-card-widget': :maximize }
                    %i.fas.fa-expand
              .card-body
                = render_datatable_chart(@datatable, k)

- if @datatable
  = content_for :datatable_charts
.row
  .col-12
    .card
      .card-header
        %h3.card-title= @page_title
        .card-tools
          = resource_form_actions(@context.route_builder, resource.klass, for_action: :index)
      .card-body
        - if @datatable
          = content_for :datatable

        - elsif instance_variable_get('@' + resource.plural_name).respond_to?(:to_partial_path)
          = render instance_variable_get('@' + resource.plural_name)

        - elsif instance_variable_get('@' + resource.name).respond_to?(:to_partial_path)
          = render instance_variable_get('@' + resource.name)

        - elsif Rails.env.development?
          %p effective_resources index view is not sure what to render.
          %p Define an @datatable, @#{resource.try(:plural_name) || 'a plural'}, or @#{resource.try(:name) || 'a singular'}.
          %p or include Effective::CrudController in your controller
      -# .card-footer

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
five-two-nw-olivander-0.1.2.7 app/views/application/index.html.haml