.entity-header .entity-header__info - if cm_admin.method_defined?(:"#{@model.name.underscore}_index_path") && (@model.current_action.name == 'show' || @model.current_action.layout_type.present?) .breadcrumb = link_to "#{@model.name.titleize.pluralize} /", cm_admin.send(:"#{@model.name.underscore}_index_path"), class: 'text-reset' h4 = action_title - if @model.current_action.page_description p.mb-0.text-body-secondary = @model.current_action.page_description .entity-header__actions - if @model.current_action.name == 'index' - if has_valid_policy(@ar_object, :exportable) .export-container .dropdown button.btn-secondary.dropdown-toggle data-bs-toggle='dropdown' i.fa.fa-arrow-down | Export ul.dropdown-menu.export-popup li .popup-option.pointer data-bs-toggle='modal' data-bs-target='#exportmodal' span Export - if @model.importer && has_valid_policy(@ar_object, :importable) = link_to 'Import', cm_admin.send(:"#{@model.name.underscore}_import_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(:"#{@model.name.underscore}_new_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(:"#{@model.name.underscore}_edit_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