Replace old dropdown controller by new one

- menu items line are unchanged only beggining of file modified
This commit is contained in:
cyrillefr
2024-02-25 16:33:29 +01:00
parent 884d6f15ff
commit 428b9b273c
2 changed files with 35 additions and 35 deletions

View File

@@ -3,23 +3,22 @@
%span{ "data-controller": "checked-feedback", "data-checked-feedback-translation-value": "spree.admin.orders.index.selected" }
= t("spree.admin.orders.index.selected", count: 0)
%div.plain.ofn-drop-down.disabled{ "data-checked-target": "disable", "data-controller": "dropdown", "data-action": "click->dropdown#toggle" }
%span{ class: 'icon-reorder' }
="#{t('admin.actions')}".html_safe
%span
%i{ "data-dropdown-target": "arrow", "data-expanded-class": "icon-caret-up", "data-collapsed-class": "icon-caret-down" }
%div.menu{ "data-dropdown-target": "menu" }
%div.menu_item
%span.name{ "data-controller": "modal-link", "data-action": "click->modal-link#open", "data-modal-link-target-value": "resend_confirmation" }
= t('spree.admin.orders.index.resend_confirmation')
- if Spree::Config[:enable_invoices?]
%div.plain.ofn-drop-down.disabled{ "data-checked-target": "disable" }
%details{"data-controller": "dropdown"}
%summary
%span.icon-reorder
="#{t('admin.actions')}".html_safe
%div.menu{"data-action": "click->dropdown#closeOnMenu"}
%div.menu_item
%span.name{ "data-controller": "modal-link", "data-action": "click->modal-link#open", "data-modal-link-target-value": "send_invoice" }
= t('spree.admin.orders.index.send_invoice')
%span.name{ "data-controller": "modal-link", "data-action": "click->modal-link#open", "data-modal-link-target-value": "resend_confirmation" }
= t('spree.admin.orders.index.resend_confirmation')
- if Spree::Config[:enable_invoices?]
%div.menu_item
%span.name{ "data-controller": "modal-link", "data-action": "click->modal-link#open", "data-modal-link-target-value": "send_invoice" }
= t('spree.admin.orders.index.send_invoice')
%div.menu_item
%span.name{ "data-controller": "bulk-actions", "data-action": "click->bulk-actions#perform", "data-bulk-actions-reflex-value": "Admin::Orders#bulk_invoice" }
= t('spree.admin.orders.index.print_invoices')
%div.menu_item
%span.name{ "data-controller": "bulk-actions", "data-action": "click->bulk-actions#perform", "data-bulk-actions-reflex-value": "Admin::Orders#bulk_invoice" }
= t('spree.admin.orders.index.print_invoices')
%div.menu_item
%span.name{ "data-controller": "modal-link", "data-action": "click->modal-link#open", "data-modal-link-target-value": "cancel_orders" }
= t('spree.admin.orders.index.cancel_orders')
%span.name{ "data-controller": "modal-link", "data-action": "click->modal-link#open", "data-modal-link-target-value": "cancel_orders" }
= t('spree.admin.orders.index.cancel_orders')

View File

@@ -1,20 +1,21 @@
%li.links-dropdown#links-dropdown
.ofn-drop-down{"data-controller": "dropdown", "data-action": "click->dropdown#toggle" }
%span
%i.icon-check
= I18n.t 'admin.actions'
%i{ "data-dropdown-target": "arrow", "data-expanded-class": "icon-caret-up", "data-collapsed-class": "icon-caret-down" }
%div.menu.hidden{"data-dropdown-target": "menu"}
- order_links(@order).each do |link|
- if link[:name] == t(:ship_order)
%a.menu_item{ href: link[:url], target: link[:target] || "_self", data: { "modal-link-target-value": dom_id(@order, :ship), "action": "click->modal-link#open", "controller": "modal-link" } }
%span
%i{ class: link[:icon] }
%span=link[:name]
- else
%a.menu_item{ href: link[:url], target: link[:target] || "_self", data: { method: link[:method], "ujs-navigate": link[:method] ? "false" : "undefined", confirm: link[:confirm] } }
%span
%i{ class: link[:icon] }
%span=link[:name]
.ofn-drop-down
%details{"data-controller": "dropdown"}
%summary
%span
%i.icon-check
= I18n.t 'admin.actions'
%div.menu{"data-action": "click->dropdown#closeOnMenu"}
- order_links(@order).each do |link|
- if link[:name] == t(:ship_order)
%a.menu_item{ href: link[:url], target: link[:target] || "_self", data: { "modal-link-target-value": dom_id(@order, :ship), "action": "click->modal-link#open", "controller": "modal-link" } }
%span
%i{ class: link[:icon] }
%span=link[:name]
- else
%a.menu_item{ href: link[:url], target: link[:target] || "_self", data: { method: link[:method], "ujs-navigate": link[:method] ? "false" : "undefined", confirm: link[:confirm] } }
%span
%i{ class: link[:icon] }
%span=link[:name]
= render 'spree/admin/shared/custom-confirm'