Sha256: 7e33e02ae2aa895e47ecb987f80ee23490d54dac5a1a93c367113b05403cafa7

Contents?: true

Size: 2 KB

Versions: 7

Compression:

Stored size: 2 KB

Contents

.entity-header
  .entity-header__info
    - if cm_admin.method_defined?(:"cm_index_#{@model.name.underscore}_path") && (@model.current_action.name == 'show'|| @model.current_action.name == 'history' || @model.current_action.layout_type.present?)
      .breadcrumb
        = link_to "#{@model.model_name.titleize.pluralize} /", cm_admin.send(:"cm_index_#{@model.name.underscore}_path"), class: 'text-reset'
    h4 = action_title
  .entity-header__actions
    - if @model.current_action.name == 'index'
      - if @model.importer && has_valid_policy(@ar_object, :importable)
        = link_to 'Import', cm_admin.send(:"cm_import_#{@model.name.underscore}_path"), class: 'btn-primary ms-2'
      - new_action = @model.available_actions.select{|act| act if act.action_type.eql?(:default) && act.name.eql?('new')}
      - if new_action.any? && has_valid_policy(@ar_object, 'new')
        = link_to 'Add', cm_admin.send(:"cm_new_#{@model.name.underscore}_path"), class: 'btn-primary ms-2'
      - @model.available_actions.select{|act| act if act.route_type == 'collection'}.each do |custom_action|
        = custom_action_items(custom_action, 'index')
    - elsif @model.current_action.name == 'show'
      - @model.available_actions.select{|act| act if act.route_type == 'member'}.each do |custom_action|
        = custom_action_items(custom_action, 'show')

      - edit_action = @model.available_actions.select{|act| act if act.action_type.eql?(:default) && act.name.eql?('edit')}
      - destroy_action = available_actions(@model, @ar_object, 'destroy')
      - if edit_action.any? && has_valid_policy(@ar_object, 'edit')
        = link_to cm_admin.send(:"cm_edit_#{@model.name.underscore}_path", @ar_object), class: 'btn-primary ms-2' do
          span
            i.fa.fa-edit
          | Edit
      - if destroy_action
        = link_to '', data: { bs_toggle: 'modal', bs_target: "##{@model.name.classify}DestroyModal-#{@ar_object.id.to_s}" }, class: 'btn-danger ms-2' do
          span
            i.fa-regular.fa-trash-can
          | Delete

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
cm-admin-4.4.8 app/views/cm_admin/main/_top_navbar.html.slim
cm-admin-4.4.6 app/views/cm_admin/main/_top_navbar.html.slim
cm-admin-4.4.1 app/views/cm_admin/main/_top_navbar.html.slim
cm-admin-4.4.0 app/views/cm_admin/main/_top_navbar.html.slim
cm-admin-4.3.0 app/views/cm_admin/main/_top_navbar.html.slim
cm-admin-4.2.1 app/views/cm_admin/main/_top_navbar.html.slim
cm-admin-4.2.0 app/views/cm_admin/main/_top_navbar.html.slim