diff --git a/app/views/admin/enterprises/_actions.html.haml b/app/views/admin/enterprises/_actions.html.haml new file mode 100644 index 0000000000..b7abf14a9b --- /dev/null +++ b/app/views/admin/enterprises/_actions.html.haml @@ -0,0 +1,23 @@ += link_to_with_icon('icon-edit', 'Edit Profile', main_app.edit_admin_enterprise_path(enterprise), class: 'edit') +%br/ += link_to_delete_enterprise enterprise +%br/ +- if enterprise.is_primary_producer + = link_to_with_icon 'icon-dashboard', 'Properties', main_app.admin_enterprise_producer_properties_path(enterprise_id: enterprise.id) + (#{enterprise.producer_properties.count}) + %br/ +- if enterprise.is_distributor + = link_to_with_icon 'icon-chevron-right', 'Payment Methods', spree.admin_payment_methods_path(enterprise_id: enterprise.id) + (#{enterprise.payment_methods.count}) + - if enterprise.payment_methods.count == 0 + %span.icon-exclamation-sign.with-tip{"data-powertip" => "This enterprise has no payment methods", style: "font-size: 16px;color: #DA5354"} + %br/ + = link_to_with_icon 'icon-plane', 'Shipping Methods', spree.admin_shipping_methods_path(enterprise_id: enterprise.id) + (#{enterprise.shipping_methods.count}) + - if enterprise.shipping_methods.count == 0 + %span.icon-exclamation-sign.with-tip{"data-powertip" => "This enterprise has shipping methods", style: "font-size: 16px;color: #DA5354"} + %br/ += link_to_with_icon 'icon-money', 'Enterprise Fees', main_app.admin_enterprise_fees_path(enterprise_id: enterprise.id) +(#{enterprise.enterprise_fees.count}) +- if enterprise.enterprise_fees.count == 0 + %span.icon-warning-sign.with-tip{"data-powertip" => "This enterprise has no fees", style: "font-size: 16px;color: orange"} diff --git a/app/views/admin/enterprises/index.html.haml b/app/views/admin/enterprises/index.html.haml index 42f12e8632..7ab6ea4d0e 100644 --- a/app/views/admin/enterprises/index.html.haml +++ b/app/views/admin/enterprises/index.html.haml @@ -39,29 +39,7 @@ %td= enterprise_form.check_box :visible %td= enterprise.description %td{"data-hook" => "admin_users_index_row_actions"} - = link_to_with_icon('icon-edit', 'Edit Profile', main_app.edit_admin_enterprise_path(enterprise), class: 'edit') - %br/ - = link_to_delete_enterprise enterprise - %br/ - - if enterprise.is_primary_producer - = link_to_with_icon 'icon-dashboard', 'Properties', main_app.admin_enterprise_producer_properties_path(enterprise_id: enterprise.id) - (#{enterprise.producer_properties.count}) - %br/ - - if enterprise.is_distributor - = link_to_with_icon 'icon-chevron-right', 'Payment Methods', spree.admin_payment_methods_path(enterprise_id: enterprise.id) - (#{enterprise.payment_methods.count}) - - if enterprise.payment_methods.count == 0 - %span.icon-exclamation-sign.with-tip{"data-powertip" => "This enterprise has no payment methods", style: "font-size: 16px;color: #DA5354"} - %br/ - = link_to_with_icon 'icon-plane', 'Shipping Methods', spree.admin_shipping_methods_path(enterprise_id: enterprise.id) - (#{enterprise.shipping_methods.count}) - - if enterprise.shipping_methods.count == 0 - %span.icon-exclamation-sign.with-tip{"data-powertip" => "This enterprise has shipping methods", style: "font-size: 16px;color: #DA5354"} - %br/ - = link_to_with_icon 'icon-money', 'Enterprise Fees', main_app.admin_enterprise_fees_path(enterprise_id: enterprise.id) - (#{enterprise.enterprise_fees.count}) - - if enterprise.enterprise_fees.count == 0 - %span.icon-warning-sign.with-tip{"data-powertip" => "This enterprise has no fees", style: "font-size: 16px;color: orange"} + = render 'actions', enterprise: enterprise - if @enterprises.empty? %tr %td{colspan: "4"}= t(:none)