From 7a3b4d394bd1a98c148e5fa1f428ae7e43f87548 Mon Sep 17 00:00:00 2001 From: Cillian O'Ruanaidh Date: Fri, 22 Aug 2025 15:04:39 +0100 Subject: [PATCH] Replace inline-alert angular directive --- .../darkswarm/directives/inline_alert.js.coffee | 7 ------- app/views/registration/steps/_about.html.haml | 4 ++-- app/views/spree/shared/_order_details.html.haml | 4 ++-- 3 files changed, 4 insertions(+), 11 deletions(-) delete mode 100644 app/assets/javascripts/darkswarm/directives/inline_alert.js.coffee diff --git a/app/assets/javascripts/darkswarm/directives/inline_alert.js.coffee b/app/assets/javascripts/darkswarm/directives/inline_alert.js.coffee deleted file mode 100644 index 217a82b35b..0000000000 --- a/app/assets/javascripts/darkswarm/directives/inline_alert.js.coffee +++ /dev/null @@ -1,7 +0,0 @@ -angular.module('Darkswarm').directive "ofnInlineAlert", -> - restrict: 'A' - scope: true - link: (scope, elem, attrs) -> - scope.visible = true - scope.close = -> - scope.visible = false diff --git a/app/views/registration/steps/_about.html.haml b/app/views/registration/steps/_about.html.haml index 9a18dbd55a..4265fc148f 100644 --- a/app/views/registration/steps/_about.html.haml +++ b/app/views/registration/steps/_about.html.haml @@ -13,10 +13,10 @@ %form{ name: 'about', novalidate: true, "ng-controller": "RegistrationFormCtrl", "ng-submit": "selectIfValid('images', about)" } .row .small-12.columns - .alert-box.info{ "ofn-inline-alert": true, "ng-show": "visible" } + .alert-box.info{ "data-controller": "toggle-control", "data-toggle-control-target": "content", style: "display: block;" } %h6{ "ng-bind" => "'registration.steps.about.success' | t:{enterprise: enterprise.name}" } %span= t(".registration_exit_message") - %a.close{ "ng-click": "close()" } × + %a.close{ "data-action": "toggle-control#toggleDisplay" } × .small-12.large-8.columns .row diff --git a/app/views/spree/shared/_order_details.html.haml b/app/views/spree/shared/_order_details.html.haml index de68929af7..0038ea7309 100644 --- a/app/views/spree/shared/_order_details.html.haml +++ b/app/views/spree/shared/_order_details.html.haml @@ -42,9 +42,9 @@ .row .columns.large-12 - if order.changes_allowed? - .alert-box.order-summary{ "ofn-inline-alert" => true, "ng-show" => "visible" } + .alert-box.order-summary{ "data-controller": "toggle-control", "data-toggle-control-target": "content", style: "display: block;" } = t(:orders_changeable_orders_alert_html, oc_close: l(order.order_cycle.orders_close_at, format: "%b %d, %Y %H:%M")) - %a.close{ "ng-click" => "close()" } × + %a.close{ "data-action": "toggle-control#toggleDisplay" } × = form_for order, url: main_app.order_path(order), html: {id: 'update-order', name: 'update_order_form' } do |order_form| - if order.changes_allowed?