diff --git a/app/assets/javascripts/templates/active_selector.html.haml b/app/assets/javascripts/templates/active_selector.html.haml index 87fb066636..3dba975f27 100644 --- a/app/assets/javascripts/templates/active_selector.html.haml +++ b/app/assets/javascripts/templates/active_selector.html.haml @@ -1,3 +1,2 @@ -%li{ ng: { class: "{active: selector.active}" } } - %a{ "tooltip" => "{{selector.object.value}}", "tooltip-placement" => "bottom", - ng: { transclude: true, class: "{active: selector.active, 'has-tip': selector.object.value}" } } +%li{ "ng-class" => "{active: selector.active}" } + %a{ "tooltip" => "{{selector.object.value}}", "tooltip-placement" => "bottom", "ng-transclude" => true, "ng-class" => "{active: selector.active, 'has-tip': selector.object.value}" } diff --git a/app/assets/javascripts/templates/admin/alert_row.html.haml b/app/assets/javascripts/templates/admin/alert_row.html.haml index c1dfe45c6f..d2323ace55 100644 --- a/app/assets/javascripts/templates/admin/alert_row.html.haml +++ b/app/assets/javascripts/templates/admin/alert_row.html.haml @@ -1,8 +1,8 @@ -.sixteen.columns.alpha.omega.alert-row{ ng: { show: '!dismissed' } } +.sixteen.columns.alpha.omega.alert-row{ "ng-show" => '!dismissed' } .fifteen.columns.pad.alpha - %span.message.text-big{ ng: { bind: 'message'} } + %span.message.text-big{ "ng-bind" => 'message' }     - %input{ type: 'button', ng: { value: "buttonText", show: 'buttonText && buttonAction', click: "buttonAction()" } } + %input{ "type" => 'button', "ng-value" => "buttonText", "ng-show" => 'buttonText && buttonAction', "ng-click" => "buttonAction()" } .one.column.omega.pad.text-center - %a.close{ href: "#", ng: { click: "dismiss()" } } + %a.close{ "href" => "#", "ng-click" => "dismiss()" } × diff --git a/app/assets/javascripts/templates/admin/columns_dropdown.html.haml b/app/assets/javascripts/templates/admin/columns_dropdown.html.haml index 7d6059de4d..fabdb56c91 100644 --- a/app/assets/javascripts/templates/admin/columns_dropdown.html.haml +++ b/app/assets/javascripts/templates/admin/columns_dropdown.html.haml @@ -1,13 +1,13 @@ -.ofn-drop-down.ofn-drop-down-v2.right#columns-dropdown{ ng: { controller: 'ColumnsDropdownCtrl' } } +.ofn-drop-down.ofn-drop-down-v2.right#columns-dropdown{ "ng-controller" => 'ColumnsDropdownCtrl' } .ofn-drop-down-label = "  #{t('admin.columns')}".html_safe %span{ 'ng-class' => "expanded && 'icon-caret-up' || !expanded && 'icon-caret-down'" } %div.menu{ 'ng-show' => "expanded" } .menu_items - .menu_item{ ng: { repeat: "column in columns", click: "toggle(column);" } } - %input.redesigned-input{ type: "checkbox", ng: { checked: "column.visible" } } + .menu_item{ "ng-repeat" => "column in columns", "ng-click" => "toggle(column);" } + %input.redesigned-input{ "type" => "checkbox", "ng-checked" => "column.visible" } {{ column.name }} %hr %div.menu_item.text-center - %input.fullwidth.orange{ type: "button", ng: { value: "saved() ? 'Saved': 'Saving'", show: "saved() || saving", disabled: "saved()" } } - %input.fullwidth.red{ type: "button", :value => t('admin.column_save_as_default').html_safe, ng: { show: "!saved() && !saving", click: "saveColumnPreferences(action)"} } + %input.fullwidth.orange{ "type" => "button", "ng-value" => "saved() ? 'Saved': 'Saving'", "ng-show" => "saved() || saving", "ng-disabled" => "saved()" } + %input.fullwidth.red{ "type" => "button", "value" => t('admin.column_save_as_default').html_safe, "ng-show" => "!saved() && !saving", "ng-click" => "saveColumnPreferences(action)" } diff --git a/app/assets/javascripts/templates/admin/confirm_dialog.html.haml b/app/assets/javascripts/templates/admin/confirm_dialog.html.haml index cfd6a011f8..fc1b169213 100644 --- a/app/assets/javascripts/templates/admin/confirm_dialog.html.haml +++ b/app/assets/javascripts/templates/admin/confirm_dialog.html.haml @@ -1,8 +1,8 @@ -#confirm-dialog{ ng: { class: "dialog_class" } } +#confirm-dialog{ "ng-class" => "dialog_class" } .message.clearfix.margin-bottom-30 .icon.text-center %i.icon-question-sign - .text{ ng: { bind: "::message" } } + .text{ "ng-bind" => "::message" } .action-buttons.text-center - %button.cancel{ ng: { click: "close()", bind: "::cancelText" } } - %button.confirm.red{ ng: { click: "confirm()", bind: "::confirmText" } } + %button.cancel{ "ng-click" => "close()", "ng-bind" => "::cancelText" } + %button.confirm.red{ "ng-click" => "confirm()", "ng-bind" => "::confirmText" } diff --git a/app/assets/javascripts/templates/admin/edit_address_dialog.html.haml b/app/assets/javascripts/templates/admin/edit_address_dialog.html.haml index 4dd6f53aec..2d7eeba793 100644 --- a/app/assets/javascripts/templates/admin/edit_address_dialog.html.haml +++ b/app/assets/javascripts/templates/admin/edit_address_dialog.html.haml @@ -1,12 +1,12 @@ #edit-address-dialog %h2 {{ addressType === 'bill_address' ? "#{t('admin.customers.index.edit_bill_address')}" : "#{t('admin.customers.index.edit_ship_address')}" }} - %form{ name: 'edit_address_form', novalidate: true, ng: { submit: 'updateAddress()'}} + %form{ "name" => 'edit_address_form', "novalidate" => true, "ng-submit" => 'updateAddress()' } .row {{ 'admin.customers.index.required_fileds' | t }} ( %span.required * ) - .error{ ng: { repeat: "error in errors", bind: "error" } } + .error{ "ng-repeat" => "error in errors", "ng-bind" => "error" } %table.no-borders %tr @@ -14,61 +14,55 @@ {{ 'first_name' | t }} %span.required * %td - %input{ type: 'text', name: 'firstname', required: true, ng: { model: 'address.firstname'} } + %input{ "type" => 'text', "name" => 'firstname', "required" => true, "ng-model" => 'address.firstname' } %tr %td {{ 'last_name' | t }} %span.required * %td - %input{ type: 'text', name: 'lastname', required: true, ng: { model: 'address.lastname'} } + %input{ "type" => 'text', "name" => 'lastname', "required" => true, "ng-model" => 'address.lastname' } %tr %td {{ 'address' | t }} %span.required * %td - %input{ type: 'text', name: 'address1', required: true, ng: { model: 'address.address1'} } + %input{ "type" => 'text', "name" => 'address1', "required" => true, "ng-model" => 'address.address1' } %tr %td {{ 'address2' | t }} %td - %input{ type: 'text', name: 'address2', ng: { model: 'address.address2'} } + %input{ "type" => 'text', "name" => 'address2', "ng-model" => 'address.address2' } %tr %td {{ 'city' | t }} %span.required * %td - %input{ type: 'text', name: 'city', required: true, ng: { model: 'address.city'} } + %input{ "type" => 'text', "name" => 'city', "required" => true, "ng-model" => 'address.city' } %tr %td {{ 'postcode' | t }} %span.required * %td - %input{ type: 'text', name: 'zipcode', required: true, ng: { model: 'address.zipcode'} } + %input{ "type" => 'text', "name" => 'zipcode', "required" => true, "ng-model" => 'address.zipcode' } %tr %td {{ 'country' | t }} %span.required * %td - %input.ofn-select2.fullwidth#country_id{ type: 'number', - name: 'country_id', required: true, - placeholder: "{{ 'admin.customers.index.select_country' | t }}", - data: 'availableCountries', ng: { model: 'address.country_id' } } + %input.ofn-select2.fullwidth#country_id{ "type" => 'number', "name" => 'country_id', "required" => true, "placeholder" => "{{ 'admin.customers.index.select_country' | t }}", "data" => 'availableCountries', "ng-model" => 'address.country_id' } %tr %td {{ 'state' | t }} %span.required * %td - %input.ofn-select2.fullwidth#state_id{ type: 'number', - name: 'state_id', required: true, - placeholder: "{{ 'admin.customers.index.select_state' | t }}", - data: 'states', ng: { model: 'address.state_id' } } + %input.ofn-select2.fullwidth#state_id{ "type" => 'number', "name" => 'state_id', "required" => true, "placeholder" => "{{ 'admin.customers.index.select_state' | t }}", "data" => 'states', "ng-model" => 'address.state_id' } %tr %td {{ 'phone' | t }} %span.required * %td - %input{ type: 'text', name: 'phone', required: true, ng: { model: 'address.phone'} } + %input{ "type" => 'text', "name" => 'phone', "required" => true, "ng-model" => 'address.phone' } .text-center %input.button.red.icon-plus{ type: 'submit', value: t('admin.customers.index.update_address')} diff --git a/app/assets/javascripts/templates/admin/info_dialog.html.haml b/app/assets/javascripts/templates/admin/info_dialog.html.haml index b69e3b0a4f..17d443e87b 100644 --- a/app/assets/javascripts/templates/admin/info_dialog.html.haml +++ b/app/assets/javascripts/templates/admin/info_dialog.html.haml @@ -1,9 +1,9 @@ -#info-dialog{ ng: { class: "dialog_class" } } +#info-dialog{ "ng-class" => "dialog_class" } .message.clearfix.margin-bottom-30 .icon.text-center - %i{ ng: { class: "icon_class" } } + %i{ "ng-class" => "icon_class" } .text {{ message }} .action-buttons.text-center - %button{ ng: { click: "close()" } } + %button{ "ng-click" => "close()" } = t(:ok) diff --git a/app/assets/javascripts/templates/admin/modals/bulk_invoice.html.haml b/app/assets/javascripts/templates/admin/modals/bulk_invoice.html.haml index 4c3fd55488..8cb89d7976 100644 --- a/app/assets/javascripts/templates/admin/modals/bulk_invoice.html.haml +++ b/app/assets/javascripts/templates/admin/modals/bulk_invoice.html.haml @@ -1,15 +1,15 @@ %h4.modal-title = t('js.admin.orders.index.compiling_invoices') -%p.message{ ng: { show: 'message' } } +%p.message{ "ng-show" => 'message' } {{message}} -%p.error{ ng: { show: 'error' } } +%p.error{ "ng-show" => 'error' } {{error}} -%img.spinner{ src: image_path("/spinning-circles.svg"), ng: { show: "loading" } } -%p{ ng: { show: "loading" } } +%img.spinner{ "src" => image_path("/spinning-circles.svg"), "ng-show" => "loading" } +%p{ "ng-show" => "loading" } = t('js.admin.orders.index.please_wait') -%a.button{ target: '_blank', ng: { click: 'showBulkInvoice()', href: '/admin/orders/invoices/{{invoice_id}}', show: "!loading && !error" } } +%a.button{ "target" => '_blank', "ng-click" => 'showBulkInvoice()', "ng-href" => '/admin/orders/invoices/{{invoice_id}}', "ng-show" => "!loading && !error" } = t('js.admin.orders.index.view_file') diff --git a/app/assets/javascripts/templates/admin/modals/image_upload.html.haml b/app/assets/javascripts/templates/admin/modals/image_upload.html.haml index 28d01d8ada..a1b5141d89 100644 --- a/app/assets/javascripts/templates/admin/modals/image_upload.html.haml +++ b/app/assets/javascripts/templates/admin/modals/image_upload.html.haml @@ -1,10 +1,10 @@ %a.close-reveal-modal{"ng-click" => "$close()"} %i.fa.fa-times-circle{'aria-hidden' => "true"} -%form#image_upload{ name: 'form', novalidate: true, enctype: 'multipart/form-data', multipart: true, ng: { controller: "ProductImageCtrl" } } +%form#image_upload{ "name" => 'form', "novalidate" => true, "enctype" => 'multipart/form-data', "multipart" => true, "ng-controller" => "ProductImageCtrl" } %div.image-preview - %img.spinner{ src: image_path("/spinning-circles.svg"), ng: { hide: "!imageUploader.isUploading" }} - %img.preview{ng: {src: "{{imagePreview}}", class: "{'faded': imageUploader.isUploading}"}} + %img.spinner{ "src" => image_path("/spinning-circles.svg"), "ng-hide" => "!imageUploader.isUploading" } + %img.preview{ "ng-src" => "{{imagePreview}}", "ng-class" => "{'faded': imageUploader.isUploading}" } %label{for: 'image-upload', class: 'button'} {{ 'admin.products.index.upload_an_image' | t }} %input#image-upload{hidden: true, type: 'file', 'nv-file-select' => true, uploader: "imageUploader"} diff --git a/app/assets/javascripts/templates/admin/new_customer_dialog.html.haml b/app/assets/javascripts/templates/admin/new_customer_dialog.html.haml index 9cdcb97713..cc68790124 100644 --- a/app/assets/javascripts/templates/admin/new_customer_dialog.html.haml +++ b/app/assets/javascripts/templates/admin/new_customer_dialog.html.haml @@ -2,14 +2,14 @@ .text-normal.margin-bottom-30.text-center {{ 'js.admin.customers.index.add_a_new_customer_for' | t:{ shop_name: CurrentShop.shop.name } }} - %form{ name: 'new_customer_form', novalidate: true, ng: { submit: "addCustomer()" }} + %form{ "name" => 'new_customer_form', "novalidate" => true, "ng-submit" => "addCustomer()" } .text-center.margin-bottom-30 - %input.fullwidth{ type: 'email', name: 'email', required: true, placeholder: "{{ 'js.admin.customers.index.customer_placeholder' | t }}", ng: { model: "email" } } - %div{ ng: { show: "submitted && new_customer_form.$pristine" } } - .error{ ng: { show: "(new_customer_form.email.$error.email || new_customer_form.email.$error.required)" } } + %input.fullwidth{ "type" => 'email', "name" => 'email', "required" => true, "placeholder" => "{{ 'js.admin.customers.index.customer_placeholder' | t }}", "ng-model" => "email" } + %div{ "ng-show" => "submitted && new_customer_form.$pristine" } + .error{ "ng-show" => "(new_customer_form.email.$error.email || new_customer_form.email.$error.required)" } {{ 'js.admin.customers.index.valid_email_error' | t }} - .error{ ng: { repeat: "error in errors", bind: "error" } } + .error{ "ng-repeat" => "error in errors", "ng-bind" => "error" } .text-center %input.button.red.icon-plus{ type: 'submit', value: "{{ 'js.admin.customers.index.add_customer' | t }}" } diff --git a/app/assets/javascripts/templates/admin/new_tag_rule_dialog.html.haml b/app/assets/javascripts/templates/admin/new_tag_rule_dialog.html.haml index 50d61d3563..9030ee074b 100644 --- a/app/assets/javascripts/templates/admin/new_tag_rule_dialog.html.haml +++ b/app/assets/javascripts/templates/admin/new_tag_rule_dialog.html.haml @@ -4,7 +4,7 @@ .text-center.margin-bottom-30 -# %select.fullwidth{ 'select2-min-search' => 5, 'ng-model' => 'newRuleType', 'ng-options' => 'ruleType.id as ruleType.name for ruleType in availableRuleTypes' } - %input.ofn-select2.fullwidth{ :id => 'rule_type_selector', ng: { model: "ruleType" }, data: "ruleTypes", 'min-search' => "5" } + %input.ofn-select2.fullwidth{ "id" => 'rule_type_selector', "data" => "ruleTypes", "min-search" => "5", "ng-model" => "ruleType" } .text-center - %input.button.red.icon-plus{ type: 'button', value: "{{ 'js.admin.new_tag_rule_dialog.add_rule' | t }}", ng: { click: 'addRule(tagGroup, ruleType)' } } + %input.button.red.icon-plus{ "type" => 'button', "value" => "{{ 'js.admin.new_tag_rule_dialog.add_rule' | t }}", "ng-click" => 'addRule(tagGroup, ruleType)' } diff --git a/app/assets/javascripts/templates/admin/order_cycles_selector.html.haml b/app/assets/javascripts/templates/admin/order_cycles_selector.html.haml index a0b9e7776c..a26f155f7c 100644 --- a/app/assets/javascripts/templates/admin/order_cycles_selector.html.haml +++ b/app/assets/javascripts/templates/admin/order_cycles_selector.html.haml @@ -3,16 +3,16 @@ %td#available-order-cycles {{ 'js.admin.order_cycles.schedules.available' | t }} .order-cycles - .order-cycle{ ng: { repeat: 'orderCycle in orderCycles | available:selectedOrderCycles as availableOrderCycles', click: 'selections.available = orderCycle', dblclick: 'add(orderCycle)', class: '{selected: selections.available == orderCycle}' } } + .order-cycle{ "ng-repeat" => 'orderCycle in orderCycles | available:selectedOrderCycles as availableOrderCycles', "ng-click" => 'selections.available = orderCycle', "ng-dblclick" => 'add(orderCycle)', "ng-class" => '{selected: selections.available == orderCycle}' } {{ orderCycle.name }} %td#add-remove-buttons - %a.add.button{ href: 'javascript:void(0)', ng: { click: 'add()' } } + %a.add.button{ "href" => 'javascript:void(0)', "ng-click" => 'add()' } %i.icon-chevron-right - %a.remove.button{ href: 'javascript:void(0)', ng: { click: 'remove()' } } + %a.remove.button{ "href" => 'javascript:void(0)', "ng-click" => 'remove()' } %i.icon-chevron-left %td#selected-order-cycles {{ 'js.admin.order_cycles.schedules.selected' | t }} .order-cycles - .order-cycle{ ng: { repeat: 'orderCycle in selectedOrderCycles', click: 'selections.selected = orderCycle', dblclick: 'remove(orderCycle)', class: '{selected: selections.selected == orderCycle}' } } + .order-cycle{ "ng-repeat" => 'orderCycle in selectedOrderCycles', "ng-click" => 'selections.selected = orderCycle', "ng-dblclick" => 'remove(orderCycle)', "ng-class" => '{selected: selections.selected == orderCycle}' } {{ orderCycle.name }} -.error{ ng: { repeat: "error in errors", bind: "error" } } +.error{ "ng-repeat" => "error in errors", "ng-bind" => "error" } diff --git a/app/assets/javascripts/templates/admin/panel.html.haml b/app/assets/javascripts/templates/admin/panel.html.haml index 4d3780aed0..514a943264 100644 --- a/app/assets/javascripts/templates/admin/panel.html.haml +++ b/app/assets/javascripts/templates/admin/panel.html.haml @@ -1,2 +1,2 @@ -%td{ colspan: "{{columnCount}}", ng: { if: "template" } } - .panel{ ng: { include: "template" } } +%td{ "colspan" => "{{columnCount}}", "ng-if" => "template" } + .panel{ "ng-include" => "template" } diff --git a/app/assets/javascripts/templates/admin/panels/enterprise_package.html.haml b/app/assets/javascripts/templates/admin/panels/enterprise_package.html.haml index 4ef49a3bc0..c882b3bf2a 100644 --- a/app/assets/javascripts/templates/admin/panels/enterprise_package.html.haml +++ b/app/assets/javascripts/templates/admin/panels/enterprise_package.html.haml @@ -1,7 +1,7 @@ -.row.enterprise_package_panel{ ng: { controller: 'indexPackagePanelCtrl' } } +.row.enterprise_package_panel{ "ng-controller" => 'indexPackagePanelCtrl' } .alpha.eight.columns - %div{ ng: { if: "!enterprise.is_primary_producer", switch: "enterprise.sells" } } - .info{ ng: { switch: { when: "none" } } } + %div{ "ng-if" => "!enterprise.is_primary_producer", "ng-switch" => "enterprise.sells" } + .info{ "ng-switch-when" => "none" } %h3 {{ 'js.admin.panels.enterprise_package.hub_profile' | t }} @@ -15,7 +15,7 @@ %p {{ 'js.admin.panels.enterprise_package.hub_profile_text2' | t }} - .info{ ng: { switch: { when: "any" } } } + .info{ "ng-switch-when" => "any" } %h3 {{ 'js.admin.panels.enterprise_package.hub_shop' | t }} @@ -28,7 +28,7 @@ %p {{ 'js.admin.panels.enterprise_package.hub_shop_text3' | t }} - .info{ ng: { switch: { default: true } } } + .info{ "ng-switch-default" => true } %h3 {{ 'js.admin.panels.enterprise_package.choose_package' | t }} %i.icon-arrow-right @@ -40,8 +40,8 @@ %p {{ 'js.admin.panels.enterprise_package.choose_package_text2' | t }} - %div{ ng: { if: "enterprise.is_primary_producer", switch: "enterprise.sells" } } - .info{ ng: { switch: { when: "none" } } } + %div{ "ng-if" => "enterprise.is_primary_producer", "ng-switch" => "enterprise.sells" } + .info{ "ng-switch-when" => "none" } %h3 {{ 'js.admin.panels.enterprise_package.profile_only' | t }} @@ -58,7 +58,7 @@ %p {{ 'js.admin.panels.enterprise_package.profile_only_text3' | t }} - .info{ ng: { switch: { when: "own" } } } + .info{ "ng-switch-when" => "own" } %h3 {{ 'js.admin.panels.enterprise_package.producer_shop' | t }} @@ -68,7 +68,7 @@ %p {{ 'js.admin.panels.enterprise_package.producer_shop_text2' | t }} - .info{ ng: { switch: { when: "any" } } } + .info{ "ng-switch-when" => "any" } %h3 {{ 'js.admin.panels.enterprise_package.producer_hub' | t }} @@ -81,7 +81,7 @@ %p {{ 'js.admin.panels.enterprise_package.producer_hub_text3' | t }} - .info{ ng: { switch: { default: true } } } + .info{ "ng-switch-default" => true } %h3 {{ 'js.admin.panels.enterprise_package.choose_package' | t }} %i.icon-arrow-right @@ -93,9 +93,9 @@ %p {{ 'js.admin.panels.enterprise_package.choose_package_text2' | t }} - .omega.eight.columns{ ng: { switch: "enterprise.is_primary_producer" } } - %div{ ng: { switch: { when: "false" } } } - %a.button.selector.hub-profile{ ng: { click: "enterprise.owned && (enterprise.sells='none')", class: "{selected: enterprise.sells=='none', disabled: !enterprise.owned}" } } + .omega.eight.columns{ "ng-switch" => "enterprise.is_primary_producer" } + %div{ "ng-switch-when" => "false" } + %a.button.selector.hub-profile{ "ng-click" => "enterprise.owned && (enterprise.sells='none')", "ng-class" => "{selected: enterprise.sells=='none', disabled: !enterprise.owned}" } .top %h3 {{ 'js.admin.panels.enterprise_package.profile_only' | t }} @@ -103,15 +103,15 @@ {{ 'js.admin.panels.enterprise_package.get_listing' | t }} .bottom {{ 'js.admin.panels.enterprise_package.always_free' | t }} - %a.button.selector.hub{ ng: { click: "enterprise.owned && (enterprise.sells='any')", class: "{selected: enterprise.sells=='any', disabled: !enterprise.owned}" } } + %a.button.selector.hub{ "ng-click" => "enterprise.owned && (enterprise.sells='any')", "ng-class" => "{selected: enterprise.sells=='any', disabled: !enterprise.owned}" } .top %h3 {{ 'js.admin.panels.enterprise_package.hub_shop' | t }} %p {{ 'js.admin.panels.enterprise_package.sell_produce_others' | t }} - %div{ ng: { switch: { when: "true" } } } - %a.button.selector.producer-profile{ ng: { click: "enterprise.owned && (enterprise.sells='none')", class: "{selected: enterprise.sells=='none', disabled: !enterprise.owned}" } } + %div{ "ng-switch-when" => "true" } + %a.button.selector.producer-profile{ "ng-click" => "enterprise.owned && (enterprise.sells='none')", "ng-class" => "{selected: enterprise.sells=='none', disabled: !enterprise.owned}" } .top %h3 {{ 'js.admin.panels.enterprise_package.profile_only' | t }} @@ -119,27 +119,27 @@ {{ 'js.admin.panels.enterprise_package.get_listing' | t }} .bottom {{ 'js.admin.panels.enterprise_package.always_free' | t }} - %a.button.selector.producer-shop{ ng: { click: "enterprise.owned && (enterprise.sells='own')", class: "{selected: enterprise.sells=='own', disabled: !enterprise.owned}" } } + %a.button.selector.producer-shop{ "ng-click" => "enterprise.owned && (enterprise.sells='own')", "ng-class" => "{selected: enterprise.sells=='own', disabled: !enterprise.owned}" } .top %h3 {{ 'js.admin.panels.enterprise_package.producer_shop' | t }} %p {{ 'js.admin.panels.enterprise_package.sell_own_produce' | t }} - %a.button.selector.producer-hub{ ng: { click: "enterprise.owned && (enterprise.sells='any')", class: "{selected: enterprise.sells=='any', disabled: !enterprise.owned}" } } + %a.button.selector.producer-hub{ "ng-click" => "enterprise.owned && (enterprise.sells='any')", "ng-class" => "{selected: enterprise.sells=='any', disabled: !enterprise.owned}" } .top %h3 {{ 'js.admin.panels.enterprise_package.producer_hub' | t }} %p {{ 'js.admin.panels.enterprise_package.sell_both' | t }} - %a.button.update.fullwidth{ ng: { show: "enterprise.owned", class: "{disabled: saved() && !saving, saving: saving}", click: "save()" } } - %span{ ng: {hide: "saved() || saving" } } + %a.button.update.fullwidth{ "ng-show" => "enterprise.owned", "ng-class" => "{disabled: saved() && !saving, saving: saving}", "ng-click" => "save()" } + %span{ "ng-hide" => "saved() || saving" } {{ 'js.admin.panels.save' | t }} %i.icon-save - %span{ ng: {show: "saved() && !saving" } } + %span{ "ng-show" => "saved() && !saving" } {{ 'js.admin.panels.saved' | t }} %i.icon-ok-sign - %span{ ng: {show: "saving" } } + %span{ "ng-show" => "saving" } {{ 'js.admin.panels.saving' | t }} %i.icon-refresh diff --git a/app/assets/javascripts/templates/admin/panels/enterprise_producer.html.haml b/app/assets/javascripts/templates/admin/panels/enterprise_producer.html.haml index b1f022420d..ec868ebf86 100644 --- a/app/assets/javascripts/templates/admin/panels/enterprise_producer.html.haml +++ b/app/assets/javascripts/templates/admin/panels/enterprise_producer.html.haml @@ -1,6 +1,6 @@ -.row.enterprise_producer_panel{ ng: { controller: 'indexProducerPanelCtrl' } } +.row.enterprise_producer_panel{ "ng-controller" => 'indexProducerPanelCtrl' } .alpha.eight.columns - .info{ ng: { show: "enterprise.is_primary_producer==true" } } + .info{ "ng-show" => "enterprise.is_primary_producer==true" } %h3 {{ 'js.admin.panels.enterprise_producer.producer' | t }} %p @@ -8,7 +8,7 @@ %p {{ 'js.admin.panels.enterprise_producer.producer_text2' | t }} - .info{ ng: { show: "enterprise.is_primary_producer==false" } } + .info{ "ng-show" => "enterprise.is_primary_producer==false" } %h3 {{ 'js.admin.panels.enterprise_producer.non_producer' | t }} %p @@ -17,7 +17,7 @@ {{ 'js.admin.panels.enterprise_producer.non_producer_text2' | t }} .omega.eight.columns - %a.button.selector.producer{ ng: { click: 'enterprise.owned && changeToProducer()', class: "{selected: enterprise.is_primary_producer==true, disabled: !enterprise.owned}" } } + %a.button.selector.producer{ "ng-click" => 'enterprise.owned && changeToProducer()', "ng-class" => "{selected: enterprise.is_primary_producer==true, disabled: !enterprise.owned}" } .top %h3 {{ 'js.admin.panels.enterprise_producer.producer' | t }} @@ -26,7 +26,7 @@ .bottom {{ 'js.admin.panels.enterprise_producer.producer_example' | t }} - %a.button.selector.non-producer{ ng: { click: 'enterprise.owned && changeToNonProducer()', class: "{selected: enterprise.is_primary_producer==false, disabled: !enterprise.owned}" } } + %a.button.selector.non-producer{ "ng-click" => 'enterprise.owned && changeToNonProducer()', "ng-class" => "{selected: enterprise.is_primary_producer==false, disabled: !enterprise.owned}" } .top %h3 {{ 'js.admin.panels.enterprise_producer.non_producer' | t }} @@ -35,13 +35,13 @@ .bottom {{ 'js.admin.panels.enterprise_producer.non_producer_example' | t }} - %a.button.update.fullwidth{ ng: { show: "enterprise.owned", class: "{disabled: saved() && !saving, saving: saving}", click: "save()" } } - %span{ ng: {hide: "saved() || saving" } } + %a.button.update.fullwidth{ "ng-show" => "enterprise.owned", "ng-class" => "{disabled: saved() && !saving, saving: saving}", "ng-click" => "save()" } + %span{ "ng-hide" => "saved() || saving" } {{ 'js.admin.panels.save' | t }} %i.icon-save - %span{ ng: {show: "saved() && !saving" } } + %span{ "ng-show" => "saved() && !saving" } {{ 'js.admin.panels.saved' | t }} %i.icon-ok-sign - %span{ ng: {show: "saving" } } + %span{ "ng-show" => "saving" } {{ 'js.admin.panels.saving' | t }} %i.icon-refresh diff --git a/app/assets/javascripts/templates/admin/panels/enterprise_status.html.haml b/app/assets/javascripts/templates/admin/panels/enterprise_status.html.haml index d5022fd26e..325b19f237 100644 --- a/app/assets/javascripts/templates/admin/panels/enterprise_status.html.haml +++ b/app/assets/javascripts/templates/admin/panels/enterprise_status.html.haml @@ -1,10 +1,10 @@ -.row.enterprise_status_panel{ ng: { controller: 'indexStatusPanelCtrl' } } +.row.enterprise_status_panel{ "ng-controller" => 'indexStatusPanelCtrl' } .alpha.omega.sixteen.columns - %h4.status-ok.text-center{ ng: { show: "issues.length == 0 && warnings.length == 0" } } + %h4.status-ok.text-center{ "ng-show" => "issues.length == 0 && warnings.length == 0" } %i.icon-ok-sign {{ 'js.admin.panels.enterprise_status.status_title' | t:{ name: object.name } }} - %table{ ng: { show: "issues.length > 0 || warnings.length > 0" } } + %table{ "ng-show" => "issues.length > 0 || warnings.length > 0" } %thead %th.severity {{ 'js.admin.panels.enterprise_status.severity' | t }} @@ -12,17 +12,17 @@ {{ 'js.admin.panels.enterprise_status.description' | t }} %th.resolve {{ 'js.admin.panels.enterprise_status.resolve' | t }} - %tr{ ng: { repeat: "issue in issues"} } + %tr{ "ng-repeat" => "issue in issues" } %td.severity %i.icon-warning-sign.issue %td.description - %span{ ng: { bind: "::issue.description" } } + %span{ "ng-bind" => "::issue.description" } %td.resolve - %div{ ng: { bind: { html: "issue.link" } } } - %tr{ ng: { repeat: "warning in warnings"} } + %div{ "ng-bind-html" => "issue.link" } + %tr{ "ng-repeat" => "warning in warnings" } %td.severity %i.icon-warning-sign.warning %td.description - %span{ ng: { bind: "::warning.description" } } + %span{ "ng-bind" => "::warning.description" } %td.resolve - %div{ ng: { bind: { html: "warning.link" } } } + %div{ "ng-bind-html" => "warning.link" } diff --git a/app/assets/javascripts/templates/admin/save_bar.html.haml b/app/assets/javascripts/templates/admin/save_bar.html.haml index 08b6da5361..fee020f9c6 100644 --- a/app/assets/javascripts/templates/admin/save_bar.html.haml +++ b/app/assets/javascripts/templates/admin/save_bar.html.haml @@ -1,9 +1,9 @@ -#save-bar.animate-show{ ng: { show: 'dirty || persist || StatusMessage.active()' } } +#save-bar.animate-show{ "ng-show" => 'dirty || persist || StatusMessage.active()' } .container .seven.columns.alpha - %h5#status-message{ ng: { show: "StatusMessage.invalidMessage == ''", style: 'StatusMessage.statusMessage.style' } } + %h5#status-message{ "ng-show" => "StatusMessage.invalidMessage == ''", "ng-style" => 'StatusMessage.statusMessage.style' } {{ StatusMessage.statusMessage.text || " " }} - %h5#status-message{ ng: { show: "StatusMessage.invalidMessage !== ''" }, style: 'color: #C85136' } + %h5#status-message{ "style" => 'color: #C85136', "ng-show" => "StatusMessage.invalidMessage !== ''" } {{ StatusMessage.invalidMessage || " " }} - .nine.columns.omega.text-right{ ng: { transclude: true } } + .nine.columns.omega.text-right{ "ng-transclude" => true } diff --git a/app/assets/javascripts/templates/admin/schedule_dialog.html.haml b/app/assets/javascripts/templates/admin/schedule_dialog.html.haml index 421cf25d42..03d2acd354 100644 --- a/app/assets/javascripts/templates/admin/schedule_dialog.html.haml +++ b/app/assets/javascripts/templates/admin/schedule_dialog.html.haml @@ -1,24 +1,24 @@ #schedule-dialog .text-normal.margin-bottom-30.text-center - %span{ ng: { hide: 'schedule.id' } } + %span{ "ng-hide" => 'schedule.id' } {{ 'js.admin.order_cycles.schedules.adding_a_new_schedule' | t }} - %span{ ng: { show: 'schedule.id' } } + %span{ "ng-show" => 'schedule.id' } {{ 'js.admin.order_cycles.schedules.updating_a_schedule' | t }} - %form{ name: 'schedule_form', novalidate: true, ng: { submit: "submit()" }} + %form{ "name" => 'schedule_form', "novalidate" => true, "ng-submit" => "submit()" } .text-center.margin-bottom-20 - %input.fullwidth{ type: 'text', name: 'name', required: true, placeholder: "{{ 'js.admin.order_cycles.schedules.schedule_name_placeholder' | t }}", ng: { model: "schedule.name" } } - %div{ ng: { show: "submitted && schedule_form.$pristine" } } - .error{ ng: { show: "(schedule_form.name.$error.required)" } } + %input.fullwidth{ "type" => 'text', "name" => 'name', "required" => true, "placeholder" => "{{ 'js.admin.order_cycles.schedules.schedule_name_placeholder' | t }}", "ng-model" => "schedule.name" } + %div{ "ng-show" => "submitted && schedule_form.$pristine" } + .error{ "ng-show" => "(schedule_form.name.$error.required)" } {{ 'js.admin.order_cycles.schedules.name_required_error' | t }} .order-cycles-selector.text-center.margin-bottom-30 .text-center - %input.button{ type: 'submit', value: "{{ 'js.admin.order_cycles.schedules.create_schedule' | t }}", ng: { hide: 'schedule.id' } } - %input.button{ type: 'submit', value: "{{ 'js.admin.order_cycles.schedules.update_schedule' | t }}", ng: { show: 'schedule.id' } } - %span{ ng: { show: 'schedule.id' } } or - %input.button.red{ type: 'button', value: "{{ 'js.admin.order_cycles.schedules.delete_schedule' | t }}", ng: { show: 'schedule.id', click: 'delete()'} } - %input.button{ type: 'button', value: "{{ 'actions.cancel' | t }}", ng: { click: 'close()' } } + %input.button{ "type" => 'submit', "value" => "{{ 'js.admin.order_cycles.schedules.create_schedule' | t }}", "ng-hide" => 'schedule.id' } + %input.button{ "type" => 'submit', "value" => "{{ 'js.admin.order_cycles.schedules.update_schedule' | t }}", "ng-show" => 'schedule.id' } + %span{ "ng-show" => 'schedule.id' } or + %input.button.red{ "type" => 'button', "value" => "{{ 'js.admin.order_cycles.schedules.delete_schedule' | t }}", "ng-show" => 'schedule.id', "ng-click" => 'delete()' } + %input.button{ "type" => 'button', "value" => "{{ 'actions.cancel' | t }}", "ng-click" => 'close()' } diff --git a/app/assets/javascripts/templates/admin/tag.html.haml b/app/assets/javascripts/templates/admin/tag.html.haml index c4afcfa5ad..e093262c67 100644 --- a/app/assets/javascripts/templates/admin/tag.html.haml +++ b/app/assets/javascripts/templates/admin/tag.html.haml @@ -1,8 +1,8 @@ .tag-template %div - %span.tag-with-rules{ ng: { if: "data.rules" }, "ofn-with-tip" => "{{ 'admin.tag_has_rules' | t:{num: data.rules} }}" } + %span.tag-with-rules{ "ofn-with-tip" => "{{ 'admin.tag_has_rules' | t:{num: data.rules} }}", "ng-if" => "data.rules" } {{$getDisplayText()}} - %span{ ng: { if: "!data.rules" } } + %span{ "ng-if" => "!data.rules" } {{$getDisplayText()}} - %a.remove-button{ ng: {click: "$removeTag()"} } + %a.remove-button{ "ng-click" => "$removeTag()" } ✖ diff --git a/app/assets/javascripts/templates/admin/tag_autocomplete.html.haml b/app/assets/javascripts/templates/admin/tag_autocomplete.html.haml index 2b9b3f3f2f..536aaf1177 100644 --- a/app/assets/javascripts/templates/admin/tag_autocomplete.html.haml +++ b/app/assets/javascripts/templates/admin/tag_autocomplete.html.haml @@ -1,11 +1,11 @@ .autocomplete-template - %span.tag-with-rules{ ng: { if: "data.rules" } } + %span.tag-with-rules{ "ng-if" => "data.rules" } {{$getDisplayText()}} - %span.tag-with-rules{ ng: { if: "data.rules == 1" } } + %span.tag-with-rules{ "ng-if" => "data.rules == 1" } — {{ 'admin.has_one_rule' | t }} - %span.tag-with-rules{ ng: { if: "data.rules > 1" } } + %span.tag-with-rules{ "ng-if" => "data.rules > 1" } — {{ 'admin.has_n_rules' | t:{ num: data.rules } }} - %span{ ng: { if: "!data.rules" } } + %span{ "ng-if" => "!data.rules" } {{$getDisplayText()}} diff --git a/app/assets/javascripts/templates/admin/tag_rules/discount_order_input.html.haml b/app/assets/javascripts/templates/admin/tag_rules/discount_order_input.html.haml index abad41ea62..657593b0d3 100644 --- a/app/assets/javascripts/templates/admin/tag_rules/discount_order_input.html.haml +++ b/app/assets/javascripts/templates/admin/tag_rules/discount_order_input.html.haml @@ -1,7 +1,3 @@ %div - %input{ type: "number", - id: "enterprise_tag_rules_attributes_{{tagGroup.startIndex + $index}}_calculator_attributes_preferred_flat_percent", - min: -100, - max: 100, - ng: { model: "rule.calculator.preferred_flat_percent" }, 'invert-number' => true } + %input{ "type" => "number", "id" => "enterprise_tag_rules_attributes_{{tagGroup.startIndex + $index}}_calculator_attributes_preferred_flat_percent", "min" => -100, "max" => 100, "invert-number" => true, "ng-model" => "rule.calculator.preferred_flat_percent" } %span.text-normal % diff --git a/app/assets/javascripts/templates/admin/tag_rules/filter_order_cycles_input.html.haml b/app/assets/javascripts/templates/admin/tag_rules/filter_order_cycles_input.html.haml index 87eddb331e..5a7d497cbd 100644 --- a/app/assets/javascripts/templates/admin/tag_rules/filter_order_cycles_input.html.haml +++ b/app/assets/javascripts/templates/admin/tag_rules/filter_order_cycles_input.html.haml @@ -1,11 +1,5 @@ %div - %input.fullwidth.light.ofn-select2{ id: "enterprise_tag_rules_attributes_{{tagGroup.startIndex + $index}}_preferred_matched_order_cycles_visibility", - name: "enterprise[tag_rules_attributes][{{tagGroup.startIndex + $index}}][preferred_matched_order_cycles_visibility]", - ng: { model: "rule.preferred_matched_order_cycles_visibility", if: "!rule.is_default" }, - data: 'visibilityOptions', "min-search" => 5 } - %input{ type: "hidden", - id: "enterprise_tag_rules_attributes_{{tagGroup.startIndex + $index}}_preferred_matched_order_cycles_visibility", - name: "enterprise[tag_rules_attributes][{{tagGroup.startIndex + $index}}][preferred_matched_order_cycles_visibility]", - ng: { value: "'hidden'", if: "rule.is_default" } } - %span.text-normal{ ng: { if: "rule.is_default" } } + %input.fullwidth.light.ofn-select2{ "id" => "enterprise_tag_rules_attributes_{{tagGroup.startIndex + $index}}_preferred_matched_order_cycles_visibility", "name" => "enterprise[tag_rules_attributes][{{tagGroup.startIndex + $index}}][preferred_matched_order_cycles_visibility]", "data" => 'visibilityOptions', "min-search" => 5, "ng-model" => "rule.preferred_matched_order_cycles_visibility", "ng-if" => "!rule.is_default" } + %input{ "type" => "hidden", "id" => "enterprise_tag_rules_attributes_{{tagGroup.startIndex + $index}}_preferred_matched_order_cycles_visibility", "name" => "enterprise[tag_rules_attributes][{{tagGroup.startIndex + $index}}][preferred_matched_order_cycles_visibility]", "ng-value" => "'hidden'", "ng-if" => "rule.is_default" } + %span.text-normal{ "ng-if" => "rule.is_default" } =t(:not_visible) diff --git a/app/assets/javascripts/templates/admin/tag_rules/filter_payment_methods_input.html.haml b/app/assets/javascripts/templates/admin/tag_rules/filter_payment_methods_input.html.haml index 8151feb677..4c5b3a0c98 100644 --- a/app/assets/javascripts/templates/admin/tag_rules/filter_payment_methods_input.html.haml +++ b/app/assets/javascripts/templates/admin/tag_rules/filter_payment_methods_input.html.haml @@ -1,11 +1,5 @@ %div - %input.fullwidth.light.ofn-select2{ id: "enterprise_tag_rules_attributes_{{tagGroup.startIndex + $index}}_preferred_matched_payment_methods_visibility", - name: "enterprise[tag_rules_attributes][{{tagGroup.startIndex + $index}}][preferred_matched_payment_methods_visibility]", - ng: { model: "rule.preferred_matched_payment_methods_visibility", if: "!rule.is_default" }, - data: 'visibilityOptions', "min-search" => 5 } - %input{ type: "hidden", - id: "enterprise_tag_rules_attributes_{{tagGroup.startIndex + $index}}_preferred_matched_payment_methods_visibility", - name: "enterprise[tag_rules_attributes][{{tagGroup.startIndex + $index}}][preferred_matched_payment_methods_visibility]", - ng: { value: "'hidden'", if: "rule.is_default" } } - %span.text-normal{ ng: { if: "rule.is_default" } } + %input.fullwidth.light.ofn-select2{ "id" => "enterprise_tag_rules_attributes_{{tagGroup.startIndex + $index}}_preferred_matched_payment_methods_visibility", "name" => "enterprise[tag_rules_attributes][{{tagGroup.startIndex + $index}}][preferred_matched_payment_methods_visibility]", "data" => 'visibilityOptions', "min-search" => 5, "ng-model" => "rule.preferred_matched_payment_methods_visibility", "ng-if" => "!rule.is_default" } + %input{ "type" => "hidden", "id" => "enterprise_tag_rules_attributes_{{tagGroup.startIndex + $index}}_preferred_matched_payment_methods_visibility", "name" => "enterprise[tag_rules_attributes][{{tagGroup.startIndex + $index}}][preferred_matched_payment_methods_visibility]", "ng-value" => "'hidden'", "ng-if" => "rule.is_default" } + %span.text-normal{ "ng-if" => "rule.is_default" } = t(:not_visible) diff --git a/app/assets/javascripts/templates/admin/tag_rules/filter_products_input.html.haml b/app/assets/javascripts/templates/admin/tag_rules/filter_products_input.html.haml index b30901791a..4d9f806cfc 100644 --- a/app/assets/javascripts/templates/admin/tag_rules/filter_products_input.html.haml +++ b/app/assets/javascripts/templates/admin/tag_rules/filter_products_input.html.haml @@ -1,11 +1,5 @@ %div - %input.fullwidth.light.ofn-select2{ id: "enterprise_tag_rules_attributes_{{tagGroup.startIndex + $index}}_preferred_matched_variants_visibility", - name: "enterprise[tag_rules_attributes][{{tagGroup.startIndex + $index}}][preferred_matched_variants_visibility]", - ng: { model: "rule.preferred_matched_variants_visibility", if: "!rule.is_default" }, - data: 'visibilityOptions', "min-search" => 5 } - %input{ type: "hidden", - id: "enterprise_tag_rules_attributes_{{tagGroup.startIndex + $index}}_preferred_matched_variants_visibility", - name: "enterprise[tag_rules_attributes][{{tagGroup.startIndex + $index}}][preferred_matched_variants_visibility]", - ng: { value: "'hidden'", if: "rule.is_default" } } - %span.text-normal{ ng: { if: "rule.is_default" } } + %input.fullwidth.light.ofn-select2{ "id" => "enterprise_tag_rules_attributes_{{tagGroup.startIndex + $index}}_preferred_matched_variants_visibility", "name" => "enterprise[tag_rules_attributes][{{tagGroup.startIndex + $index}}][preferred_matched_variants_visibility]", "data" => 'visibilityOptions', "min-search" => 5, "ng-model" => "rule.preferred_matched_variants_visibility", "ng-if" => "!rule.is_default" } + %input{ "type" => "hidden", "id" => "enterprise_tag_rules_attributes_{{tagGroup.startIndex + $index}}_preferred_matched_variants_visibility", "name" => "enterprise[tag_rules_attributes][{{tagGroup.startIndex + $index}}][preferred_matched_variants_visibility]", "ng-value" => "'hidden'", "ng-if" => "rule.is_default" } + %span.text-normal{ "ng-if" => "rule.is_default" } = t(:not_visible) diff --git a/app/assets/javascripts/templates/admin/tag_rules/filter_shipping_methods_input.html.haml b/app/assets/javascripts/templates/admin/tag_rules/filter_shipping_methods_input.html.haml index 48cf29a732..8b2ad933e6 100644 --- a/app/assets/javascripts/templates/admin/tag_rules/filter_shipping_methods_input.html.haml +++ b/app/assets/javascripts/templates/admin/tag_rules/filter_shipping_methods_input.html.haml @@ -1,12 +1,6 @@ %div - %input.fullwidth.light.ofn-select2{ id: "enterprise_tag_rules_attributes_{{tagGroup.startIndex + $index}}_preferred_matched_shipping_methods_visibility", - name: "enterprise[tag_rules_attributes][{{tagGroup.startIndex + $index}}][preferred_matched_shipping_methods_visibility]", - ng: { model: "rule.preferred_matched_shipping_methods_visibility", if: "!rule.is_default" }, - data: 'visibilityOptions', "min-search" => 5 } - %input{ type: "hidden", - id: "enterprise_tag_rules_attributes_{{tagGroup.startIndex + $index}}_preferred_matched_shipping_methods_visibility", - name: "enterprise[tag_rules_attributes][{{tagGroup.startIndex + $index}}][preferred_matched_shipping_methods_visibility]", - ng: { value: "'hidden'", if: "rule.is_default" } } - %span.text-normal{ ng: { if: "rule.is_default" } } + %input.fullwidth.light.ofn-select2{ "id" => "enterprise_tag_rules_attributes_{{tagGroup.startIndex + $index}}_preferred_matched_shipping_methods_visibility", "name" => "enterprise[tag_rules_attributes][{{tagGroup.startIndex + $index}}][preferred_matched_shipping_methods_visibility]", "data" => 'visibilityOptions', "min-search" => 5, "ng-model" => "rule.preferred_matched_shipping_methods_visibility", "ng-if" => "!rule.is_default" } + %input{ "type" => "hidden", "id" => "enterprise_tag_rules_attributes_{{tagGroup.startIndex + $index}}_preferred_matched_shipping_methods_visibility", "name" => "enterprise[tag_rules_attributes][{{tagGroup.startIndex + $index}}][preferred_matched_shipping_methods_visibility]", "ng-value" => "'hidden'", "ng-if" => "rule.is_default" } + %span.text-normal{ "ng-if" => "rule.is_default" } = t(:not_visible) diff --git a/app/assets/javascripts/templates/admin/tag_rules/tag_rule.html.haml b/app/assets/javascripts/templates/admin/tag_rules/tag_rule.html.haml index 7907b9dfda..7bd21b5892 100644 --- a/app/assets/javascripts/templates/admin/tag_rules/tag_rule.html.haml +++ b/app/assets/javascripts/templates/admin/tag_rules/tag_rule.html.haml @@ -6,45 +6,27 @@ %col.actions{ width: "10%" } %tr %td - %input{ type: "hidden", - id: "enterprise_tag_rules_attributes_{{tagGroup.startIndex + $index}}_id", - name: "enterprise[tag_rules_attributes][{{tagGroup.startIndex + $index}}][id]", - ng: { value: "rule.id" } } + %input{ "type" => "hidden", "id" => "enterprise_tag_rules_attributes_{{tagGroup.startIndex + $index}}_id", "name" => "enterprise[tag_rules_attributes][{{tagGroup.startIndex + $index}}][id]", "ng-value" => "rule.id" } - %input{ type: "hidden", - id: "enterprise_tag_rules_attributes_{{tagGroup.startIndex + $index}}_type", - name: "enterprise[tag_rules_attributes][{{tagGroup.startIndex + $index}}][type]", - ng: { value: "rule.type" } } + %input{ "type" => "hidden", "id" => "enterprise_tag_rules_attributes_{{tagGroup.startIndex + $index}}_type", "name" => "enterprise[tag_rules_attributes][{{tagGroup.startIndex + $index}}][type]", "ng-value" => "rule.type" } - %input{ type: "hidden", - id: "enterprise_tag_rules_attributes_{{tagGroup.startIndex + $index}}_priority", - name: "enterprise[tag_rules_attributes][{{tagGroup.startIndex + $index}}][priority]", - ng: { value: "tagGroup.startIndex + $index" } } + %input{ "type" => "hidden", "id" => "enterprise_tag_rules_attributes_{{tagGroup.startIndex + $index}}_priority", "name" => "enterprise[tag_rules_attributes][{{tagGroup.startIndex + $index}}][priority]", "ng-value" => "tagGroup.startIndex + $index" } - %input{ type: "hidden", - id: "enterprise_tag_rules_attributes_{{tagGroup.startIndex + $index}}_is_default", - name: "enterprise[tag_rules_attributes][{{tagGroup.startIndex + $index}}][is_default]", - ng: { value: "rule.is_default" } } + %input{ "type" => "hidden", "id" => "enterprise_tag_rules_attributes_{{tagGroup.startIndex + $index}}_is_default", "name" => "enterprise[tag_rules_attributes][{{tagGroup.startIndex + $index}}][is_default]", "ng-value" => "rule.is_default" } - %input{ type: "hidden", - id: "enterprise_tag_rules_attributes_{{tagGroup.startIndex + $index}}_preferred_customer_tags", - name: "enterprise[tag_rules_attributes][{{tagGroup.startIndex + $index}}][preferred_customer_tags]", - ng: { value: "rule.preferred_customer_tags" } } + %input{ "type" => "hidden", "id" => "enterprise_tag_rules_attributes_{{tagGroup.startIndex + $index}}_preferred_customer_tags", "name" => "enterprise[tag_rules_attributes][{{tagGroup.startIndex + $index}}][preferred_customer_tags]", "ng-value" => "rule.preferred_customer_tags" } - %input{ type: "hidden", - id: "enterprise_tag_rules_attributes_{{tagGroup.startIndex + $index}}_preferred_{{opt[rule.type].taggable}}_tags", - name: "enterprise[tag_rules_attributes][{{tagGroup.startIndex + $index}}][preferred_{{opt[rule.type].taggable}}_tags]", - ng: { value: "opt[rule.type].tagListFor(rule)" } } + %input{ "type" => "hidden", "id" => "enterprise_tag_rules_attributes_{{tagGroup.startIndex + $index}}_preferred_{{opt[rule.type].taggable}}_tags", "name" => "enterprise[tag_rules_attributes][{{tagGroup.startIndex + $index}}][preferred_{{opt[rule.type].taggable}}_tags]", "ng-value" => "opt[rule.type].tagListFor(rule)" } %span.text-normal {{ opt[rule.type].textTop }} %td %tags-with-translation{ object: "rule", max: 1, "tags-attr" => "{{opt[rule.type].tagsAttr}}", "tag-list-attr" => "{{opt[rule.type].tagListAttr}}" } %td.actions{ rowspan: 2 } - %a{ ng: { click: "deleteTagRule(tagGroup || defaultTagGroup, rule)" }, :class => "delete-tag-rule icon-trash no-text" } + %a{ "class" => "delete-tag-rule icon-trash no-text", "ng-click" => "deleteTagRule(tagGroup || defaultTagGroup, rule)" } %tr %td %span.text-normal {{ opt[rule.type].textBottom }} %td - %div{ ng: { include: "opt[rule.type].inputTemplate"} } + %div{ "ng-include" => "opt[rule.type].inputTemplate" } %hr diff --git a/app/assets/javascripts/templates/admin/tags_input.html.haml b/app/assets/javascripts/templates/admin/tags_input.html.haml index c652aea610..cce7d34333 100644 --- a/app/assets/javascripts/templates/admin/tags_input.html.haml +++ b/app/assets/javascripts/templates/admin/tags_input.html.haml @@ -1,10 +1,2 @@ -%tags-input{ template: 'admin/tag.html', - "placeholder" => t('admin.order_cycles.form.add_a_tag'), - ng: { model: 'object[tagsAttr]', class: "{'limit-reached': limitReached}"}, - on: { tag: { added: 'tagAdded($tag)', removed:'tagRemoved()' } } } - %auto-complete{ ng: { if: "findTags" }, source: "findTags({query: $query})", - template: "admin/tag_autocomplete.html", - "min-length" => "0", - "load-on-focus" => "true", - "load-on-empty" => "true", - "max-results-to-show" => "32"} +%tags-input{ "template" => 'admin/tag.html', "placeholder" => t('admin.order_cycles.form.add_a_tag'), "ng-model" => 'object[tagsAttr]', "ng-class" => "{'limit-reached': limitReached}", "on-tag-added" => 'tagAdded($tag)', "on-tag-removed" => 'tagRemoved()' } + %auto-complete{ "source" => "findTags({query: $query})", "template" => "admin/tag_autocomplete.html", "min-length" => "0", "load-on-focus" => "true", "load-on-empty" => "true", "max-results-to-show" => "32", "ng-if" => "findTags" } diff --git a/app/assets/javascripts/templates/bulk_buy_modal.html.haml b/app/assets/javascripts/templates/bulk_buy_modal.html.haml index 0c4706e43c..4782f43f8e 100644 --- a/app/assets/javascripts/templates/bulk_buy_modal.html.haml +++ b/app/assets/javascripts/templates/bulk_buy_modal.html.haml @@ -22,24 +22,22 @@ .variant-bulk-buy-quantity-label {{ "js.shopfront.bulk_buy_modal.min_quantity" | t }} %div - %button.bulk-buy-add.variant-quantity{type: "button", ng: {click: "add(-1)", disabled: "!canAdd(-1)"}}> + %button.bulk-buy-add.variant-quantity{ "type" => "button", "ng-click" => "add(-1)", "ng-disabled" => "!canAdd(-1)" }> -# U+FF0D Fullwidth Hyphen-Minus - - %input.bulk-buy.variant-quantity{type: "number", min: "0", max: "{{ available() }}", - ng: {model: "variant.line_item.quantity", max: "Infinity"}}> - %button.bulk-buy-add.variant-quantity{type: "button", ng: {click: "add(1)", disabled: "!canAdd(1)"}} + %input.bulk-buy.variant-quantity{ "type" => "number", "min" => "0", "max" => "{{ available() }}", "ng-model" => "variant.line_item.quantity", "ng-max" => "Infinity" }> + %button.bulk-buy-add.variant-quantity{ "type" => "button", "ng-click" => "add(1)", "ng-disabled" => "!canAdd(1)" } -# U+FF0B Fullwidth Plus Sign + .columns.small-12.medium-6 .variant-bulk-buy-quantity-label {{ "js.shopfront.bulk_buy_modal.max_quantity" | t }} %div - %button.bulk-buy-add.variant-quantity{type: "button", ng: {click: "addMax(-1)", disabled: "!canAddMax(-1)"}}> + %button.bulk-buy-add.variant-quantity{ "type" => "button", "ng-click" => "addMax(-1)", "ng-disabled" => "!canAddMax(-1)" }> -# U+FF0D Fullwidth Hyphen-Minus - - %input.bulk-buy.variant-quantity{type: "number", min: "0", max: "{{ available() }}", - ng: {model: "variant.line_item.max_quantity", max: "Infinity"}}> - %button.bulk-buy-add.variant-quantity{type: "button", ng: {click: "addMax(1)", disabled: "!canAddMax(1)"}} + %input.bulk-buy.variant-quantity{ "type" => "number", "min" => "0", "max" => "{{ available() }}", "ng-model" => "variant.line_item.max_quantity", "ng-max" => "Infinity" }> + %button.bulk-buy-add.variant-quantity{ "type" => "button", "ng-click" => "addMax(1)", "ng-disabled" => "!canAddMax(1)" } -# U+FF0B Fullwidth Plus Sign + diff --git a/app/assets/javascripts/templates/filter_selector.html.haml b/app/assets/javascripts/templates/filter_selector.html.haml index 742ace2a0e..5b46571408 100644 --- a/app/assets/javascripts/templates/filter_selector.html.haml +++ b/app/assets/javascripts/templates/filter_selector.html.haml @@ -1,3 +1,3 @@ %ul - %active-selector{ ng: { repeat: "selector in allSelectors", show: "ifDefined(selector.fits, true)" } } + %active-selector{ "ng-repeat" => "selector in allSelectors", "ng-show" => "ifDefined(selector.fits, true)" } %span{"ng-bind" => "::selector.object.name"} diff --git a/app/assets/javascripts/templates/help-modal.html.haml b/app/assets/javascripts/templates/help-modal.html.haml index f87abd8fd4..00c78fba30 100644 --- a/app/assets/javascripts/templates/help-modal.html.haml +++ b/app/assets/javascripts/templates/help-modal.html.haml @@ -5,5 +5,5 @@ .small-12.columns.text-center {{ helpText }} .row.text-center - %button.primary.small{ ng: { click: '$close()' } } + %button.primary.small{ "ng-click" => '$close()' } = t(:ok) diff --git a/app/assets/javascripts/templates/partials/hub_details.html.haml b/app/assets/javascripts/templates/partials/hub_details.html.haml index d9fb935f2a..c5d4a0304f 100644 --- a/app/assets/javascripts/templates/partials/hub_details.html.haml +++ b/app/assets/javascripts/templates/partials/hub_details.html.haml @@ -1,4 +1,4 @@ -.row.pad-top{ng: { if: 'enterprise.is_distributor' } } +.row.pad-top{ "ng-if" => 'enterprise.is_distributor' } .cta-container.small-12.columns .row .small-4.columns diff --git a/app/assets/javascripts/templates/price_breakdown.html.haml b/app/assets/javascripts/templates/price_breakdown.html.haml index 78d4ed7f33..8267e39d68 100644 --- a/app/assets/javascripts/templates/price_breakdown.html.haml +++ b/app/assets/javascripts/templates/price_breakdown.html.haml @@ -1,6 +1,6 @@ -.joyride-tip-guide.price_breakdown{ng: {class: "{ in: tt_isOpen, fade: tt_animation }", show: "tt_isOpen"}} +.joyride-tip-guide.price_breakdown{ "ng-class" => "{ in: tt_isOpen, fade: tt_animation }", "ng-show" => "tt_isOpen" } %span.joyride-nub.top - .background{ng: {click: "tt_isOpen = false"}} + .background{ "ng-click" => "tt_isOpen = false" } .joyride-content-wrapper %h6 {{ "js.shopfront.price_breakdown" | t }} %ul diff --git a/app/assets/javascripts/templates/shared/question_mark_with_tooltip.html.haml b/app/assets/javascripts/templates/shared/question_mark_with_tooltip.html.haml index 9c68ca47c4..827d2c18f6 100644 --- a/app/assets/javascripts/templates/shared/question_mark_with_tooltip.html.haml +++ b/app/assets/javascripts/templates/shared/question_mark_with_tooltip.html.haml @@ -1,5 +1,5 @@ -.joyride-tip-guide.question-mark-tooltip{class: "{{ context }}", ng: {class: "{ in: tt_isOpen, fade: tt_animation }", show: "tt_isOpen"}} - .background{ng: {click: "tt_isOpen = false"}} +.joyride-tip-guide.question-mark-tooltip{ "class" => "{{ context }}", "ng-class" => "{ in: tt_isOpen, fade: tt_animation }", "ng-show" => "tt_isOpen" } + .background{ "ng-click" => "tt_isOpen = false" } .joyride-content-wrapper {{ key | t }} %span.joyride-nub.bottom diff --git a/app/components/multiple_checked_select_component/multiple_checked_select_component.html.haml b/app/components/multiple_checked_select_component/multiple_checked_select_component.html.haml index 8dedce27ca..d4ea4e3958 100644 --- a/app/components/multiple_checked_select_component/multiple_checked_select_component.html.haml +++ b/app/components/multiple_checked_select_component/multiple_checked_select_component.html.haml @@ -1,4 +1,4 @@ -.ofn-drop-down.ofn-drop-down-v2{ data: { controller: "multiple-checked-select" } } +.ofn-drop-down.ofn-drop-down-v2{ "data-controller" => "multiple-checked-select" } %div.ofn-drop-down-label{ "data-multiple-checked-select-target": "button" } %span{class: "label"}= t('admin.columns') %span{ class: "icon-caret-down", "data-multiple-checked-select-target": "caret" } diff --git a/app/views/admin/_terms_of_service_banner.html.haml b/app/views/admin/_terms_of_service_banner.html.haml index 3adbba2f93..4c42aaaab7 100644 --- a/app/views/admin/_terms_of_service_banner.html.haml +++ b/app/views/admin/_terms_of_service_banner.html.haml @@ -3,6 +3,6 @@ .column-left %p= t("admin.terms_of_service_have_been_updated_html", tos_link: link_to(t("admin.terms_of_service"), TermsOfServiceFile.current_url, target: "_blank")) .column-right - %button{ data: { reflex: "click->user#accept_terms_of_services" } } + %button{ "data-reflex" => "click->user#accept_terms_of_services" } = t("admin.accept_terms_of_service") diff --git a/app/views/admin/customers/index.html.haml b/app/views/admin/customers/index.html.haml index a463b2e0ed..59e9b11105 100644 --- a/app/views/admin/customers/index.html.haml +++ b/app/views/admin/customers/index.html.haml @@ -14,22 +14,22 @@ = admin_inject_shops(@shops, module: 'admin.customers') = admin_inject_available_countries(module: 'admin.customers') -%div{ ng: { controller: 'customersCtrl' } } +%div{ "ng-controller" => 'customersCtrl' } .row.filters .sixteen.columns.alpha.omega .filter_select.five.columns.alpha - %label{ :for => 'quick_search', ng: {class: '{disabled: !shop_id}'} }=t('admin.quick_search') + %label{ "for" => 'quick_search', "ng-class" => '{disabled: !shop_id}' }=t('admin.quick_search') %br - %input.fullwidth{ :type => "text", :id => 'quick_search', ng: { model: 'quickSearch', disabled: '!shop_id' }, :placeholder => t('.search_by_email') } + %input.fullwidth{ "type" => "text", "id" => 'quick_search', "placeholder" => t('.search_by_email'), "ng-model" => 'quickSearch', "ng-disabled" => '!shop_id' } .filter_select.four.columns - %label{ :for => 'hub_id', ng: { bind: "shop_id ? '#{t('admin.shop')}' : '#{t('admin.variant_overrides.index.select_a_shop')}'" } } + %label{ "for" => 'hub_id', "ng-bind" => "shop_id ? '#{t('admin.shop')}' : '#{t('admin.variant_overrides.index.select_a_shop')}'" } %br - %input.ofn-select2.fullwidth#shop_id{ 'ng-model' => 'shop_id', name: 'shop_id', data: 'shops', on: { selecting: 'confirmRefresh' } } + %input.ofn-select2.fullwidth#shop_id{ "ng-model" => 'shop_id', "name" => 'shop_id', "data" => 'shops', "on-selecting" => 'confirmRefresh' } .seven.columns.omega   - %hr.divider{ ng: { show: "!RequestMonitor.loading && filteredCustomers.length > 0" } } + %hr.divider{ "ng-show" => "!RequestMonitor.loading && filteredCustomers.length > 0" } - .row.controls{ ng: { show: "!RequestMonitor.loading && filteredCustomers.length > 0" } } + .row.controls{ "ng-show" => "!RequestMonitor.loading && filteredCustomers.length > 0" } .thirteen.columns.alpha   %columns-dropdown{ action: "#{controller_name}_#{action_name}" } @@ -39,13 +39,13 @@ %h1 = t :loading_customers - .row.margin-bottom-50{ ng: { show: "!RequestMonitor.loading" } } + .row.margin-bottom-50{ "ng-show" => "!RequestMonitor.loading" } %form{ name: "customers_form" } %h1#no_results{ 'ng-show' => '!RequestMonitor.loading && filteredCustomers.length == 0' } =t :no_customers_found %save-bar{ dirty: "customers_form.$dirty", persist: "false" } - %input.red{ type: "button", value: t(:save_changes), ng: { click: "submitAll(customers_form)" } } + %input.red{ "type" => "button", "value" => t(:save_changes), "ng-click" => "submitAll(customers_form)" } %table.index#customers{ 'ng-show' => '!RequestMonitor.loading && filteredCustomers.length > 0' } %col.email{ width: "20%", 'ng-show' => 'columns.email.visible' } @@ -58,7 +58,7 @@ %col.balance{ width: "10%", 'ng-show' => 'columns.balance.visible' } %col.actions{ width: "10%"} %thead - %tr{ ng: { controller: "ColumnsCtrl" } } + %tr{ "ng-controller" => "ColumnsCtrl" } -# %th.bulk -# %input{ :type => "checkbox", :name => 'toggle_bulk', 'ng-click' => 'toggleAllCheckboxes()', 'ng-checked' => "allBoxesChecked()" } %th.email{ 'ng-show' => 'columns.email.visible' } @@ -81,12 +81,12 @@ %span{ 'ng-bind' => '::customer.email' } %span.guest-label{ 'ng-show' => 'customer.user_id == null' }= t('.guest_label') %td.first_name{ 'ng-show' => 'columns.first_name.visible'} - %input{ type: 'text', name: 'first_name', ng: { model: 'customer.first_name' }, 'obj-for-update' => 'customer', 'attr-for-update' => 'first_name'} + %input{ "type" => 'text', "name" => 'first_name', "obj-for-update" => 'customer', "attr-for-update" => 'first_name', "ng-model" => 'customer.first_name' } %td.last_name{ 'ng-show' => 'columns.last_name.visible'} - %input{ type: 'text', name: 'last_name', ng: { model: 'customer.last_name' }, 'obj-for-update' => 'customer', 'attr-for-update' => 'last_name'} + %input{ "type" => 'text', "name" => 'last_name', "obj-for-update" => 'customer', "attr-for-update" => 'last_name', "ng-model" => 'customer.last_name' } %td.code{ 'ng-show' => 'columns.code.visible' } - %input{ type: 'text', name: 'code', ng: {model: 'customer.code', change: 'checkForDuplicateCodes()'}, "obj-for-update" => "customer", "attr-for-update" => "code" } - %i.icon-warning-sign{ ng: {if: 'duplicate'} } + %input{ "type" => 'text', "name" => 'code', "obj-for-update" => "customer", "attr-for-update" => "code", "ng-model" => 'customer.code', "ng-change" => 'checkForDuplicateCodes()' } + %i.icon-warning-sign{ "ng-if" => 'duplicate' } = t('.duplicate_code') %td.tags{ 'ng-show' => 'columns.tags.visible' } .tag_watcher{ 'obj-for-update' => "customer", "attr-for-update" => "tag_list"} @@ -101,6 +101,6 @@ %td.actions %a{ 'ng-click' => "deleteCustomer(customer)", :class => "delete-customer icon-trash no-text" } - %div.text-center{ ng: { show: "filteredCustomers.length > customerLimit" } } - %input{ type: 'button', value: t(:show_more), ng: { click: 'customerLimit = customerLimit + 20' } } - %input{ type: 'button', value: t(:show_all_with_more, num: '{{ filteredCustomers.length - customerLimit }}'), ng: { click: 'customerLimit = filteredCustomers.length' } } + %div.text-center{ "ng-show" => "filteredCustomers.length > customerLimit" } + %input{ "type" => 'button', "value" => t(:show_more), "ng-click" => 'customerLimit = customerLimit + 20' } + %input{ "type" => 'button', "value" => t(:show_all_with_more, num: '{{ filteredCustomers.length - customerLimit }}'), "ng-click" => 'customerLimit = filteredCustomers.length' } diff --git a/app/views/admin/enterprise_fees/index.html.haml b/app/views/admin/enterprise_fees/index.html.haml index e237704243..65ec1e199a 100644 --- a/app/views/admin/enterprise_fees/index.html.haml +++ b/app/views/admin/enterprise_fees/index.html.haml @@ -29,20 +29,20 @@ %th.actions %tbody = enterprise_fee_set_form.ng_fields_for :collection do |f| - %tr{ ng: { repeat: 'enterprise_fee in enterprise_fees | filter:query' } } + %tr{ "ng-repeat" => 'enterprise_fee in enterprise_fees | filter:query' } %td = f.ng_hidden_field :id - %ofn-select{ :id => angular_id(:enterprise_id), data: 'enterprises', ng: { model: 'enterprise_fee.enterprise_id' }, style: "width: 90%" } - %input{ type: "hidden", name: angular_name(:enterprise_id), ng: { value: "enterprise_fee.enterprise_id" } } + %ofn-select{ "id" => angular_id(:enterprise_id), "data" => 'enterprises', "style" => "width: 90%", "ng-model" => 'enterprise_fee.enterprise_id' } + %input{ "type" => "hidden", "name" => angular_name(:enterprise_id), "ng-value" => "enterprise_fee.enterprise_id" } %td= f.ng_select :fee_type, enterprise_fee_type_options, 'enterprise_fee.fee_type' %td= f.ng_text_field :name, { placeholder: t('.name_placeholder') } %td - %ofn-select{ :id => angular_id(:tax_category_id), data: 'tax_categories', include_blank: true, ng: { model: 'enterprise_fee.tax_category_id' } } + %ofn-select{ "id" => angular_id(:tax_category_id), "data" => 'tax_categories', "include_blank" => true, "ng-model" => 'enterprise_fee.tax_category_id' } %input{ type: "hidden", name: angular_name(:tax_category_id), 'watch-tax-category' => true } - %input{ type: "hidden", name: angular_name(:inherits_tax_category), ng: { value: "enterprise_fee.inherits_tax_category" } } + %input{ "type" => "hidden", "name" => angular_name(:inherits_tax_category), "ng-value" => "enterprise_fee.inherits_tax_category" } %td - %ofn-select.calculator_type{ :id => angular_id(:calculator_type), ng: { model: 'enterprise_fee.calculator_type' }, value_attr: 'name', text_attr: 'description', data: 'calculators', 'spree-ensure-calculator-preferences-match-type' => true } - %input{ type: "hidden", name: angular_name(:calculator_type), ng: { value: "enterprise_fee.calculator_type" } } + %ofn-select.calculator_type{ "id" => angular_id(:calculator_type), "value_attr" => 'name', "text_attr" => 'description', "data" => 'calculators', "spree-ensure-calculator-preferences-match-type" => true, "ng-model" => 'enterprise_fee.calculator_type' } + %input{ "type" => "hidden", "name" => angular_name(:calculator_type), "ng-value" => "enterprise_fee.calculator_type" } %td{'ng-bind-html-unsafe-compiled' => 'enterprise_fee.calculator_settings'} %td.actions{'spree-delete-resource' => "1"} diff --git a/app/views/admin/enterprise_groups/_form.html.haml b/app/views/admin/enterprise_groups/_form.html.haml index 9e95a39879..a7012cb695 100644 --- a/app/views/admin/enterprise_groups/_form.html.haml +++ b/app/views/admin/enterprise_groups/_form.html.haml @@ -1,7 +1,7 @@ = render 'spree/shared/error_messages', target: @enterprise = form_for [main_app, :admin, @enterprise_group] do |f| - .row{ ng: {app: 'admin.enterprise_groups', controller: 'enterpriseGroupCtrl'}, data: { controller: 'tabs-and-panels', "tabs-and-panels-class-name-value": "selected" } } + .row{ "ng-app" => 'admin.enterprise_groups', "ng-controller" => 'enterpriseGroupCtrl', "data-controller" => 'tabs-and-panels', "data-tabs-and-panels-class-name-value" => "selected" } .sixteen.columns.alpha .four.columns.alpha = render 'admin/shared/side_menu' diff --git a/app/views/admin/enterprise_groups/_form_about.html.haml b/app/views/admin/enterprise_groups/_form_about.html.haml index ce8d03fc37..ded00e0155 100644 --- a/app/views/admin/enterprise_groups/_form_about.html.haml +++ b/app/views/admin/enterprise_groups/_form_about.html.haml @@ -1,4 +1,4 @@ -%fieldset.alpha.no-border-bottom#about_panel{ data: { "tabs-and-panels-target": "panel" } } +%fieldset.alpha.no-border-bottom#about_panel{ "data-tabs-and-panels-target" => "panel" } %legend= t('.about') = f.field_container :long_description do %text-angular{'id' => 'enterprise_group_long_description', 'name' => 'enterprise_group[long_description]', 'class' => 'text-angular', "textangular-links-target-blank" => true, diff --git a/app/views/admin/enterprise_groups/_form_address.html.haml b/app/views/admin/enterprise_groups/_form_address.html.haml index b495151686..85b3799163 100644 --- a/app/views/admin/enterprise_groups/_form_address.html.haml +++ b/app/views/admin/enterprise_groups/_form_address.html.haml @@ -1,5 +1,5 @@ = f.fields_for :address do |af| - %fieldset.alpha.no-border-bottom#contact_panel{ data: { "tabs-and-panels-target": "panel" } } + %fieldset.alpha.no-border-bottom#contact_panel{ "data-tabs-and-panels-target" => "panel" } %legend= t('.contact') .row .alpha.three.columns diff --git a/app/views/admin/enterprise_groups/_form_images.html.haml b/app/views/admin/enterprise_groups/_form_images.html.haml index 14f9a371d2..706a137cf1 100644 --- a/app/views/admin/enterprise_groups/_form_images.html.haml +++ b/app/views/admin/enterprise_groups/_form_images.html.haml @@ -1,4 +1,4 @@ -%fieldset.alpha.no-border-bottom#images_panel{ data: { "tabs-and-panels-target": "panel" } } +%fieldset.alpha.no-border-bottom#images_panel{ "data-tabs-and-panels-target" => "panel" } %legend= t('.images') .row .alpha.three.columns diff --git a/app/views/admin/enterprise_groups/_form_primary_details.html.haml b/app/views/admin/enterprise_groups/_form_primary_details.html.haml index 4ab3aae1b5..165fa0f2a9 100644 --- a/app/views/admin/enterprise_groups/_form_primary_details.html.haml +++ b/app/views/admin/enterprise_groups/_form_primary_details.html.haml @@ -1,4 +1,4 @@ -%fieldset.alpha.no-border-bottom#primary_details_panel{ data: { "tabs-and-panels-target": "panel default" } } +%fieldset.alpha.no-border-bottom#primary_details_panel{ "data-tabs-and-panels-target" => "panel default" } %legend= t('.primary_details') = f.field_container :name do = f.label :name diff --git a/app/views/admin/enterprise_groups/_form_users.html.haml b/app/views/admin/enterprise_groups/_form_users.html.haml index 27ac13f5c1..ca3c460c5b 100644 --- a/app/views/admin/enterprise_groups/_form_users.html.haml +++ b/app/views/admin/enterprise_groups/_form_users.html.haml @@ -1,4 +1,4 @@ -%fieldset.alpha.no-border-bottom#users_panel{ data: { "tabs-and-panels-target": "panel" } } +%fieldset.alpha.no-border-bottom#users_panel{ "data-tabs-and-panels-target" => "panel" } %legend= t('.users') .row .three.columns.alpha diff --git a/app/views/admin/enterprise_groups/_form_web.html.haml b/app/views/admin/enterprise_groups/_form_web.html.haml index 200c708669..d2cc7e50ff 100644 --- a/app/views/admin/enterprise_groups/_form_web.html.haml +++ b/app/views/admin/enterprise_groups/_form_web.html.haml @@ -1,4 +1,4 @@ -%fieldset.alpha.no-border-bottom#web_panel{ data: { "tabs-and-panels-target": "panel" } } +%fieldset.alpha.no-border-bottom#web_panel{ "data-tabs-and-panels-target" => "panel" } %legend= t('.web') .row .alpha.three.columns diff --git a/app/views/admin/enterprise_relationships/_form.html.haml b/app/views/admin/enterprise_relationships/_form.html.haml index e79da0b144..f5c1651a35 100644 --- a/app/views/admin/enterprise_relationships/_form.html.haml +++ b/app/views/admin/enterprise_relationships/_form.html.haml @@ -8,7 +8,7 @@ %select.select2.fullwidth{id: "enterprise_relationship_child_id", "ng-model" => "child_id", "ng-options" => "e.id as e.name for e in Enterprises.all_enterprises"} %td %label - %input{type: "checkbox", ng: {checked: "allPermissionsChecked()", click: "checkAllPermissions()"}} + %input{ "type" => "checkbox", "ng-checked" => "allPermissionsChecked()", "ng-click" => "checkAllPermissions()" } = t 'admin_enterprise_relationships_everything' %div{"ng-repeat" => "permission in EnterpriseRelationships.all_permissions"} %label diff --git a/app/views/admin/enterprise_relationships/_search_input.html.haml b/app/views/admin/enterprise_relationships/_search_input.html.haml index a85f201b91..d3c9f1b940 100644 --- a/app/views/admin/enterprise_relationships/_search_input.html.haml +++ b/app/views/admin/enterprise_relationships/_search_input.html.haml @@ -1,5 +1,5 @@ %input.search{"ng-model" => "query", "placeholder" => t(:admin_enterprise_relationships_seach_placeholder)} -%label{ng: {repeat: "permission in EnterpriseRelationships.all_permissions"}} - %input{type: "checkbox", ng: {click: "$parent.query = toggleKeyword($parent.query, permission)"}} +%label{ "ng-repeat" => "permission in EnterpriseRelationships.all_permissions" } + %input{ "type" => "checkbox", "ng-click" => "$parent.query = toggleKeyword($parent.query, permission)" } {{ EnterpriseRelationships.permission_presentation(permission) }} diff --git a/app/views/admin/enterprises/_change_type_form.html.haml b/app/views/admin/enterprises/_change_type_form.html.haml index 5a71a1bb45..00562f25e1 100644 --- a/app/views/admin/enterprises/_change_type_form.html.haml +++ b/app/views/admin/enterprises/_change_type_form.html.haml @@ -3,13 +3,13 @@ = form_for @enterprise, url: main_app.register_admin_enterprise_path(@enterprise), html: { name: "change_type", id: "change_type", novalidate: true, "ng-app" => "admin.enterprises", "ng-controller"=> 'changeTypeFormCtrl' } do |change_type_form| -# Have to use hidden:'true' on this input rather than type:'hidden' as the latter seems to break ngPattern and therefore validation - %input{ hidden: "true", name: "sells", ng: { required: true, pattern: "/^(none|own|any)$/", model: 'sells', value: "sells"} } + %input{ "hidden" => "true", "name" => "sells", "ng-required" => true, "ng-pattern" => "/^(none|own|any)$/", "ng-model" => 'sells', "ng-value" => "sells" } .row .options.container - if @enterprise.is_primary_producer .basic_producer.option.six.columns.alpha - %a.full-width.button.selector{ ng: { click: "sells='none'", class: "{selected: sells=='none'}" } } + %a.full-width.button.selector{ "ng-click" => "sells='none'", "ng-class" => "{selected: sells=='none'}" } .top %h3= t('.producer_profile') %p= t('.connect_ofn') @@ -18,7 +18,7 @@ = t('.producer_description_text') .producer_shop.option.six.columns - %a.full-width.button.selector{ ng: { click: "sells='own'", class: "{selected: sells=='own'}" } } + %a.full-width.button.selector{ "ng-click" => "sells='own'", "ng-class" => "{selected: sells=='own'}" } .top %h3= t('.producer_shop') %p= t('.sell_your_produce') @@ -29,7 +29,7 @@ = t('.producer_shop_description_text2') .full_hub.option.six.columns.omega - %a.full-width.button.selector{ ng: { click: "sells='any'", class: "{selected: sells=='any'}" } } + %a.full-width.button.selector{ "ng-click" => "sells='any'", "ng-class" => "{selected: sells=='any'}" } .top %h3= t('.producer_hub') %p= t('.producer_hub_text') @@ -40,7 +40,7 @@ .two.columns.alpha   .shop_profile.option.six.columns - %a.full-width.button.selector{ ng: { click: "sells='none'", class: "{selected: sells=='none'}" } } + %a.full-width.button.selector{ "ng-click" => "sells='none'", "ng-class" => "{selected: sells=='none'}" } .top %h3= t('.profile') %p= t('.get_listing') @@ -49,7 +49,7 @@ = t('.profile_description_text') .full_hub.option.six.columns - %a.full-width.button.selector{ ng: { click: "sells='any'", class: "{selected: sells=='any'}" } } + %a.full-width.button.selector{ "ng-click" => "sells='any'", "ng-class" => "{selected: sells=='any'}" } .top %h3= t('.hub_shop') %p= t('.hub_shop_text') @@ -60,11 +60,11 @@ .row .sixteen.columns.alpha - %span.error{ ng: { show: "(change_type.sells.$error.required || change_type.sells.$error.pattern) && submitted" } } + %span.error{ "ng-show" => "(change_type.sells.$error.required || change_type.sells.$error.pattern) && submitted" } = t('.choose_option') - if @enterprise.sells == 'unspecified' - %input.button.big{ type: 'submit', value: t(:select_continue), ng: { click: "submit(change_type)" } } + %input.button.big{ "type" => 'submit', "value" => t(:select_continue), "ng-click" => "submit(change_type)" } - else - %input.button.big{ type: 'submit', value: t('.change_now'), ng: { click: "submit(change_type)" } } + %input.button.big{ "type" => 'submit', "value" => t('.change_now'), "ng-click" => "submit(change_type)" } %br   %hr diff --git a/app/views/admin/enterprises/_enterprise_user_index.html.haml b/app/views/admin/enterprises/_enterprise_user_index.html.haml index 46090da6af..ecfe3db753 100644 --- a/app/views/admin/enterprises/_enterprise_user_index.html.haml +++ b/app/views/admin/enterprises/_enterprise_user_index.html.haml @@ -1,4 +1,4 @@ -%div{ ng: { controller: 'enterprisesCtrl' } } +%div{ "ng-controller" => 'enterprisesCtrl' } .row{ 'ng-hide' => '!loaded' } .controls{ :class => "sixteen columns alpha", :style => "margin-bottom: 15px;" } .four.columns.alpha @@ -15,32 +15,32 @@ .row{ :class => "sixteen columns alpha", 'ng-show' => 'loaded && filteredEnterprises.length == 0'} %h1#no_results= t('.no_enterprises_found') - .row{ ng: { show: "loaded && filteredEnterprises.length > 0" } } + .row{ "ng-show" => "loaded && filteredEnterprises.length > 0" } %table.index#enterprises - %col.name{ width: "28%", ng: { show: 'columns.name.visible' } } - %col.producer{ width: "18%", ng: { show: 'columns.producer.visible' }} - %col.package{ width: "18%", ng: { show: 'columns.package.visible' }} - %col.status{ width: "18%", ng: { show: 'columns.status.visible' }} - %col.manage{ width: "18%", ng: { show: 'columns.manage.visible' }} + %col.name{ "width" => "28%", "ng-show" => 'columns.name.visible' } + %col.producer{ "width" => "18%", "ng-show" => 'columns.producer.visible' } + %col.package{ "width" => "18%", "ng-show" => 'columns.package.visible' } + %col.status{ "width" => "18%", "ng-show" => 'columns.status.visible' } + %col.manage{ "width" => "18%", "ng-show" => 'columns.manage.visible' } %thead - %tr{ ng: { controller: "ColumnsCtrl" } } - %th.name{ ng: { show: 'columns.name.visible' } }=t('admin.name') - %th.producer{ ng: { show: 'columns.producer.visible' } }=t('.producer?') - %th.package{ ng: { show: 'columns.package.visible' } }=t('.package') - %th.status{ ng: { show: 'columns.status.visible' } }=t('.status') - %th.manage{ ng: { show: 'columns.manage.visible' } }=t('.manage') - %tbody.panel-ctrl{ :id => "e_{{enterprise.id}}", object: "enterprise", ng: { repeat: "enterprise in filteredEnterprises = ( allEnterprises | filter:{ name: quickSearch } )" } } - %tr.enterprise{ ng: { class: { even: "'even'", odd: "'odd'"} } } - %td.name{ ng: { show: 'columns.name.visible' } } - %span{ ng: { bind: "::enterprise.name" } } - %td.producer.panel-toggle.text-center{ ng: { show: 'columns.producer.visible', class: "{error: enterprise.producerError}" }, name: "producer" } - %h5{ ng: { bind: "enterprise.producer" } } - %td.package.panel-toggle.text-center{ ng: { show: 'columns.package.visible', class: "{error: enterprise.packageError}" }, name: "package" } - %h5{ ng: { bind: "enterprise.package" } } - %td.status.panel-toggle.text-center{ ng: { show: 'columns.status.visible' }, name: "status" } - %i.icon-status{ ng: { class: "enterprise.status" } } - %td.manage{ ng: { show: 'columns.manage.visible' } } - %a.button.fullwidth{ ng: { href: '{{::enterprise.edit_path}}' } } + %tr{ "ng-controller" => "ColumnsCtrl" } + %th.name{ "ng-show" => 'columns.name.visible' }=t('admin.name') + %th.producer{ "ng-show" => 'columns.producer.visible' }=t('.producer?') + %th.package{ "ng-show" => 'columns.package.visible' }=t('.package') + %th.status{ "ng-show" => 'columns.status.visible' }=t('.status') + %th.manage{ "ng-show" => 'columns.manage.visible' }=t('.manage') + %tbody.panel-ctrl{ "id" => "e_{{enterprise.id}}", "object" => "enterprise", "ng-repeat" => "enterprise in filteredEnterprises = ( allEnterprises | filter:{ name: quickSearch } )" } + %tr.enterprise{ "ng-class-even" => "'even'", "ng-class-odd" => "'odd'" } + %td.name{ "ng-show" => 'columns.name.visible' } + %span{ "ng-bind" => "::enterprise.name" } + %td.producer.panel-toggle.text-center{ "name" => "producer", "ng-show" => 'columns.producer.visible', "ng-class" => "{error: enterprise.producerError}" } + %h5{ "ng-bind" => "enterprise.producer" } + %td.package.panel-toggle.text-center{ "name" => "package", "ng-show" => 'columns.package.visible', "ng-class" => "{error: enterprise.packageError}" } + %h5{ "ng-bind" => "enterprise.package" } + %td.status.panel-toggle.text-center{ "name" => "status", "ng-show" => 'columns.status.visible' } + %i.icon-status{ "ng-class" => "enterprise.status" } + %td.manage{ "ng-show" => 'columns.manage.visible' } + %a.button.fullwidth{ "ng-href" => '{{::enterprise.edit_path}}' } = t('.manage_link') %i.icon-arrow-right diff --git a/app/views/admin/enterprises/_form.html.haml b/app/views/admin/enterprises/_form.html.haml index dcaae1a149..a4e6bdba4f 100644 --- a/app/views/admin/enterprises/_form.html.haml +++ b/app/views/admin/enterprises/_form.html.haml @@ -1,15 +1,15 @@ - enterprise_side_menu_items(@enterprise).each do |item| - case item[:name] - when 'primary_details' - %fieldset.alpha.no-border-bottom{ id: "#{item[:name]}_panel", data: { controller: "primary-details", "primary-details-primary-producer-value": @enterprise.is_primary_producer.to_s, "primary-details-enterprise-sells-value": @enterprise.sells, "tabs-and-panels-target": "panel default" }} + %fieldset.alpha.no-border-bottom{ "id" => "#{item[:name]}_panel", "data-controller" => "primary-details", "data-primary-details-primary-producer-value" => @enterprise.is_primary_producer.to_s, "data-primary-details-enterprise-sells-value" => @enterprise.sells, "data-tabs-and-panels-target" => "panel default" } %legend= t(".#{ item[:name] }.legend") = render "admin/enterprises/form/#{ item[:form_name] || item[:name] }", f: f - when 'enterprise_permissions' - %fieldset.alpha.no-border-bottom{ id: "#{item[:name]}_panel", data: { "tabs-and-panels-target": "panel" }} + %fieldset.alpha.no-border-bottom{ "id" => "#{item[:name]}_panel", "data-tabs-and-panels-target" => "panel" } %legend= t(".#{ item[:name] }.legend") - else - %fieldset.alpha.no-border-bottom{ id: "#{item[:name]}_panel", data: { "tabs-and-panels-target": "panel" }} + %fieldset.alpha.no-border-bottom{ "id" => "#{item[:name]}_panel", "data-tabs-and-panels-target" => "panel" } %legend= t(".#{ item[:form_name] || item[:name] }.legend") = render "admin/enterprises/form/#{ item[:form_name] || item[:name] }", f: f diff --git a/app/views/admin/enterprises/_ng_form.html.haml b/app/views/admin/enterprises/_ng_form.html.haml index 18f29a5701..5371ae54de 100644 --- a/app/views/admin/enterprises/_ng_form.html.haml +++ b/app/views/admin/enterprises/_ng_form.html.haml @@ -8,8 +8,8 @@ "ng-cloak" => true } do |f| %save-bar{ dirty: "enterprise_form.$dirty", persist: "true" } - %input.red{ type: "button", value: t(:update), ng: { click: "submit()", disabled: "!enterprise_form.$dirty" } } - %input{ type: "button", ng: { value: "enterprise_form.$dirty ? '#{t(:cancel)}' : '#{t(:close)}'", click: "cancel('#{main_app.admin_enterprises_path}')" } } + %input.red{ "type" => "button", "value" => t(:update), "ng-click" => "submit()", "ng-disabled" => "!enterprise_form.$dirty" } + %input{ "type" => "button", "ng-value" => "enterprise_form.$dirty ? '#{t(:cancel)}' : '#{t(:close)}'", "ng-click" => "cancel('#{main_app.admin_enterprises_path}')" } .row{ data: { controller: "tabs-and-panels", "tabs-and-panels-class-name-value": "selected" }} diff --git a/app/views/admin/enterprises/form/_address.html.haml b/app/views/admin/enterprises/form/_address.html.haml index 9d76513a3d..cf48d0cbd8 100644 --- a/app/views/admin/enterprises/form/_address.html.haml +++ b/app/views/admin/enterprises/form/_address.html.haml @@ -34,7 +34,7 @@ %span.required * .four.columns = af.select :state_id, @enterprise.address.country.states.map { |s| [s.name, s.id] }, {}, { "data-controller": "tom-select", "data-dependent-select-target": "select", class: "primary" } - .four.columns.omega{ data: { controller: "primary-details" }} + .four.columns.omega{ "data-controller" => "primary-details" } = af.select :country_id, available_countries.map { |c| [c.name, c.id] }, {}, { "data-controller": "tom-select", "data-dependent-select-target": "source", "data-action": "dependent-select#handleSelectChange", class: "primary" } .row .three.columns.alpha diff --git a/app/views/admin/enterprises/form/_business_details.html.haml b/app/views/admin/enterprises/form/_business_details.html.haml index 30bef3ba2f..8433dd8ed2 100644 --- a/app/views/admin/enterprises/form/_business_details.html.haml +++ b/app/views/admin/enterprises/form/_business_details.html.haml @@ -31,22 +31,22 @@ = f.label :invoice_text, t('.invoice_text') .omega.eight.columns = f.text_area :invoice_text, style: "width: 100%; height: 100px;" -.row{ data: { controller: 'terms-and-conditions', "terms-and-conditions-message-value": t('js.admin.enterprises.form.images.immediate_terms_and_conditions_removal_warning') } } +.row{ "data-controller" => 'terms-and-conditions', "data-terms-and-conditions-message-value" => t('js.admin.enterprises.form.images.immediate_terms_and_conditions_removal_warning') } .alpha.three.columns = f.label :terms_and_conditions, t('.terms_and_conditions') %i.text-big.icon-question-sign{ "data-controller": "help-modal-link", "data-action": "click->help-modal-link#open", "data-help-modal-link-target-value": "terms_and_conditions_info_modal" } - .omega.eight.columns#terms_and_conditions{data: { 'reflex-root': '#terms_and_conditions' } } + .omega.eight.columns#terms_and_conditions{ "data-reflex-root" => '#terms_and_conditions' } - if @enterprise.terms_and_conditions.attached? = link_to "#{@enterprise.terms_and_conditions.blob.filename} #{ t('.uploaded_on') } #{@enterprise.terms_and_conditions.blob.created_at}", url_for(@enterprise.terms_and_conditions), target: '_blank' %div - %a.icon-trash{ href: '#', data: { action: 'click->terms-and-conditions#remove', "terms-and-conditions-message-value": t('js.admin.enterprises.form.images.immediate_terms_and_conditions_removal_warning'), 'enterprise-id': @enterprise.id}} + %a.icon-trash{ "href" => '#', "data-action" => 'click->terms-and-conditions#remove', "data-terms-and-conditions-message-value" => t('js.admin.enterprises.form.images.immediate_terms_and_conditions_removal_warning'), "data-enterprise-id" => @enterprise.id } = t('.remove_terms_and_conditions') .pad-top %div - .button.small{ data: { controller: 'help-modal-link', action: 'click->help-modal-link#open', "help-modal-link-target-value": "terms_and_conditions_warning_modal" } } + .button.small{ "data-controller" => 'help-modal-link', "data-action" => 'click->help-modal-link#open', "data-help-modal-link-target-value" => "terms_and_conditions_warning_modal" } = t('.upload') - %span{ data: { "terms-and-conditions-target": "filename" } } + %span{ "data-terms-and-conditions-target" => "filename" } = f.file_field :terms_and_conditions, accept: 'application/pdf', style: 'display: none;', data: { "terms-and-conditions-target": "fileinput" } = render HelpModalComponent.new(id: "terms_and_conditions_warning_modal", close_button: false ) do diff --git a/app/views/admin/enterprises/form/_connected_apps.html.haml b/app/views/admin/enterprises/form/_connected_apps.html.haml index c60a7da1a1..0f3d5beac0 100644 --- a/app/views/admin/enterprises/form/_connected_apps.html.haml +++ b/app/views/admin/enterprises/form/_connected_apps.html.haml @@ -6,7 +6,7 @@ %p= t ".tagline" %div - if enterprise.connected_apps.empty? - %button{ data: {reflex: "click->Admin::ConnectedApp#create", enterprise_id: enterprise.id} } + %button{ "data-reflex" => "click->Admin::ConnectedApp#create", "data-enterprise_id" => enterprise.id } = t ".enable" - elsif enterprise.connected_apps.connecting.present? %button{ disabled: true } @@ -14,7 +14,7 @@   = t ".loading" - else - %button{ data: {reflex: "click->Admin::ConnectedApp#destroy", enterprise_id: enterprise.id} } + %button{ "data-reflex" => "click->Admin::ConnectedApp#destroy", "data-enterprise_id" => enterprise.id } = t ".disable" .connected-app__connection diff --git a/app/views/admin/enterprises/form/_images.html.haml b/app/views/admin/enterprises/form/_images.html.haml index a5340b4a60..cd466e1d65 100644 --- a/app/views/admin/enterprises/form/_images.html.haml +++ b/app/views/admin/enterprises/form/_images.html.haml @@ -4,10 +4,10 @@ %br = t('.logo_size') .omega.eight.columns - %img{ class: 'image-field-group__preview-image', ng: { src: '{{ Enterprise.logo.thumb }}', if: 'Enterprise.logo' } } + %img{ "class" => 'image-field-group__preview-image', "ng-src" => '{{ Enterprise.logo.thumb }}', "ng-if" => 'Enterprise.logo' } %br = f.file_field :logo - %a.button.red{ href: '', ng: {click: 'removeLogo()', if: 'Enterprise.logo'} } + %a.button.red{ "href" => '', "ng-click" => 'removeLogo()', "ng-if" => 'Enterprise.logo' } = t('.remove_logo') .row.page-admin-enterprises-form__promo-image-field-group.image-field-group @@ -21,7 +21,7 @@ = t('.promo_image_note3') .omega.eight.columns - %img{ class: 'image-field-group__preview-image', ng: { src: '{{ Enterprise.promo_image.large }}', if: 'Enterprise.promo_image' } } + %img{ "class" => 'image-field-group__preview-image', "ng-src" => '{{ Enterprise.promo_image.large }}', "ng-if" => 'Enterprise.promo_image' } = f.file_field :promo_image - %a.button.red{ href: '', ng: {click: 'removePromoImage()', if: 'Enterprise.promo_image'} } + %a.button.red{ "href" => '', "ng-click" => 'removePromoImage()', "ng-if" => 'Enterprise.promo_image' } = t('.remove_promo_image') diff --git a/app/views/admin/enterprises/form/_permalink.html.haml b/app/views/admin/enterprises/form/_permalink.html.haml index 5c2a43a7b0..dabc9098c0 100644 --- a/app/views/admin/enterprises/form/_permalink.html.haml +++ b/app/views/admin/enterprises/form/_permalink.html.haml @@ -1,4 +1,4 @@ -.permalink#permalink{ data: { controller: 'permalink', permalink: { 'initial-permalink-value': @enterprise.permalink, 'url-value': check_permalink_enterprises_url } }} +.permalink#permalink{ "data-controller" => 'permalink', "data-permalink-initial-permalink-value" => @enterprise.permalink, "data-permalink-url-value" => check_permalink_enterprises_url } - unless @enterprise.sells == 'none' .row .three.columns.alpha @@ -7,12 +7,12 @@ .eight.columns = text_field_tag "enterprise[permalink]", @enterprise.permalink, data: { action: "input->permalink#validate", "permalink-target": "permalinkField" } .two.columns.omega - %div{ style: "width: 30px; height: 30px;", class: "hidden", data: { "permalink-target": "spinner" } } + %div{ "style" => "width: 30px; height: 30px;", "class" => "hidden", "data-permalink-target" => "spinner" } = render partial: "components/admin_spinner" - %span.available.hidden{data: { "permalink-target": "available" }} + %span.available.hidden{ "data-permalink-target" => "available" } = t('available') %i.icon-ok-sign - %span.unavailable.hidden{data: { "permalink-target": "unavailable" }} + %span.unavailable.hidden{ "data-permalink-target" => "unavailable" } = t('js.unavailable') %i.icon-remove-sign diff --git a/app/views/admin/enterprises/form/_primary_details.html.haml b/app/views/admin/enterprises/form/_primary_details.html.haml index 04609e9b58..dff31486cd 100644 --- a/app/views/admin/enterprises/form/_primary_details.html.haml +++ b/app/views/admin/enterprises/form/_primary_details.html.haml @@ -32,7 +32,7 @@ .four.columns.omega = f.radio_button :sells, "any", 'ng-model' => 'Enterprise.sells', data: {action: "change->primary-details#enterpriseSellsChanged"} = f.label :sells, t('.any'), value: "any" - %span{ style: "width: 30px; height: 30px;", class: "hidden", data: { "primary-details-target": "spinner" } } + %span{ "style" => "width: 30px; height: 30px;", "class" => "hidden", "data-primary-details-target" => "spinner" } = render partial: "components/admin_spinner" .row .three.columns.alpha diff --git a/app/views/admin/enterprises/form/_shop_preferences.html.haml b/app/views/admin/enterprises/form/_shop_preferences.html.haml index be2d5d2045..569b775871 100644 --- a/app/views/admin/enterprises/form/_shop_preferences.html.haml +++ b/app/views/admin/enterprises/form/_shop_preferences.html.haml @@ -23,17 +23,13 @@ = radio_button :enterprise, :preferred_shopfront_product_sorting_method, :by_category, { 'ng-model' => 'Enterprise.preferred_shopfront_product_sorting_method' } = label :enterprise, :preferred_shopfront_product_sorting_method_by_category, t('.shopfront_sort_by_category') .eight.columns.omega - %textarea.fullwidth{ id: 'enterprise_preferred_shopfront_taxon_order', name: 'enterprise[preferred_shopfront_taxon_order]', rows: 6, - 'ofn-taxon-autocomplete' => '', 'multiple-selection' => 'true', placeholder: t('.shopfront_sort_by_category_placeholder'), - ng: { model: 'Enterprise.preferred_shopfront_taxon_order', readonly: "Enterprise.preferred_shopfront_product_sorting_method != 'by_category'" }} + %textarea.fullwidth{ "id" => 'enterprise_preferred_shopfront_taxon_order', "name" => 'enterprise[preferred_shopfront_taxon_order]', "rows" => 6, "ofn-taxon-autocomplete" => '', "multiple-selection" => 'true', "placeholder" => t('.shopfront_sort_by_category_placeholder'), "ng-model" => 'Enterprise.preferred_shopfront_taxon_order', "ng-readonly" => "Enterprise.preferred_shopfront_product_sorting_method != 'by_category'" } .row .three.columns.alpha = radio_button :enterprise, :preferred_shopfront_product_sorting_method, :by_producer, { 'ng-model' => 'Enterprise.preferred_shopfront_product_sorting_method' } = label :enterprise, :preferred_shopfront_product_sorting_method_by_producer, t('.shopfront_sort_by_producer') .eight.columns.omega - %textarea.fullwidth{ id: 'enterprise_preferred_shopfront_producer_order', name: 'enterprise[preferred_shopfront_producer_order]', rows: 6, - 'ofn-producer-autocomplete' => '', 'multiple-selection' => 'true', placeholder: t('.shopfront_sort_by_producer_placeholder'), - ng: { model: 'Enterprise.preferred_shopfront_producer_order', readonly: "Enterprise.preferred_shopfront_product_sorting_method != 'by_producer'" }} + %textarea.fullwidth{ "id" => 'enterprise_preferred_shopfront_producer_order', "name" => 'enterprise[preferred_shopfront_producer_order]', "rows" => 6, "ofn-producer-autocomplete" => '', "multiple-selection" => 'true', "placeholder" => t('.shopfront_sort_by_producer_placeholder'), "ng-model" => 'Enterprise.preferred_shopfront_producer_order', "ng-readonly" => "Enterprise.preferred_shopfront_product_sorting_method != 'by_producer'" } .row .three.columns.alpha @@ -56,7 +52,7 @@ = f.radio_button :require_login, true, "ng-model" => "Enterprise.require_login", "ng-value" => "true" = f.label :require_login, t('.shopfront_requires_login_true'), value: :true -.row{ng: {if: "!Enterprise.require_login"}} +.row{ "ng-if" => "!Enterprise.require_login" } .three.columns.alpha %label= t '.allow_guest_orders' %div{'ofn-with-tip' => t('.allow_guest_orders_tip')} @@ -67,7 +63,7 @@ .five.columns.omega = f.radio_button :allow_guest_orders, false, "ng-model" => "Enterprise.allow_guest_orders", "ng-value" => "false" = f.label :allow_guest_orders, t('.allow_guest_orders_false'), value: :false - .row.warning{ng: {show: 'Enterprise.allow_guest_orders && Enterprise.allow_order_changes'}} + .row.warning{ "ng-show" => 'Enterprise.allow_guest_orders && Enterprise.allow_order_changes' } .eight.columns.alpha.omega %i.icon-warning-sign = t '.recommend_require_login' diff --git a/app/views/admin/enterprises/form/_tag_rules.html.haml b/app/views/admin/enterprises/form/_tag_rules.html.haml index 822ea3f1ff..a51f924a54 100644 --- a/app/views/admin/enterprises/form/_tag_rules.html.haml +++ b/app/views/admin/enterprises/form/_tag_rules.html.haml @@ -1,11 +1,11 @@ -.row{ ng: { controller: "TagRulesCtrl" } } +.row{ "ng-controller" => "TagRulesCtrl" } .eleven.columns.alpha.omega - %ofn-sortable{ axis: "y", handle: ".header", items: '.customer_tag', position: "tagGroup.position", after: { sort: "updateRuleCounts()" } } - .no_tags{ ng: { show: "tagGroups.length == 0" } } + %ofn-sortable{ "axis" => "y", "handle" => ".header", "items" => '.customer_tag', "position" => "tagGroup.position", "after-sort" => "updateRuleCounts()" } + .no_tags{ "ng-show" => "tagGroups.length == 0" } = t('.no_tags_yet') = render 'admin/enterprises/form/tag_rules/default_rules' -# = render 'customer_tags' - .customer_tag{ id: "tg_{{tagGroup.position}}", ng: { repeat: "tagGroup in tagGroups" } } + .customer_tag{ "id" => "tg_{{tagGroup.position}}", "ng-repeat" => "tagGroup in tagGroups" } .header %table %colgroup @@ -16,12 +16,12 @@ %h5 = t('.for_customers_tagged') %td - %tags-with-translation{ object: "tagGroup", max: 1, on: { tag: { added: "updateTagsRulesFor(tagGroup)", removed: "updateTagsRulesFor(tagGroup)" } } } + %tags-with-translation{ "object" => "tagGroup", "max" => 1, "on-tag-added" => "updateTagsRulesFor(tagGroup)", "on-tag-removed" => "updateTagsRulesFor(tagGroup)" } - .no_rules{ ng: { show: "tagGroup.rules.length == 0" } } + .no_rules{ "ng-show" => "tagGroup.rules.length == 0" } = t('.no_rules_yet') - .tag_rule{ ng: { repeat: "rule in tagGroup.rules" } } + .tag_rule{ "ng-repeat" => "rule in tagGroup.rules" } .add_rule.text-center %input.button.icon-plus{ type: 'button', value: t('.add_new_rule'), "add-new-rule-to" => "addNewRuleTo", "tag-group" => "tagGroup", "new-tag-rule-dialog" => true } .add_tag - %input.button.red.icon-plus{ type: 'button', value: t('.add_new_tag'), ng: { click: 'addNewTag()' } } + %input.button.red.icon-plus{ "type" => 'button', "value" => t('.add_new_tag'), "ng-click" => 'addNewTag()' } diff --git a/app/views/admin/enterprises/form/_users.html.haml b/app/views/admin/enterprises/form/_users.html.haml index 8d33a27132..c652a3da3f 100644 --- a/app/views/admin/enterprises/form/_users.html.haml +++ b/app/views/admin/enterprises/form/_users.html.haml @@ -21,8 +21,8 @@ = render partial: 'admin/shared/whats_this_tooltip', locals: {tooltip_text: t('.contact_tip')} .eight.columns.omega - if full_permissions - %select.select2.fullwidth{id: 'receives_notifications_dropdown', name: 'receives_notifications', ng: {model: 'receivesNotifications', init: "receivesNotifications = '#{@enterprise.contact.id}'"}} - %option{ng: {repeat: 'user in Enterprise.users', selected: "user.id == #{@enterprise.contact.id}", hide: '!user.confirmed'}, value: '{{user.id}}'} + %select.select2.fullwidth{ "id" => 'receives_notifications_dropdown', "name" => 'receives_notifications', "ng-model" => 'receivesNotifications', "ng-init" => "receivesNotifications = '#{@enterprise.contact.id}'" } + %option{ "value" => '{{user.id}}', "ng-repeat" => 'user in Enterprise.users', "ng-selected" => "user.id == #{@enterprise.contact.id}", "ng-hide" => '!user.confirmed' } {{user.email}} - else = @enterprise.contact.email @@ -41,16 +41,16 @@ - # Ignore this input in the submit = hidden_field_tag :ignored, nil, class: "select2 fullwidth", 'user-select' => 'newManager', 'ng-model' => 'newManager' %td.actions - %tr.animate-repeat{ id: "manager-{{manager.id}}", ng: { repeat: 'manager in Enterprise.users' }} + %tr.animate-repeat{ "id" => "manager-{{manager.id}}", "ng-repeat" => 'manager in Enterprise.users' } %td = hidden_field_tag "enterprise[user_ids][]", nil, multiple: true, 'ng-value' => 'manager.id' {{ manager.email }} - %i.confirmation.confirmed.fa.fa-check-circle{ 'ofn-with-tip' => t('.email_confirmed'), ng: {show: 'manager.confirmed'} } - %i.confirmation.unconfirmed.fa.fa-exclamation-triangle{ 'ofn-with-tip' => t('.email_not_confirmed'), ng: {show: '!manager.confirmed'} } - %i.role.contact.fa.fa-envelope-o{ 'ofn-with-tip' => t('.contact'), ng: {show: 'manager.id == receivesNotifications'} } - %i.role.owner.fa.fa-star{ 'ofn-with-tip' => t('.owner'), ng: {show: 'manager.id == Enterprise.owner.id'} } + %i.confirmation.confirmed.fa.fa-check-circle{ "ofn-with-tip" => t('.email_confirmed'), "ng-show" => 'manager.confirmed' } + %i.confirmation.unconfirmed.fa.fa-exclamation-triangle{ "ofn-with-tip" => t('.email_not_confirmed'), "ng-show" => '!manager.confirmed' } + %i.role.contact.fa.fa-envelope-o{ "ofn-with-tip" => t('.contact'), "ng-show" => 'manager.id == receivesNotifications' } + %i.role.owner.fa.fa-star{ "ofn-with-tip" => t('.owner'), "ng-show" => 'manager.id == Enterprise.owner.id' } %td.actions - %a{ ng: {click: 'removeManager(manager)', class: "{disabled: manager.id == Enterprise.owner.id || manager.id == receivesNotifications}"}, :class => "icon-trash no-text" } + %a{ "class" => "icon-trash no-text", "ng-click" => 'removeManager(manager)', "ng-class" => "{disabled: manager.id == Enterprise.owner.id || manager.id == receivesNotifications}" } - else - @enterprise.users.each do |manager| diff --git a/app/views/admin/enterprises/form/tag_rules/_default_rules.html.haml b/app/views/admin/enterprises/form/tag_rules/_default_rules.html.haml index a58a71d8de..76ad01e45f 100644 --- a/app/views/admin/enterprises/form/tag_rules/_default_rules.html.haml +++ b/app/views/admin/enterprises/form/tag_rules/_default_rules.html.haml @@ -8,9 +8,9 @@ %h5 = t('.by_default') %i.text-big.icon-question-sign{ "data-controller": "help-modal-link", "data-action": "click->help-modal-link#open", "data-help-modal-link-target-value": "tag_rule_help_modal" } - .no_rules{ ng: { show: "defaultTagGroup.rules.length == 0" } } + .no_rules{ "ng-show" => "defaultTagGroup.rules.length == 0" } = t('.no_rules_yet') - .tag_rule{ ng: { repeat: "rule in defaultTagGroup.rules" } } + .tag_rule{ "ng-repeat" => "rule in defaultTagGroup.rules" } .add_rule.text-center %input.button.icon-plus{ type: 'button', value: t('.add_new_button'), "add-new-rule-to" => "addNewRuleTo", "tag-group" => "defaultTagGroup", "new-tag-rule-dialog" => true } diff --git a/app/views/admin/enterprises/new.html.haml b/app/views/admin/enterprises/new.html.haml index 26a34ad45f..c149a805b6 100644 --- a/app/views/admin/enterprises/new.html.haml +++ b/app/views/admin/enterprises/new.html.haml @@ -16,5 +16,5 @@ = form_for [main_app, :admin, @enterprise], html: { "nav-check" => '', "nav-callback" => '' } do |f| .row - .twelve.columns.fullwidth_inputs{ ng: { controller: "NewEnterpriseController" } } + .twelve.columns.fullwidth_inputs{ "ng-controller" => "NewEnterpriseController" } = render 'new_form', f: f, scope: 'admin.enterprises.form' diff --git a/app/views/admin/order_cycles/_exchange_form.html.haml b/app/views/admin/order_cycles/_exchange_form.html.haml index 94481b1f13..6d06bdd4bc 100644 --- a/app/views/admin/order_cycles/_exchange_form.html.haml +++ b/app/views/admin/order_cycles/_exchange_form.html.haml @@ -1,4 +1,4 @@ -%tr{ ng: { class: "'#{type} #{type}-{{ exchange.enterprise_id }}'" } } +%tr{ "ng-class" => "'#{type} #{type}-{{ exchange.enterprise_id }}'" } %td{:class => "#{type}_name"} {{ enterprises[exchange.enterprise_id].name }} %td.products.panel-toggle.text-center{ name: "products" } {{ exchangeSelectedVariants(exchange) }} / {{ exchangeTotalVariants(exchange) }} @@ -7,7 +7,7 @@ %td.receival-details = text_field_tag 'order_cycle_incoming_exchange_{{ $index }}_receival_instructions', '', 'id' => 'order_cycle_incoming_exchange_{{ $index }}_receival_instructions', 'placeholder' => t('.receival_instructions_placeholder'), 'ng-model' => 'exchange.receival_instructions' - if type == 'distributor' - %td.tags.panel-toggle.text-center{ name: "tags", ng: { if: 'enterprises[exchange.enterprise_id].managed || order_cycle.viewing_as_coordinator' } } + %td.tags.panel-toggle.text-center{ "name" => "tags", "ng-if" => 'enterprises[exchange.enterprise_id].managed || order_cycle.viewing_as_coordinator' } {{ exchange.tags.length }} %td.collection-details = text_field_tag 'order_cycle_outgoing_exchange_{{ $index }}_pickup_time', '', 'ng-init' => 'setPickupTimeFieldDirty($index, exchange.pickup_time)', 'id' => 'order_cycle_outgoing_exchange_{{ $index }}_pickup_time', 'required' => 'required', 'placeholder' => t('.pickup_time_placeholder'), 'ng-model' => 'exchange.pickup_time', 'ng-disabled' => '!enterprises[exchange.enterprise_id].managed && !order_cycle.viewing_as_coordinator', 'maxlength' => 35 @@ -16,7 +16,7 @@ = text_field_tag 'order_cycle_outgoing_exchange_{{ $index }}_pickup_instructions', '', 'id' => 'order_cycle_outgoing_exchange_{{ $index }}_pickup_instructions', 'placeholder' => t('.pickup_instructions_placeholder'), 'ng-model' => 'exchange.pickup_instructions', 'ng-disabled' => '!enterprises[exchange.enterprise_id].managed && !order_cycle.viewing_as_coordinator' %span.icon-question-sign{'ofn-with-tip' => t('.pickup_instructions_tip')} %td.fees - %ol{ ng: { show: 'enterprises[exchange.enterprise_id].managed || order_cycle.viewing_as_coordinator' } } + %ol{ "ng-show" => 'enterprises[exchange.enterprise_id].managed || order_cycle.viewing_as_coordinator' } %li{'ng-repeat' => 'enterprise_fee in exchange.enterprise_fees'} = select_tag 'order_cycle_{{ exchangeDirection(exchange) }}_exchange_{{ $parent.$index }}_enterprise_fees_{{ $index }}_enterprise_id', nil, {'id' => 'order_cycle_{{ exchangeDirection(exchange) }}_exchange_{{ $parent.$index }}_enterprise_fees_{{ $index }}_enterprise_id', 'ng-model' => 'enterprise_fee.enterprise_id', 'ng-options' => 'enterprise.id as enterprise.name for enterprise in enterprisesWithFees()'} diff --git a/app/views/admin/order_cycles/_filters.html.haml b/app/views/admin/order_cycles/_filters.html.haml index a798f0ebe4..776a0d4bda 100644 --- a/app/views/admin/order_cycles/_filters.html.haml +++ b/app/views/admin/order_cycles/_filters.html.haml @@ -2,20 +2,20 @@ .filter.four.columns.alpha %label{ :for => 'query' }=t('admin.quick_search') %br - %input.fullwidth{ :type => "text", :id => 'query', ng: { model: 'query' }, placeholder: t(".search_by_order_cycle_name") } + %input.fullwidth{ "type" => "text", "id" => 'query', "placeholder" => t(".search_by_order_cycle_name"), "ng-model" => 'query' } .filter_select.four.columns %label{ :for => 'involving_filter' }=t('.involving') %br - %input.ofn-select2.fullwidth{ id: 'involving_filter', type: 'number', blank: "{id: 0, name: '#{j t(".any_enterprise")}'}", data: 'enterprises', ng: { model: 'involvingFilter' } } + %input.ofn-select2.fullwidth{ "id" => 'involving_filter', "type" => 'number', "blank" => "{id: 0, name: '#{j t(".any_enterprise")}'}", "data" => 'enterprises', "ng-model" => 'involvingFilter' } - if subscriptions_enabled? .filter_select.four.columns %label{ :for => 'schedule_filter' }=t('admin.order_cycles.index.schedule') %br - %input.ofn-select2.fullwidth{ id: 'schedule_filter', type: 'number', blank: "{id: 0, name: '#{j t(".any_schedule")}'}", data: 'schedules', ng: { model: 'scheduleFilter' } } + %input.ofn-select2.fullwidth{ "id" => 'schedule_filter', "type" => 'number', "blank" => "{id: 0, name: '#{j t(".any_schedule")}'}", "data" => 'schedules', "ng-model" => 'scheduleFilter' } .one.columns   - else .five.columns   .filter_clear.three.columns.omega %label{ :for => 'clear_all_filters' } %br - %input.red.fullwidth{ :type => 'button', :id => 'clear_all_filters', :value => "#{t('admin.clear_all')}", ng: { click: "resetSelectFilters()" } } + %input.red.fullwidth{ "type" => 'button', "id" => 'clear_all_filters', "value" => "#{t('admin.clear_all')}", "ng-click" => "resetSelectFilters()" } diff --git a/app/views/admin/order_cycles/_header.html.haml b/app/views/admin/order_cycles/_header.html.haml index 0d3f9fba8e..756bc2cb5c 100644 --- a/app/views/admin/order_cycles/_header.html.haml +++ b/app/views/admin/order_cycles/_header.html.haml @@ -1,35 +1,35 @@ %colgroup - %col{ ng: { show: 'columns.name.visible' } } - %col{ ng: { show: 'columns.schedules.visible' } } - %col{ ng: { show: 'columns.open.visible' }, style: 'width: 20%;' } - %col{ ng: { show: 'columns.close.visible' }, style: 'width: 20%;' } + %col{ "ng-show" => 'columns.name.visible' } + %col{ "ng-show" => 'columns.schedules.visible' } + %col{ "style" => 'width: 20%;', "ng-show" => 'columns.open.visible' } + %col{ "style" => 'width: 20%;', "ng-show" => 'columns.close.visible' } - unless simple_index - %col{ ng: { show: 'columns.producers.visible' } } - %col{ ng: { show: 'columns.coordinator.visible' } } - %col{ ng: { show: 'columns.shops.visible' } } - %col{ ng: { show: 'columns.products.visible' } } + %col{ "ng-show" => 'columns.producers.visible' } + %col{ "ng-show" => 'columns.coordinator.visible' } + %col{ "ng-show" => 'columns.shops.visible' } + %col{ "ng-show" => 'columns.products.visible' } %col{ style: 'width: 5%;' } %col{ style: 'width: 5%;' } %col{ style: 'width: 5%;' } %thead %tr - %th{ ng: { show: 'columns.name.visible' } } + %th{ "ng-show" => 'columns.name.visible' } =t :name - %th{ ng: { show: 'columns.schedules.visible' } } + %th{ "ng-show" => 'columns.schedules.visible' } =t('admin.order_cycles.index.schedules') - %th{ ng: { show: 'columns.open.visible' } } + %th{ "ng-show" => 'columns.open.visible' } =t :open - %th{ ng: { show: 'columns.close.visible' } } + %th{ "ng-show" => 'columns.close.visible' } =t :close - unless simple_index - %th{ ng: { show: 'columns.producers.visible' } } + %th{ "ng-show" => 'columns.producers.visible' } =t :label_producers - %th{ ng: { show: 'columns.coordinator.visible' } } + %th{ "ng-show" => 'columns.coordinator.visible' } =t :coordinator - %th{ ng: { show: 'columns.shops.visible' } } + %th{ "ng-show" => 'columns.shops.visible' } =t :label_shops - %th{ ng: { show: 'columns.products.visible' } } + %th{ "ng-show" => 'columns.products.visible' } =t :products %th.actions %th.actions diff --git a/app/views/admin/order_cycles/_loading_flash.html.haml b/app/views/admin/order_cycles/_loading_flash.html.haml index 64689ffe29..231ba6a695 100644 --- a/app/views/admin/order_cycles/_loading_flash.html.haml +++ b/app/views/admin/order_cycles/_loading_flash.html.haml @@ -1,6 +1,6 @@ -%div.sixteen.columns.alpha.omega#loading{ ng: { cloak: true, if: 'RequestMonitor.loading' } } +%div.sixteen.columns.alpha.omega#loading{ "ng-cloak" => true, "ng-if" => 'RequestMonitor.loading' } = render partial: "components/admin_spinner" - %h1{ ng: { hide: 'orderCycles.length > 0' } } + %h1{ "ng-hide" => 'orderCycles.length > 0' } = t('.loading_order_cycles') - %h1{ ng: { show: 'orderCycles.length > 0' } } + %h1{ "ng-show" => 'orderCycles.length > 0' } = t('.loading') diff --git a/app/views/admin/order_cycles/_name_and_timing_form.html.haml b/app/views/admin/order_cycles/_name_and_timing_form.html.haml index 172a5763e2..f66080923f 100644 --- a/app/views/admin/order_cycles/_name_and_timing_form.html.haml +++ b/app/views/admin/order_cycles/_name_and_timing_form.html.haml @@ -35,11 +35,6 @@ = f.label :schedule_ids, t('admin.order_cycles.index.schedules') .six.columns - if viewing_as_coordinator_of?(@order_cycle) - %input.fullwidth.ofn-select2#schedule_ids{ name: 'order_cycle[schedule_ids]', - data: 'schedules', - multiple: 'true', - placeholder: t('admin.please_select'), - filter: '{viewing_as_coordinator: true}', - ng: { model: 'order_cycle.schedule_ids' } } + %input.fullwidth.ofn-select2#schedule_ids{ "name" => 'order_cycle[schedule_ids]', "data" => 'schedules', "multiple" => 'true', "placeholder" => t('admin.please_select'), "filter" => '{viewing_as_coordinator: true}', "ng-model" => 'order_cycle.schedule_ids' } - else %schedule-list{ 'order-cycle' => 'order_cycle' } diff --git a/app/views/admin/order_cycles/_row.html.haml b/app/views/admin/order_cycles/_row.html.haml index 4508858a1d..2d2f90a98a 100644 --- a/app/views/admin/order_cycles/_row.html.haml +++ b/app/views/admin/order_cycles/_row.html.haml @@ -1,39 +1,39 @@ -%tr{ class: "order-cycle-{{orderCycle.id}} {{orderCycle.status}}", ng: { repeat: 'orderCycle in orderCycles | schedule:scheduleFilter | involving:involvingFilter | filter:{name: query} track by orderCycle.id' } } - %td.name{ ng: { show: 'columns.name.visible' } } - %input{ id: 'oc{{::orderCycle.id}}_name', name: 'oc{{::orderCycle.id}}[name]', type: 'text', ng: { model: 'orderCycle.name', disabled: '!orderCycle.viewing_as_coordinator' } } - %td.schedules{ ng: { show: 'columns.schedules.visible' } } - %span{ ng: { repeat: 'schedule in orderCycle.schedules'} } +%tr{ "class" => "order-cycle-{{orderCycle.id}} {{orderCycle.status}}", "ng-repeat" => 'orderCycle in orderCycles | schedule:scheduleFilter | involving:involvingFilter | filter:{name: query} track by orderCycle.id' } + %td.name{ "ng-show" => 'columns.name.visible' } + %input{ "id" => 'oc{{::orderCycle.id}}_name', "name" => 'oc{{::orderCycle.id}}[name]', "type" => 'text', "ng-model" => 'orderCycle.name', "ng-disabled" => '!orderCycle.viewing_as_coordinator' } + %td.schedules{ "ng-show" => 'columns.schedules.visible' } + %span{ "ng-repeat" => 'schedule in orderCycle.schedules' } %a{ 'schedule-dialog' => true, 'schedule-id' => '{{schedule.id}}' } {{ schedule.name + ($last ? '' : ',') }} - %span{ ng: { show: 'orderCycle.schedules.length == 0'}} None - %td.orders_open_at{ ng: { show: 'columns.open.visible' } } - %input.datetimepicker{ id: 'oc{{::orderCycle.id}}_orders_open_at', name: 'oc{{::orderCycle.id}}[orders_open_at]', type: 'text', ng: { if: 'orderCycle.viewing_as_coordinator', model: 'orderCycle.orders_open_at' }, data: { controller: "flatpickr", "flatpickr-enable-time-value": true }, 'change-warning' => 'orderCycle' } - %input{ id: 'oc{{::orderCycle.id}}_orders_open_at', name: 'oc{{::orderCycle.id}}[orders_open_at]', type: 'text', ng: { if: '!orderCycle.viewing_as_coordinator', model: 'orderCycle.orders_open_at'}, disabled: true } - %td.orders_close_at{ ng: { show: 'columns.close.visible' } } - %input.datetimepicker{ id: 'oc{{::orderCycle.id}}_orders_close_at', name: 'oc{{::orderCycle.id}}[orders_close_at]', type: 'text', ng: { if: 'orderCycle.viewing_as_coordinator', model: 'orderCycle.orders_close_at' }, data: { controller: "flatpickr", "flatpickr-enable-time-value": true }, 'change-warning' => 'orderCycle' } - %input{ id: 'oc{{::orderCycle.id}}_orders_close_at', name: 'oc{{::orderCycle.id}}[orders_close_at]', type: 'text', ng: { if: '!orderCycle.viewing_as_coordinator', model: 'orderCycle.orders_close_at'}, disabled: true } + %span{ "ng-show" => 'orderCycle.schedules.length == 0' } None + %td.orders_open_at{ "ng-show" => 'columns.open.visible' } + %input.datetimepicker{ "id" => 'oc{{::orderCycle.id}}_orders_open_at', "name" => 'oc{{::orderCycle.id}}[orders_open_at]', "type" => 'text', "change-warning" => 'orderCycle', "ng-if" => 'orderCycle.viewing_as_coordinator', "ng-model" => 'orderCycle.orders_open_at', "data-controller" => "flatpickr", "data-flatpickr-enable-time-value" => true } + %input{ "id" => 'oc{{::orderCycle.id}}_orders_open_at', "name" => 'oc{{::orderCycle.id}}[orders_open_at]', "type" => 'text', "disabled" => true, "ng-if" => '!orderCycle.viewing_as_coordinator', "ng-model" => 'orderCycle.orders_open_at' } + %td.orders_close_at{ "ng-show" => 'columns.close.visible' } + %input.datetimepicker{ "id" => 'oc{{::orderCycle.id}}_orders_close_at', "name" => 'oc{{::orderCycle.id}}[orders_close_at]', "type" => 'text', "change-warning" => 'orderCycle', "ng-if" => 'orderCycle.viewing_as_coordinator', "ng-model" => 'orderCycle.orders_close_at', "data-controller" => "flatpickr", "data-flatpickr-enable-time-value" => true } + %input{ "id" => 'oc{{::orderCycle.id}}_orders_close_at', "name" => 'oc{{::orderCycle.id}}[orders_close_at]', "type" => 'text', "disabled" => true, "ng-if" => '!orderCycle.viewing_as_coordinator', "ng-model" => 'orderCycle.orders_close_at' } - unless simple_index - %td.producers{ ng: { show: 'columns.producers.visible' } } - %span{'ofn-with-tip' => '{{ orderCycle.producerNames }}', ng: { show: 'orderCycle.producers.length > 3' } } + %td.producers{ "ng-show" => 'columns.producers.visible' } + %span{ "ofn-with-tip" => '{{ orderCycle.producerNames }}', "ng-show" => 'orderCycle.producers.length > 3' } {{ orderCycle.producers.length }} = t('.suppliers') - %span{ ng: { hide: 'orderCycle.producers.length > 3', bind: 'orderCycle.producerNames' } } - %td.coordinator{ ng: { show: 'columns.coordinator.visible', bind: { html: 'orderCycle.coordinator.name'} } } - %td.shops{ ng: { show: 'columns.shops.visible' } } - %span{'ofn-with-tip' => '{{ orderCycle.shopNames }}', ng: { show: 'orderCycle.shops.length > 3' } } + %span{ "ng-hide" => 'orderCycle.producers.length > 3', "ng-bind" => 'orderCycle.producerNames' } + %td.coordinator{ "ng-show" => 'columns.coordinator.visible', "ng-bind-html" => 'orderCycle.coordinator.name' } + %td.shops{ "ng-show" => 'columns.shops.visible' } + %span{ "ofn-with-tip" => '{{ orderCycle.shopNames }}', "ng-show" => 'orderCycle.shops.length > 3' } {{ orderCycle.shops.length }} = t('.distributors') - %span{ ng: { hide: 'orderCycle.shops.length > 3', bind: 'orderCycle.shopNames' } } + %span{ "ng-hide" => 'orderCycle.shops.length > 3', "ng-bind" => 'orderCycle.shopNames' } - %td.products{ ng: { show: 'columns.products.visible' } } + %td.products{ "ng-show" => 'columns.products.visible' } %span {{orderCycle.variant_count}} = t('.variants') %td.actions - %a.edit-order-cycle.icon-edit.no-text{ ng: { href: '{{orderCycle.edit_path}}'}, 'ofn-with-tip' => t(:edit) } - %td.actions{ ng: { if: 'orderCycle.viewing_as_coordinator' } } - %a.clone-order-cycle.icon-copy.no-text{ ng: { href: '{{orderCycle.clone_path}}'}, 'ofn-with-tip' => t(:clone) } - %td.actions{ ng: { if: 'orderCycle.deletable && orderCycle.viewing_as_coordinator' }} - %a.delete-order-cycle.icon-trash.no-text{ ng: { href: '{{orderCycle.delete_path}}'}, data: { method: 'delete', confirm: t(:are_you_sure), "ujs-navigate": "false" }, 'ofn-with-tip' => t(:remove) } + %a.edit-order-cycle.icon-edit.no-text{ "ofn-with-tip" => t(:edit), "ng-href" => '{{orderCycle.edit_path}}' } + %td.actions{ "ng-if" => 'orderCycle.viewing_as_coordinator' } + %a.clone-order-cycle.icon-copy.no-text{ "ofn-with-tip" => t(:clone), "ng-href" => '{{orderCycle.clone_path}}' } + %td.actions{ "ng-if" => 'orderCycle.deletable && orderCycle.viewing_as_coordinator' } + %a.delete-order-cycle.icon-trash.no-text{ "ofn-with-tip" => t(:remove), "ng-href" => '{{orderCycle.delete_path}}', "data-method" => 'delete', "data-confirm" => t(:are_you_sure), "data-ujs-navigate" => "false" } diff --git a/app/views/admin/order_cycles/_show_more.html.haml b/app/views/admin/order_cycles/_show_more.html.haml index 22191c4e38..bbf4c1d512 100644 --- a/app/views/admin/order_cycles/_show_more.html.haml +++ b/app/views/admin/order_cycles/_show_more.html.haml @@ -1,4 +1,4 @@ -.text-center.margin-bottom-50{ ng: { hide: "RequestMonitor.loading" } } - %input{ type: 'button', value: "#{t('admin.show_n_more', num: '30')} #{t(:days)}", ng: { click: 'showMore(30)' } } +.text-center.margin-bottom-50{ "ng-hide" => "RequestMonitor.loading" } + %input{ "type" => 'button', "value" => "#{t('admin.show_n_more', num: '30')} #{t(:days)}", "ng-click" => 'showMore(30)' } - %input{ type: 'button', value: "#{t('admin.show_n_more', num: '90')} #{t(:days)}", ng: { click: 'showMore(90)' } } + %input{ "type" => 'button', "value" => "#{t('admin.show_n_more', num: '90')} #{t(:days)}", "ng-click" => 'showMore(90)' } diff --git a/app/views/admin/order_cycles/_simple_form.html.haml b/app/views/admin/order_cycles/_simple_form.html.haml index 8b8ac6f200..c9a0369def 100644 --- a/app/views/admin/order_cycles/_simple_form.html.haml +++ b/app/views/admin/order_cycles/_simple_form.html.haml @@ -15,9 +15,9 @@ = label_tag t('.products') %table.exchanges - %tbody{ng: {repeat: "exchange in order_cycle.incoming_exchanges"}} + %tbody{ "ng-repeat" => "exchange in order_cycle.incoming_exchanges" } %tr.products - %td{ ng: { include: "'admin/panels/exchange_products_simple.html'" } } + %td{ "ng-include" => "'admin/panels/exchange_products_simple.html'" } %br = label_tag t('.tags') diff --git a/app/views/admin/order_cycles/edit.html.haml b/app/views/admin/order_cycles/edit.html.haml index 3a67c072bd..0c7943e3a9 100644 --- a/app/views/admin/order_cycles/edit.html.haml +++ b/app/views/admin/order_cycles/edit.html.haml @@ -6,7 +6,7 @@ - url = main_app.notify_producers_admin_order_cycle_path - confirm_msg = "#{t('.notify_producers_tip')} #{t(:are_you_sure)}" - %a.button.icon-email.with-tip{ href: url, data: { method: :post, "ujs-navigate": "false", confirm: confirm_msg }, 'data-powertip': t('.notify_producers_tip') } + %a.button.icon-email.with-tip{ "href" => url, "data-powertip" => t('.notify_producers_tip'), "data-method" => :post, "data-ujs-navigate" => "false", "data-confirm" => confirm_msg } = mails_sent ? t('.re_notify_producers') : t(:notify_producers) - if mails_sent .badge.icon-ok.success @@ -19,13 +19,13 @@ = form_for [main_app, :admin, @order_cycle], :url => '', :html => {:class => 'ng order_cycle', 'ng-app' => 'admin.orderCycles', 'ng-controller' => ng_controller, name: 'order_cycle_form'} do |f| %save-bar{ dirty: "order_cycle_form.$dirty", persist: "true" } - %input.red{ type: "button", value: t('.save'), ng: { click: "submit($event, null)", disabled: "!order_cycle_form.$dirty || order_cycle_form.$invalid" } } + %input.red{ "type" => "button", "value" => t('.save'), "ng-click" => "submit($event, null)", "ng-disabled" => "!order_cycle_form.$dirty || order_cycle_form.$invalid" } - if @order_cycle.simple? - %input.red{ type: "button", value: t('.save_and_back_to_list'), ng: { click: "submit($event, '#{main_app.admin_order_cycles_path}')", disabled: "!order_cycle_form.$dirty || order_cycle_form.$invalid" } } + %input.red{ "type" => "button", "value" => t('.save_and_back_to_list'), "ng-click" => "submit($event, '#{main_app.admin_order_cycles_path}')", "ng-disabled" => "!order_cycle_form.$dirty || order_cycle_form.$invalid" } - else - %input.red{ type: "button", value: t('.save_and_next'), ng: { click: "submit($event, '#{main_app.admin_order_cycle_incoming_path(@order_cycle)}')", disabled: "!order_cycle_form.$dirty || order_cycle_form.$invalid" } } - %input{ type: "button", value: t('.next'), ng: { click: "cancel('#{main_app.admin_order_cycle_incoming_path(@order_cycle)}')", disabled: "order_cycle_form.$dirty" } } - %input{ type: "button", ng: { value: "order_cycle_form.$dirty ? '#{t('.cancel')}' : '#{t('.back_to_list')}'", click: "cancel('#{main_app.admin_order_cycles_path}')" } } + %input.red{ "type" => "button", "value" => t('.save_and_next'), "ng-click" => "submit($event, '#{main_app.admin_order_cycle_incoming_path(@order_cycle)}')", "ng-disabled" => "!order_cycle_form.$dirty || order_cycle_form.$invalid" } + %input{ "type" => "button", "value" => t('.next'), "ng-click" => "cancel('#{main_app.admin_order_cycle_incoming_path(@order_cycle)}')", "ng-disabled" => "order_cycle_form.$dirty" } + %input{ "type" => "button", "ng-value" => "order_cycle_form.$dirty ? '#{t('.cancel')}' : '#{t('.back_to_list')}'", "ng-click" => "cancel('#{main_app.admin_order_cycles_path}')" } - if @order_cycle.simple? = render 'simple_form', f: f diff --git a/app/views/admin/order_cycles/incoming.html.haml b/app/views/admin/order_cycles/incoming.html.haml index c9f40b9322..5dddf71c3d 100644 --- a/app/views/admin/order_cycles/incoming.html.haml +++ b/app/views/admin/order_cycles/incoming.html.haml @@ -9,10 +9,10 @@ = render 'wizard_progress' %save-bar{ dirty: "order_cycle_form.$dirty", persist: "true" } - %input.red{ type: "button", value: t('.save'), ng: { click: "submit($event, null)", disabled: "!order_cycle_form.$dirty || order_cycle_form.$invalid" } } - %input.red{ type: "button", value: t('.save_and_next'), ng: { click: "submit($event, '#{main_app.admin_order_cycle_outgoing_path(@order_cycle)}')", disabled: "!order_cycle_form.$dirty || order_cycle_form.$invalid" } } - %input{ type: "button", value: t('.next'), ng: { click: "cancel('#{main_app.admin_order_cycle_outgoing_path(@order_cycle)}')", disabled: "order_cycle_form.$dirty" } } - %input{ type: "button", ng: { value: "order_cycle_form.$dirty ? '#{t('.cancel')}' : '#{t('.back_to_list')}'", click: "cancel('#{main_app.admin_order_cycles_path}')" } } + %input.red{ "type" => "button", "value" => t('.save'), "ng-click" => "submit($event, null)", "ng-disabled" => "!order_cycle_form.$dirty || order_cycle_form.$invalid" } + %input.red{ "type" => "button", "value" => t('.save_and_next'), "ng-click" => "submit($event, '#{main_app.admin_order_cycle_outgoing_path(@order_cycle)}')", "ng-disabled" => "!order_cycle_form.$dirty || order_cycle_form.$invalid" } + %input{ "type" => "button", "value" => t('.next'), "ng-click" => "cancel('#{main_app.admin_order_cycle_outgoing_path(@order_cycle)}')", "ng-disabled" => "order_cycle_form.$dirty" } + %input{ "type" => "button", "ng-value" => "order_cycle_form.$dirty ? '#{t('.cancel')}' : '#{t('.back_to_list')}'", "ng-click" => "cancel('#{main_app.admin_order_cycles_path}')" } %fieldset.no-border-bottom %legend{ align: 'center'}= t('.incoming') diff --git a/app/views/admin/order_cycles/index.html.haml b/app/views/admin/order_cycles/index.html.haml index ed53a56ea3..e03e39cf1b 100644 --- a/app/views/admin/order_cycles/index.html.haml +++ b/app/views/admin/order_cycles/index.html.haml @@ -14,19 +14,19 @@ = admin_inject_column_preferences module: 'admin.orderCycles' -%div{ ng: { controller: 'OrderCyclesCtrl' } } +%div{ "ng-controller" => 'OrderCyclesCtrl' } = render 'admin/order_cycles/filters' %hr.divider - .row.controls{ ng: { show: "orderCycles.length > 0" } } + .row.controls{ "ng-show" => "orderCycles.length > 0" } .thirteen.columns.alpha   %columns-dropdown{ action: "#{controller_name}_#{action_name}" } %form{ name: 'order_cycles_form' } %save-bar{ dirty: "order_cycles_form.$dirty", persist: "false" } - %input.red{ type: "button", value: t(:save_changes), ng: { click: "saveAll()", disabled: "!order_cycles_form.$dirty" } } - %table.index#listing_order_cycles{ ng: { show: 'orderCycles.length > 0' } } + %input.red{ "type" => "button", "value" => t(:save_changes), "ng-click" => "saveAll()", "ng-disabled" => "!order_cycles_form.$dirty" } + %table.index#listing_order_cycles{ "ng-show" => 'orderCycles.length > 0' } = render 'admin/order_cycles/header' #, simple_index: simple_index %tbody = render 'admin/order_cycles/row' #, simple_index: simple_index diff --git a/app/views/admin/order_cycles/new.html.haml b/app/views/admin/order_cycles/new.html.haml index 6c35515d2f..c01459082f 100644 --- a/app/views/admin/order_cycles/new.html.haml +++ b/app/views/admin/order_cycles/new.html.haml @@ -9,8 +9,8 @@ %save-bar{ dirty: "order_cycle_form.$dirty", persist: "true" } - if @order_cycle.simple? - custom_redirect_path = main_app.admin_order_cycles_path - %input.red{ type: "button", value: t('.create'), ng: { click: "submit($event, '#{custom_redirect_path}')", disabled: "!order_cycle_form.$dirty || order_cycle_form.$invalid" } } - %input{ type: "button", ng: { value: "order_cycle_form.$dirty ? '#{t('.cancel')}' : '#{t('.back_to_list')}'", click: "cancel('#{main_app.admin_order_cycles_path}')" } } + %input.red{ "type" => "button", "value" => t('.create'), "ng-click" => "submit($event, '#{custom_redirect_path}')", "ng-disabled" => "!order_cycle_form.$dirty || order_cycle_form.$invalid" } + %input{ "type" => "button", "ng-value" => "order_cycle_form.$dirty ? '#{t('.cancel')}' : '#{t('.back_to_list')}'", "ng-click" => "cancel('#{main_app.admin_order_cycles_path}')" } - if @order_cycle.simple? = render 'simple_form', f: f diff --git a/app/views/admin/order_cycles/outgoing.html.haml b/app/views/admin/order_cycles/outgoing.html.haml index d5b148f1cc..4d1ead94c5 100644 --- a/app/views/admin/order_cycles/outgoing.html.haml +++ b/app/views/admin/order_cycles/outgoing.html.haml @@ -9,10 +9,10 @@ = render 'wizard_progress' %save-bar{ dirty: "order_cycle_form.$dirty", persist: "true" } - %input.red{ type: "button", value: t('.save'), ng: { click: "submit($event, null)", disabled: "!order_cycle_form.$dirty || order_cycle_form.$invalid" } } - %input.red{ type: "button", value: t('.save_and_next'), ng: { click: "submit($event, '#{main_app.admin_order_cycle_checkout_options_path(@order_cycle)}')", disabled: "!order_cycle_form.$dirty || order_cycle_form.$invalid" } } - %input{ type: "button", value: t('.next'), ng: { click: "cancel('#{main_app.admin_order_cycle_checkout_options_path(@order_cycle)}')", disabled: "order_cycle_form.$dirty" } } - %input{ type: "button", ng: { value: "order_cycle_form.$dirty ? '#{t('.cancel')}' : '#{t('.back_to_list')}'", click: "cancel('#{main_app.admin_order_cycles_path}')" } } + %input.red{ "type" => "button", "value" => t('.save'), "ng-click" => "submit($event, null)", "ng-disabled" => "!order_cycle_form.$dirty || order_cycle_form.$invalid" } + %input.red{ "type" => "button", "value" => t('.save_and_next'), "ng-click" => "submit($event, '#{main_app.admin_order_cycle_checkout_options_path(@order_cycle)}')", "ng-disabled" => "!order_cycle_form.$dirty || order_cycle_form.$invalid" } + %input{ "type" => "button", "value" => t('.next'), "ng-click" => "cancel('#{main_app.admin_order_cycle_checkout_options_path(@order_cycle)}')", "ng-disabled" => "order_cycle_form.$dirty" } + %input{ "type" => "button", "ng-value" => "order_cycle_form.$dirty ? '#{t('.cancel')}' : '#{t('.back_to_list')}'", "ng-click" => "cancel('#{main_app.admin_order_cycles_path}')" } %fieldset.no-border-bottom %legend{ align: 'center'}= t('.outgoing') @@ -27,7 +27,7 @@ %a{href: '#', 'ng-click' => "OrderCycle.toggleAllProducts('outgoing')"} %span{'ng-show' => "OrderCycle.showProducts['outgoing']"}= t(:collapse_all) %span{'ng-hide' => "OrderCycle.showProducts['outgoing']"}= t(:expand_all) - %th{ ng: { if: 'enterprises[exchange.enterprise_id].managed || order_cycle.viewing_as_coordinator' } } + %th{ "ng-if" => 'enterprises[exchange.enterprise_id].managed || order_cycle.viewing_as_coordinator' } = t('.tags') %th= t('.delivery_details') %th= t('.fees') diff --git a/app/views/admin/product_import/_entries_table.html.haml b/app/views/admin/product_import/_entries_table.html.haml index 6b0dcfdf6e..315ad80882 100644 --- a/app/views/admin/product_import/_entries_table.html.haml +++ b/app/views/admin/product_import/_entries_table.html.haml @@ -5,10 +5,10 @@ %th #{t('admin.product_import.import.line')} - @importer.table_headings.each do |heading| %th= heading - %tr{ng: {repeat: "(line_number, entry) in (entries | entriesFilterValid:'#{entries}')"}} + %tr{ "ng-repeat" => "(line_number, entry) in (entries | entriesFilterValid:'#{entries}')" } %td - %i{ng: {class: "{'fa fa-warning error': (count(entry.errors) > 0), 'fa fa-check-circle success': (count(entry.errors) == 0)}"}} + %i{ "ng-class" => "{'fa fa-warning error': (count(entry.errors) > 0), 'fa fa-check-circle success': (count(entry.errors) == 0)}" } %td {{line_number}} - %td{ng: {repeat: "(attribute, value) in entry.attributes", class: "{'invalid': attribute_invalid(attribute, line_number)}"}} + %td{ "ng-repeat" => "(attribute, value) in entry.attributes", "ng-class" => "{'invalid': attribute_invalid(attribute, line_number)}" } {{value}} diff --git a/app/views/admin/product_import/_errors_list.html.haml b/app/views/admin/product_import/_errors_list.html.haml index 787aabe76b..f19274fe1b 100644 --- a/app/views/admin/product_import/_errors_list.html.haml +++ b/app/views/admin/product_import/_errors_list.html.haml @@ -1,9 +1,9 @@ -%div.import-errors{ng: {controller: 'ImportFeedbackCtrl', repeat: "(line_number, entry ) in (entries | entriesFilterValid:'invalid')"}} +%div.import-errors{ "ng-controller" => 'ImportFeedbackCtrl', "ng-repeat" => "(line_number, entry ) in (entries | entriesFilterValid:'invalid')" } %p.line %strong #{t('admin.product_import.import.item_line')} {{line_number}}: %span {{entry.attributes.name}} - %span{ng: {if: "entry.attributes.display_name"}} + %span{ "ng-if" => "entry.attributes.display_name" } ( {{entry.attributes.display_name}} ) - %p.error{ng: {repeat: "(attribute, error) in entry.errors", show: "ignore_fields.indexOf(attribute) < 0" }} + %p.error{ "ng-repeat" => "(attribute, error) in entry.errors", "ng-show" => "ignore_fields.indexOf(attribute) < 0" }  -  {{error}} diff --git a/app/views/admin/product_import/_import_options.html.haml b/app/views/admin/product_import/_import_options.html.haml index c5c3e32c38..96222d9f6f 100644 --- a/app/views/admin/product_import/_import_options.html.haml +++ b/app/views/admin/product_import/_import_options.html.haml @@ -4,7 +4,7 @@ - @importer.enterprises_index.each do |name, attrs| - if name and attrs[:id] and @importer.permission_by_id?(attrs[:id]) %div.panel-section.import-settings - %div.panel-header{ng: {click: 'togglePanel()', class: '{active: active}'}} + %div.panel-header{ "ng-click" => 'togglePanel()', "ng-class" => '{active: active}' } %div.header-icon.success %i.fa.fa-check-circle %div.header-description diff --git a/app/views/admin/product_import/_import_review.html.haml b/app/views/admin/product_import/_import_review.html.haml index 90d8de9577..a63601eaee 100644 --- a/app/views/admin/product_import/_import_review.html.haml +++ b/app/views/admin/product_import/_import_review.html.haml @@ -1,7 +1,7 @@ %h5= t('admin.product_import.import.validation_overview') %br -%div{ng: {controller: 'ImportFeedbackCtrl'}} +%div{ "ng-controller" => 'ImportFeedbackCtrl' } - if @importer.product_field_errors? .alert-box.warning @@ -9,10 +9,10 @@ %em= @non_updatable_fields.keys.join(', ') + "." = t('.fields_ignored') - %div.panel-section{ng: {controller: 'DropdownPanelsCtrl'}} - %div.panel-header{ng: {click: 'togglePanel()', class: '{active: active && count((entries | entriesFilterValid:"all"))}'}} + %div.panel-section{ "ng-controller" => 'DropdownPanelsCtrl' } + %div.panel-header{ "ng-click" => 'togglePanel()', "ng-class" => '{active: active && count((entries | entriesFilterValid:"all"))}' } %div.header-caret - %i{ng: {class: "{'icon-chevron-down': active, 'icon-chevron-right': !active}", hide: 'count((entries | entriesFilterValid:"all")) == 0'}} + %i{ "ng-class" => "{'icon-chevron-down': active, 'icon-chevron-right': !active}", "ng-hide" => 'count((entries | entriesFilterValid:"all")) == 0' } %div.header-icon.success %i.fa.fa-info-circle.info %div.header-count @@ -20,13 +20,13 @@ {{ count((entries | entriesFilterValid:"all")) }} %div.header-description = t('admin.product_import.import.entries_found') - %div.panel-content{ng: {hide: '!active || count((entries | entriesFilterValid:"all")) == 0'}} + %div.panel-content{ "ng-hide" => '!active || count((entries | entriesFilterValid:"all")) == 0' } = render 'entries_table', entries: 'all' - %div.panel-section{ng: {controller: 'DropdownPanelsCtrl', hide: 'count((entries | entriesFilterValid:"invalid")) == 0'}} - %div.panel-header{ng: {click: 'togglePanel()', class: '{active: active && count((entries | entriesFilterValid:"invalid"))}'}} + %div.panel-section{ "ng-controller" => 'DropdownPanelsCtrl', "ng-hide" => 'count((entries | entriesFilterValid:"invalid")) == 0' } + %div.panel-header{ "ng-click" => 'togglePanel()', "ng-class" => '{active: active && count((entries | entriesFilterValid:"invalid"))}' } %div.header-caret - %i{ng: {class: "{'icon-chevron-down': active, 'icon-chevron-right': !active}", hide: 'count((entries | entriesFilterValid:"invalid")) == 0'}} + %i{ "ng-class" => "{'icon-chevron-down': active, 'icon-chevron-right': !active}", "ng-hide" => 'count((entries | entriesFilterValid:"invalid")) == 0' } %div.header-icon.error %i.fa.fa-warning %div.header-count @@ -34,15 +34,15 @@ {{ count((entries | entriesFilterValid:"invalid")) }} %div.header-description = t('admin.product_import.import.entries_with_errors') - %div.panel-content{ng: {hide: '!active || count((entries | entriesFilterValid:"invalid")) == 0'}} + %div.panel-content{ "ng-hide" => '!active || count((entries | entriesFilterValid:"invalid")) == 0' } = render 'errors_list' %br = render 'entries_table', entries: 'invalid' - %div.panel-section{ng: {controller: 'DropdownPanelsCtrl', hide: 'count((entries | entriesFilterValid:"create_product")) == 0'}} - %div.panel-header{ng: {click: 'togglePanel()', class: '{active: active && count((entries | entriesFilterValid:"create_product"))}'}} + %div.panel-section{ "ng-controller" => 'DropdownPanelsCtrl', "ng-hide" => 'count((entries | entriesFilterValid:"create_product")) == 0' } + %div.panel-header{ "ng-click" => 'togglePanel()', "ng-class" => '{active: active && count((entries | entriesFilterValid:"create_product"))}' } %div.header-caret - %i{ng: {class: "{'icon-chevron-down': active, 'icon-chevron-right': !active}", hide: 'count((entries | entriesFilterValid:"create_product")) == 0'}} + %i{ "ng-class" => "{'icon-chevron-down': active, 'icon-chevron-right': !active}", "ng-hide" => 'count((entries | entriesFilterValid:"create_product")) == 0' } %div.header-icon.success %i.fa.fa-check-circle %div.header-count @@ -50,13 +50,13 @@ {{ count((entries | entriesFilterValid:"create_product")) }} %div.header-description = t('admin.product_import.import.products_to_create') - %div.panel-content{ng: {hide: '!active || count((entries | entriesFilterValid:"create_product")) == 0'}} + %div.panel-content{ "ng-hide" => '!active || count((entries | entriesFilterValid:"create_product")) == 0' } = render 'entries_table', entries: 'create_product' - %div.panel-section{ng: {controller: 'DropdownPanelsCtrl', hide: 'count((entries | entriesFilterValid:"update_product")) == 0'}} - %div.panel-header{ng: {click: 'togglePanel()', class: '{active: active && count((entries | entriesFilterValid:"update_product"))}'}} + %div.panel-section{ "ng-controller" => 'DropdownPanelsCtrl', "ng-hide" => 'count((entries | entriesFilterValid:"update_product")) == 0' } + %div.panel-header{ "ng-click" => 'togglePanel()', "ng-class" => '{active: active && count((entries | entriesFilterValid:"update_product"))}' } %div.header-caret - %i{ng: {class: "{'icon-chevron-down': active, 'icon-chevron-right': !active}", hide: 'count((entries | entriesFilterValid:"update_product")) == 0'}} + %i{ "ng-class" => "{'icon-chevron-down': active, 'icon-chevron-right': !active}", "ng-hide" => 'count((entries | entriesFilterValid:"update_product")) == 0' } %div.header-icon.success %i.fa.fa-check-circle %div.header-count @@ -64,13 +64,13 @@ {{ count((entries | entriesFilterValid:"update_product")) }} %div.header-description = t('admin.product_import.import.products_to_update') - %div.panel-content{ng: {hide: '!active || count((entries | entriesFilterValid:"update_product")) == 0'}} + %div.panel-content{ "ng-hide" => '!active || count((entries | entriesFilterValid:"update_product")) == 0' } = render 'entries_table', entries: 'update_product' - %div.panel-section{ng: {controller: 'DropdownPanelsCtrl', hide: 'count((entries | entriesFilterValid:"create_inventory")) == 0'}} - %div.panel-header{ng: {click: 'togglePanel()', class: '{active: active && count((entries | entriesFilterValid:"create_inventory"))}'}} + %div.panel-section{ "ng-controller" => 'DropdownPanelsCtrl', "ng-hide" => 'count((entries | entriesFilterValid:"create_inventory")) == 0' } + %div.panel-header{ "ng-click" => 'togglePanel()', "ng-class" => '{active: active && count((entries | entriesFilterValid:"create_inventory"))}' } %div.header-caret - %i{ng: {class: "{'icon-chevron-down': active, 'icon-chevron-right': !active}", hide: 'count((entries | entriesFilterValid:"create_inventory")) == 0'}} + %i{ "ng-class" => "{'icon-chevron-down': active, 'icon-chevron-right': !active}", "ng-hide" => 'count((entries | entriesFilterValid:"create_inventory")) == 0' } %div.header-icon.success %i.fa.fa-check-circle %div.header-count @@ -78,13 +78,13 @@ {{ count((entries | entriesFilterValid:"create_inventory")) }} %div.header-description = t('admin.product_import.import.inventory_to_create') - %div.panel-content{ng: {hide: '!active || count((entries | entriesFilterValid:"create_inventory")) == 0'}} + %div.panel-content{ "ng-hide" => '!active || count((entries | entriesFilterValid:"create_inventory")) == 0' } = render 'entries_table', entries: 'create_inventory' - %div.panel-section{ng: {controller: 'DropdownPanelsCtrl', hide: 'count((entries | entriesFilterValid:"update_inventory")) == 0'}} - %div.panel-header{ng: {click: 'togglePanel()', class: '{active: active && count((entries | entriesFilterValid:"update_inventory"))}'}} + %div.panel-section{ "ng-controller" => 'DropdownPanelsCtrl', "ng-hide" => 'count((entries | entriesFilterValid:"update_inventory")) == 0' } + %div.panel-header{ "ng-click" => 'togglePanel()', "ng-class" => '{active: active && count((entries | entriesFilterValid:"update_inventory"))}' } %div.header-caret - %i{ng: {class: "{'icon-chevron-down': active, 'icon-chevron-right': !active}", hide: 'count((entries | entriesFilterValid:"update_inventory")) == 0'}} + %i{ "ng-class" => "{'icon-chevron-down': active, 'icon-chevron-right': !active}", "ng-hide" => 'count((entries | entriesFilterValid:"update_inventory")) == 0' } %div.header-icon.success %i.fa.fa-check-circle %div.header-count @@ -92,10 +92,10 @@ {{ count((entries | entriesFilterValid:"update_inventory")) }} %div.header-description = t('admin.product_import.import.inventory_to_update') - %div.panel-content{ng: {hide: '!active || count((entries | entriesFilterValid:"update_inventory")) == 0'}} + %div.panel-content{ "ng-hide" => '!active || count((entries | entriesFilterValid:"update_inventory")) == 0' } = render 'entries_table', entries: 'update_inventory' - %div.panel-section{ng: {controller: 'ImportOptionsFormCtrl', hide: 'resetTotal == 0'}} + %div.panel-section{ "ng-controller" => 'ImportOptionsFormCtrl', "ng-hide" => 'resetTotal == 0' } %div.panel-header %div.header-caret %div.header-icon.info diff --git a/app/views/admin/product_import/_save_results.html.haml b/app/views/admin/product_import/_save_results.html.haml index 90cf847468..3228e2d8aa 100644 --- a/app/views/admin/product_import/_save_results.html.haml +++ b/app/views/admin/product_import/_save_results.html.haml @@ -4,31 +4,31 @@ %div.post-save-results - %p{ng: {show: 'updates.products_created'}} - %i.fa{ng: {class: "{'fa-info-circle': updates.products_created == 0, 'fa-check-circle': updates.products_created > 0}"}} + %p{ "ng-show" => 'updates.products_created' } + %i.fa{ "ng-class" => "{'fa-info-circle': updates.products_created == 0, 'fa-check-circle': updates.products_created > 0}" } %strong.created-count {{ updates.products_created }} = t('.products_created') - %p{ng: {show: 'updates.products_updated'}} - %i.fa{ng: {class: "{'fa-info-circle': updates.products_updated == 0, 'fa-check-circle': updates.products_updated > 0}"}} + %p{ "ng-show" => 'updates.products_updated' } + %i.fa{ "ng-class" => "{'fa-info-circle': updates.products_updated == 0, 'fa-check-circle': updates.products_updated > 0}" } %strong.updated-count {{ updates.products_updated }} = t('.products_updated') - %p{ng: {show: 'updates.inventory_created'}} - %i.fa{ng: {class: "{'fa-info-circle': updates.inventory_created == 0, 'fa-check-circle': updates.inventory_created > 0}"}} + %p{ "ng-show" => 'updates.inventory_created' } + %i.fa{ "ng-class" => "{'fa-info-circle': updates.inventory_created == 0, 'fa-check-circle': updates.inventory_created > 0}" } %strong.inv-created-count {{ updates.inventory_created }} = t('.inventory_created') - %p{ng: {show: 'updates.inventory_updated'}} - %i.fa{ng: {class: "{'fa-info-circle': updates.inventory_updated == 0, 'fa-check-circle': updates.inventory_updated > 0}"}} + %p{ "ng-show" => 'updates.inventory_updated' } + %i.fa{ "ng-class" => "{'fa-info-circle': updates.inventory_updated == 0, 'fa-check-circle': updates.inventory_updated > 0}" } %strong.inv-updated-count {{ updates.inventory_updated }} = t('.inventory_updated') - %p{ng: {show: 'updates.products_reset'}} + %p{ "ng-show" => 'updates.products_reset' } %i.fa.fa-info-circle %strong.reset-count {{ updates.products_reset }} @@ -39,24 +39,24 @@ %br - %p{ng: {show: 'update_errors.length == 0'}} + %p{ "ng-show" => 'update_errors.length == 0' } = t('.all_saved') - %div{ng: {show: 'update_errors.length > 0'}} + %div{ "ng-show" => 'update_errors.length > 0' } %p {{ updated_total }} #{t('.some_saved')} %br %h5= t('.save_errors') - %p.save-error{ng: {repeat: 'error in update_errors'}} + %p.save-error{ "ng-repeat" => 'error in update_errors' }  -  {{ error }} %br - %div{ng: {show: 'updated_total > 0'}} - %a.button.view{href: main_app.admin_inventory_path, ng: {show: 'updates.inventory_created > 0 || updates.inventory_updated > 0'}} + %div{ "ng-show" => 'updated_total > 0' } + %a.button.view{ "href" => main_app.admin_inventory_path, "ng-show" => 'updates.inventory_created > 0 || updates.inventory_updated > 0' } = t('.view_inventory') - %a.button.view{href: admin_products_path, ng: {show: 'updates.products_created > 0 || updates.products_updated > 0'}} + %a.button.view{ "href" => admin_products_path, "ng-show" => 'updates.products_created > 0 || updates.products_updated > 0' } = t('.view_products') %a.button{href: main_app.admin_product_import_path} diff --git a/app/views/admin/product_import/_upload_form.html.haml b/app/views/admin/product_import/_upload_form.html.haml index cbe9cc9f9c..32fe7c7dd6 100644 --- a/app/views/admin/product_import/_upload_form.html.haml +++ b/app/views/admin/product_import/_upload_form.html.haml @@ -1,4 +1,4 @@ -%div{ng: {app: 'admin.productImport', controller: 'ImportOptionsFormCtrl', init: "initForm()"}} +%div{ "ng-app" => 'admin.productImport', "ng-controller" => 'ImportOptionsFormCtrl', "ng-init" => "initForm()" } = form_tag main_app.admin_product_import_path, multipart: true, class: 'product-import' do diff --git a/app/views/admin/product_import/import.html.haml b/app/views/admin/product_import/import.html.haml index fe938b39d8..c3c4f9b63a 100644 --- a/app/views/admin/product_import/import.html.haml +++ b/app/views/admin/product_import/import.html.haml @@ -4,7 +4,7 @@ = render partial: 'ams_data' = render partial: 'spree/admin/shared/product_sub_menu' -.import-wrapper{ng: {app: 'admin.productImport', controller: 'ImportFormCtrl'}} +.import-wrapper{ "ng-app" => 'admin.productImport', "ng-controller" => 'ImportFormCtrl' } - if @importer.item_count == 0 %h5 @@ -13,14 +13,14 @@ = t('.none_to_save') %br - else - .settings-section{ng: {show: 'step == "settings"'}} + .settings-section{ "ng-show" => 'step == "settings"' } = render 'import_options' if @importer.table_headings %br - %a.button.proceed{href: '', ng: {click: 'confirmSettings()'}} + %a.button.proceed{ "href" => '', "ng-click" => 'confirmSettings()' } = t('.import') %a.button{href: main_app.admin_product_import_path} #{t('admin.cancel')} - .progress-interface{ng: {show: 'step == "import"'}} + .progress-interface{ "ng-show" => 'step == "import"' } %span.filename = @original_filename %span.percentage @@ -34,12 +34,12 @@ = render 'import_review' if @importer.table_headings - %div{ng: {controller: 'ImportFeedbackCtrl', show: 'count((entries | entriesFilterValid:"valid")) > 0'}} - %div{ng: {if: 'count((entries | entriesFilterValid:"invalid")) > 0'}} + %div{ "ng-controller" => 'ImportFeedbackCtrl', "ng-show" => 'count((entries | entriesFilterValid:"valid")) > 0' } + %div{ "ng-if" => 'count((entries | entriesFilterValid:"invalid")) > 0' } %br %h5= t('admin.product_import.import.some_invalid_entries') %p= t('admin.product_import.import.fix_before_import') - %div{ng: {show: 'count((entries | entriesFilterValid:"invalid")) == 0'}} + %div{ "ng-show" => 'count((entries | entriesFilterValid:"invalid")) == 0' } %br %h5= t('.no_errors') %p= t('.save_all_imported?') @@ -47,22 +47,22 @@ = hidden_field_tag :filepath, @filepath = hidden_field_tag "settings[import_into]", @import_into - %a.button.proceed{href: '', ng: {show: 'count((entries | entriesFilterValid:"invalid")) == 0', click: 'acceptResults()'}} + %a.button.proceed{ "href" => '', "ng-show" => 'count((entries | entriesFilterValid:"invalid")) == 0', "ng-click" => 'acceptResults()' } = t('.save') %a.button{href: main_app.admin_product_import_path}= t('admin.cancel') - %div{ng: {controller: 'ImportFeedbackCtrl', show: 'count((entries | entriesFilterValid:"valid")) == 0'}} + %div{ "ng-controller" => 'ImportFeedbackCtrl', "ng-show" => 'count((entries | entriesFilterValid:"valid")) == 0' } %br %a.button{href: main_app.admin_product_import_path}= t('admin.cancel') - .progress-interface{ng: {show: 'step == "save"'}} + .progress-interface{ "ng-show" => 'step == "save"' } %span.filename #{t('.save_imported')} ({{ percentage.save }}) .progress-bar{} - %span.progress-track{ng: {style: "{'width': percentage.save }"}} + %span.progress-track{ "ng-style" => "{'width': percentage.save }" } %p.red {{ exception }} - .save-results{ng: {show: 'step == "complete"'}} + .save-results{ "ng-show" => 'step == "complete"' } = render 'save_results' diff --git a/app/views/admin/products_v3/_no_products.html.haml b/app/views/admin/products_v3/_no_products.html.haml index 4cb82d2eb5..0fb24ba20d 100644 --- a/app/views/admin/products_v3/_no_products.html.haml +++ b/app/views/admin/products_v3/_no_products.html.haml @@ -1,6 +1,6 @@ - if search_term.present? || producer_id.present? || category_id.present? = t('.no_products_found_for_search') - %a{ href: "#", class: "button disruptive relaxed", data: { reflex: "click->products#clear_search" } } + %a{ "href" => "#", "class" => "button disruptive relaxed", "data-reflex" => "click->products#clear_search" } = t("admin.products_v3.sort.pagination.clear_search") - else = t('.no_products_found') diff --git a/app/views/admin/products_v3/_sort.html.haml b/app/views/admin/products_v3/_sort.html.haml index b89d926cef..90c13fbfb3 100644 --- a/app/views/admin/products_v3/_sort.html.haml +++ b/app/views/admin/products_v3/_sort.html.haml @@ -2,7 +2,7 @@ %div = t(".pagination.total_html", total: pagy.count, from: pagy.from, to: pagy.to) - if search_term.present? || producer_id.present? || category_id.present? - %a{ href: "#", class: "button disruptive", data: { reflex: "click->products#clear_search" } } + %a{ "href" => "#", "class" => "button disruptive", "data-reflex" => "click->products#clear_search" } = t(".pagination.clear_search") %form.with-dropdown = t(".pagination.per_page.show") diff --git a/app/views/admin/reports/show.html.haml b/app/views/admin/reports/show.html.haml index 42f7ec8e05..656a56c9d8 100644 --- a/app/views/admin/reports/show.html.haml +++ b/app/views/admin/reports/show.html.haml @@ -27,5 +27,5 @@ = t(@error, link: link_to(t(".report_link_label"), @error_url)) if @error -#report-table{ data: { controller: "scoped-channel", "scoped-channel-id-value": request.uuid } } +#report-table{ "data-controller" => "scoped-channel", "data-scoped-channel-id-value" => request.uuid } = @table diff --git a/app/views/admin/shared/_side_menu.html.haml b/app/views/admin/shared/_side_menu.html.haml index e900c233a8..c0ed67af4c 100644 --- a/app/views/admin/shared/_side_menu.html.haml +++ b/app/views/admin/shared/_side_menu.html.haml @@ -2,12 +2,12 @@ - if @enterprise - enterprise_side_menu_items(@enterprise).each do |item| - next if !item[:show] - %a.menu_item{ href: item[:href] || "##{item[:name]}_panel", data: { action: "tabs-and-panels#activate", "tabs-and-panels-target": "tab", test: "link_for_#{item[:name]}" }, class: item[:selected] } + %a.menu_item{ "href" => item[:href] || "##{item[:name]}_panel", "class" => item[:selected], "data-action" => "tabs-and-panels#activate", "data-tabs-and-panels-target" => "tab", "data-test" => "link_for_#{item[:name]}" } %i{ class: item[:icon_class] } %span= t(".enterprise.#{item[:name] }") - else - enterprise_group_side_menu_items.each do |item| - %a.menu_item{ href: "##{item[:name]}_panel", class: item[:selected], data: { action: "tabs-and-panels#activate", "tabs-and-panels-target": "tab", test: "link_for_#{item[:name]}" } } + %a.menu_item{ "href" => "##{item[:name]}_panel", "class" => item[:selected], "data-action" => "tabs-and-panels#activate", "data-tabs-and-panels-target" => "tab", "data-test" => "link_for_#{item[:name]}" } %i{ class: item[:icon_class] } %span= t(".enterprise_group.#{item[:name] }") diff --git a/app/views/admin/shared/_stimulus_pagination.html.haml b/app/views/admin/shared/_stimulus_pagination.html.haml index e7b4b9960a..bb7c008bb4 100644 --- a/app/views/admin/shared/_stimulus_pagination.html.haml +++ b/app/views/admin/shared/_stimulus_pagination.html.haml @@ -2,9 +2,9 @@ .pagination{ "data-controller": "search" } - if pagy.prev - %button.page.prev{ data: { action: 'click->search#changePage', page: pagy.prev } } + %button.page.prev{ "data-action" => 'click->search#changePage', "data-page" => pagy.prev } - if feature?(:admin_style_v3, spree_current_user) - %i.icon-chevron-left{ data: { action: 'click->search#changePage', page: pagy.prev } } + %i.icon-chevron-left{ "data-action" => 'click->search#changePage', "data-page" => pagy.prev } - else != pagy_t('pagy.nav.prev') - else @@ -12,7 +12,7 @@ - pagy.series.each do |item| # series example: [1, :gap, 7, 8, "9", 10, 11, :gap, 36] - if item.is_a?(Integer) # page link - %button.page{ data: { action: 'click->search#changePage', page: item } }= item + %button.page{ "data-action" => 'click->search#changePage', "data-page" => item }= item - elsif item.is_a?(String) # current page %button.page.current.active= item @@ -21,9 +21,9 @@ %span.page.gap.pagination-ellipsis!= pagy_t('pagy.nav.gap') - if pagy.next - %button.page.next{ data: { action: 'click->search#changePage', page: pagy.next } } + %button.page.next{ "data-action" => 'click->search#changePage', "data-page" => pagy.next } - if feature?(:admin_style_v3, spree_current_user) - %i.icon-chevron-right{ data: { action: 'click->search#changePage', page: pagy.next } } + %i.icon-chevron-right{ "data-action" => 'click->search#changePage', "data-page" => pagy.next } - else != pagy_t('pagy.nav.next') - else diff --git a/app/views/admin/shared/_views_dropdown.html.haml b/app/views/admin/shared/_views_dropdown.html.haml index 9fe3df8521..e560addd9a 100644 --- a/app/views/admin/shared/_views_dropdown.html.haml +++ b/app/views/admin/shared/_views_dropdown.html.haml @@ -2,6 +2,6 @@ %span{ :class => 'icon-eye-open' }= "  #{t('admin.viewing', current_view_name: '{{ currentView().name }}')}".html_safe %span{ 'ng-class' => "expanded && 'icon-caret-up' || !expanded && 'icon-caret-down'" } %div.menu{ 'ng-show' => "expanded" } - %div.menu_item{ ng: { repeat: "(viewKey, view) in views" }, toggle: { view: true }, 'close-on-click' => true } + %div.menu_item{ "close-on-click" => true, "ng-repeat" => "(viewKey, view) in views", "toggle-view" => true } %span.check %span.name {{ view.name }} diff --git a/app/views/admin/subscriptions/_address.html.haml b/app/views/admin/subscriptions/_address.html.haml index f7bebb3ad2..e82277f77c 100644 --- a/app/views/admin/subscriptions/_address.html.haml +++ b/app/views/admin/subscriptions/_address.html.haml @@ -4,48 +4,48 @@ %legend{ align: 'center'}= t(:bill_address) .field %label{ for: 'bill_address_firstname'}= t(:first_name) - %input.fullwidth#bill_address_firstname{ name: 'bill_address_firstname', type: 'text', required: true, ng: { model: "subscription.bill_address.firstname" } } - .error{ ng: { show: 'subscription_form.$submitted && subscription_address_form.bill_address_firstname.$error.required' } }= t(:error_required) - .error{ ng: { repeat: "error in errors['bill_address.firstname']", show: 'subscription_address_form.bill_address_firstname.$pristine' } } {{ error }} + %input.fullwidth#bill_address_firstname{ "name" => 'bill_address_firstname', "type" => 'text', "required" => true, "ng-model" => "subscription.bill_address.firstname" } + .error{ "ng-show" => 'subscription_form.$submitted && subscription_address_form.bill_address_firstname.$error.required' }= t(:error_required) + .error{ "ng-repeat" => "error in errors['bill_address.firstname']", "ng-show" => 'subscription_address_form.bill_address_firstname.$pristine' } {{ error }} .field %label{ for: 'bill_address_lastname'}= t(:last_name) - %input.fullwidth#bill_address_lastname{ name: 'bill_address_lastname', type: 'text', required: true, ng: { model: "subscription.bill_address.lastname" } } - .error{ ng: { show: 'subscription_form.$submitted && subscription_address_form.bill_address_lastname.$error.required' } }= t(:error_required) - .error{ ng: { repeat: "error in errors['bill_address.lastname']", show: 'subscription_address_form.bill_address_lastname.$pristine' } } {{ error }} + %input.fullwidth#bill_address_lastname{ "name" => 'bill_address_lastname', "type" => 'text', "required" => true, "ng-model" => "subscription.bill_address.lastname" } + .error{ "ng-show" => 'subscription_form.$submitted && subscription_address_form.bill_address_lastname.$error.required' }= t(:error_required) + .error{ "ng-repeat" => "error in errors['bill_address.lastname']", "ng-show" => 'subscription_address_form.bill_address_lastname.$pristine' } {{ error }} .field %label{ for: 'bill_address_address1'}= t(:address) - %input.fullwidth#bill_address_address1{ name: 'bill_address_address1', type: 'text', required: true, ng: { model: "subscription.bill_address.address1" } } - .error{ ng: { show: 'subscription_form.$submitted && subscription_address_form.bill_address_address1.$error.required' } }= t(:error_required) - .error{ ng: { repeat: "error in errors['bill_address.address1']", show: 'subscription_address_form.bill_address_address1.$pristine' } } {{ error }} + %input.fullwidth#bill_address_address1{ "name" => 'bill_address_address1', "type" => 'text', "required" => true, "ng-model" => "subscription.bill_address.address1" } + .error{ "ng-show" => 'subscription_form.$submitted && subscription_address_form.bill_address_address1.$error.required' }= t(:error_required) + .error{ "ng-repeat" => "error in errors['bill_address.address1']", "ng-show" => 'subscription_address_form.bill_address_address1.$pristine' } {{ error }} .field %label{ for: 'bill_address_city'}= t(:suburb) - %input.fullwidth#bill_address_city{ name: 'bill_address_city', type: 'text', required: true, ng: { model: "subscription.bill_address.city" } } - .error{ ng: { show: 'subscription_form.$submitted && subscription_address_form.bill_address_city.$error.required' } }= t(:error_required) - .error{ ng: { repeat: 'error in errors.bill_address.city', show: 'subscription_address_form.bill_address_city.$pristine' } } {{ error }} + %input.fullwidth#bill_address_city{ "name" => 'bill_address_city', "type" => 'text', "required" => true, "ng-model" => "subscription.bill_address.city" } + .error{ "ng-show" => 'subscription_form.$submitted && subscription_address_form.bill_address_city.$error.required' }= t(:error_required) + .error{ "ng-repeat" => 'error in errors.bill_address.city', "ng-show" => 'subscription_address_form.bill_address_city.$pristine' } {{ error }} .field %label{ for: "bill_address_zipcode"}= t(:postcode) - %input.fullwidth#bill_address_zipcode{ name: 'bill_address_zipcode', type: 'text', required: true, ng: { model: "subscription.bill_address.zipcode" } } - .error{ ng: { show: 'subscription_form.$submitted && subscription_address_form.bill_address_zipcode.$error.required' } }= t(:error_required) - .error{ ng: { repeat: 'error in errors.bill_address.zipcode', show: 'subscription_address_form.bill_address_zipcode.$pristine' } } {{ error }} + %input.fullwidth#bill_address_zipcode{ "name" => 'bill_address_zipcode', "type" => 'text', "required" => true, "ng-model" => "subscription.bill_address.zipcode" } + .error{ "ng-show" => 'subscription_form.$submitted && subscription_address_form.bill_address_zipcode.$error.required' }= t(:error_required) + .error{ "ng-repeat" => 'error in errors.bill_address.zipcode', "ng-show" => 'subscription_address_form.bill_address_zipcode.$pristine' } {{ error }} .field %label{ for: "bill_address_phone"}= t(:phone) - %input.fullwidth#bill_address_phone{ name: 'bill_address_phone', type: 'text', required: true, ng: { model: "subscription.bill_address.phone" } } - .error{ ng: { show: 'subscription_form.$submitted && subscription_address_form.bill_address_phone.$error.required' } }= t(:error_required) - .error{ ng: { repeat: 'error in errors.bill_address.phone', show: 'subscription_address_form.bill_address_phone.$pristine' } } {{ error }} + %input.fullwidth#bill_address_phone{ "name" => 'bill_address_phone', "type" => 'text', "required" => true, "ng-model" => "subscription.bill_address.phone" } + .error{ "ng-show" => 'subscription_form.$submitted && subscription_address_form.bill_address_phone.$error.required' }= t(:error_required) + .error{ "ng-repeat" => 'error in errors.bill_address.phone', "ng-show" => 'subscription_address_form.bill_address_phone.$pristine' } {{ error }} .field %label{ for: "bill_address_country_id"}= t(:country) - %input.ofn-select2.fullwidth#bill_address_country_id{ name: 'bill_address_country_id', type: 'number', data: 'countries', required: true, placeholder: t('admin.choose'), ng: { model: 'subscription.bill_address.country_id' } } - .error{ ng: { show: 'subscription_form.$submitted && subscription_address_form.bill_address_country_id.$error.required' } }= t(:error_required) - .error{ ng: { repeat: 'error in errors.bill_address.country', show: 'subscription_address_form.bill_address_country_id.$pristine' } } {{ error }} + %input.ofn-select2.fullwidth#bill_address_country_id{ "name" => 'bill_address_country_id', "type" => 'number', "data" => 'countries', "required" => true, "placeholder" => t('admin.choose'), "ng-model" => 'subscription.bill_address.country_id' } + .error{ "ng-show" => 'subscription_form.$submitted && subscription_address_form.bill_address_country_id.$error.required' }= t(:error_required) + .error{ "ng-repeat" => 'error in errors.bill_address.country', "ng-show" => 'subscription_address_form.bill_address_country_id.$pristine' } {{ error }} .field %label{ for: "bill_address_state_id"}= t(:state) - %input.ofn-select2.fullwidth#bill_address_state_id{ name: 'bill_address_state_id', type: 'number', data: 'billStates', required: true, placeholder: t('admin.choose'), ng: { model: 'subscription.bill_address.state_id' } } - .error{ ng: { show: 'subscription_form.$submitted && subscription_address_form.bill_address_state_id.$error.required' } }= t(:error_required) - .error{ ng: { repeat: 'error in errors.bill_address.state', show: 'subscription_address_form.bill_address_state_id.$pristine' } } {{ error }} + %input.ofn-select2.fullwidth#bill_address_state_id{ "name" => 'bill_address_state_id', "type" => 'number', "data" => 'billStates', "required" => true, "placeholder" => t('admin.choose'), "ng-model" => 'subscription.bill_address.state_id' } + .error{ "ng-show" => 'subscription_form.$submitted && subscription_address_form.bill_address_state_id.$error.required' }= t(:error_required) + .error{ "ng-repeat" => 'error in errors.bill_address.state', "ng-show" => 'subscription_address_form.bill_address_state_id.$pristine' } {{ error }} .two.columns - %a.button.red.fullwidth{ href: 'javascript:void(0)', ng: { click: 'shipAddressFromBilling()' } } + %a.button.red.fullwidth{ "href" => 'javascript:void(0)', "ng-click" => 'shipAddressFromBilling()' } = t('copy') %i.icon-chevron-right .seven.columns.omega @@ -53,41 +53,41 @@ %legend{ align: 'center'}= t(:ship_address) .field %label{ for: 'ship_address_firstname'}= t(:first_name) - %input.fullwidth#ship_address_firstname{ name: 'ship_address_firstname', type: 'text', required: true, ng: { model: "subscription.ship_address.firstname" } } - .error{ ng: { show: 'subscription_form.$submitted && subscription_address_form.ship_address_firstname.$error.required' } }= t(:error_required) - .error{ ng: { repeat: "error in errors['ship_address.firstname']", show: 'subscription_address_form.ship_address_firstname.$pristine' } } {{ error }} + %input.fullwidth#ship_address_firstname{ "name" => 'ship_address_firstname', "type" => 'text', "required" => true, "ng-model" => "subscription.ship_address.firstname" } + .error{ "ng-show" => 'subscription_form.$submitted && subscription_address_form.ship_address_firstname.$error.required' }= t(:error_required) + .error{ "ng-repeat" => "error in errors['ship_address.firstname']", "ng-show" => 'subscription_address_form.ship_address_firstname.$pristine' } {{ error }} .field %label{ for: 'ship_address_lastname'}= t(:last_name) - %input.fullwidth#ship_address_lastname{ name: 'ship_address_lastname', type: 'text', required: true, ng: { model: "subscription.ship_address.lastname" } } - .error{ ng: { show: 'subscription_form.$submitted && subscription_address_form.ship_address_lastname.$error.required' } }= t(:error_required) - .error{ ng: { repeat: "error in errors['ship_address.lastname']", show: 'subscription_address_form.ship_address_lastname.$pristine' } } {{ error }} + %input.fullwidth#ship_address_lastname{ "name" => 'ship_address_lastname', "type" => 'text', "required" => true, "ng-model" => "subscription.ship_address.lastname" } + .error{ "ng-show" => 'subscription_form.$submitted && subscription_address_form.ship_address_lastname.$error.required' }= t(:error_required) + .error{ "ng-repeat" => "error in errors['ship_address.lastname']", "ng-show" => 'subscription_address_form.ship_address_lastname.$pristine' } {{ error }} .field %label{ for: 'ship_address_address1'}= t(:address) - %input.fullwidth#ship_address_address1{ name: 'ship_address_address1', type: 'text', required: true, ng: { model: "subscription.ship_address.address1" } } - .error{ ng: { show: 'subscription_form.$submitted && subscription_address_form.ship_address_address1.$error.required' } }= t(:error_required) - .error{ ng: { repeat: "error in errors['ship_address.address1']", show: 'subscription_address_form.ship_address_address1.$pristine' } } {{ error }} + %input.fullwidth#ship_address_address1{ "name" => 'ship_address_address1', "type" => 'text', "required" => true, "ng-model" => "subscription.ship_address.address1" } + .error{ "ng-show" => 'subscription_form.$submitted && subscription_address_form.ship_address_address1.$error.required' }= t(:error_required) + .error{ "ng-repeat" => "error in errors['ship_address.address1']", "ng-show" => 'subscription_address_form.ship_address_address1.$pristine' } {{ error }} .field %label{ for: 'ship_address_city'}= t(:suburb) - %input.fullwidth#ship_address_city{ name: 'ship_address_city', type: 'text', required: true, ng: { model: "subscription.ship_address.city" } } - .error{ ng: { show: 'subscription_form.$submitted && subscription_address_form.ship_address_city.$error.required' } }= t(:error_required) - .error{ ng: { repeat: 'error in errors.ship_address.city', show: 'subscription_address_form.ship_address_city.$pristine' } } {{ error }} + %input.fullwidth#ship_address_city{ "name" => 'ship_address_city', "type" => 'text', "required" => true, "ng-model" => "subscription.ship_address.city" } + .error{ "ng-show" => 'subscription_form.$submitted && subscription_address_form.ship_address_city.$error.required' }= t(:error_required) + .error{ "ng-repeat" => 'error in errors.ship_address.city', "ng-show" => 'subscription_address_form.ship_address_city.$pristine' } {{ error }} .field %label{ for: "ship_address_zipcode"}= t(:postcode) - %input.fullwidth#ship_address_zipcode{ name: 'ship_address_zipcode', type: 'text', required: true, ng: { model: "subscription.ship_address.zipcode" } } - .error{ ng: { show: 'subscription_form.$submitted && subscription_address_form.ship_address_zipcode.$error.required' } }= t(:error_required) - .error{ ng: { repeat: 'error in errors.ship_address.zipcode', show: 'subscription_address_form.ship_address_zipcode.$pristine' } } {{ error }} + %input.fullwidth#ship_address_zipcode{ "name" => 'ship_address_zipcode', "type" => 'text', "required" => true, "ng-model" => "subscription.ship_address.zipcode" } + .error{ "ng-show" => 'subscription_form.$submitted && subscription_address_form.ship_address_zipcode.$error.required' }= t(:error_required) + .error{ "ng-repeat" => 'error in errors.ship_address.zipcode', "ng-show" => 'subscription_address_form.ship_address_zipcode.$pristine' } {{ error }} .field %label{ for: "ship_address_phone"}= t(:phone) - %input.fullwidth#ship_address_phone{ name: 'ship_address_phone', type: 'text', required: true, ng: { model: "subscription.ship_address.phone" } } - .error{ ng: { show: 'subscription_form.$submitted && subscription_address_form.ship_address_phone.$error.required' } }= t(:error_required) - .error{ ng: { repeat: 'error in errors.ship_address.phone', show: 'subscription_address_form.ship_address_phone.$pristine' } } {{ error }} + %input.fullwidth#ship_address_phone{ "name" => 'ship_address_phone', "type" => 'text', "required" => true, "ng-model" => "subscription.ship_address.phone" } + .error{ "ng-show" => 'subscription_form.$submitted && subscription_address_form.ship_address_phone.$error.required' }= t(:error_required) + .error{ "ng-repeat" => 'error in errors.ship_address.phone', "ng-show" => 'subscription_address_form.ship_address_phone.$pristine' } {{ error }} .field %label{ for: "ship_address_country_id"}= t(:country) - %input.ofn-select2.fullwidth#ship_address_country_id{ name: 'ship_address_country_id', type: 'number', data: 'countries', required: true, placeholder: t('admin.choose'), ng: { model: 'subscription.ship_address.country_id' } } - .error{ ng: { show: 'subscription_form.$submitted && subscription_address_form.ship_address_country_id.$error.required' } }= t(:error_required) - .error{ ng: { repeat: 'error in errors.ship_address.country', show: 'subscription_address_form.ship_address_country_id.$pristine' } } {{ error }} + %input.ofn-select2.fullwidth#ship_address_country_id{ "name" => 'ship_address_country_id', "type" => 'number', "data" => 'countries', "required" => true, "placeholder" => t('admin.choose'), "ng-model" => 'subscription.ship_address.country_id' } + .error{ "ng-show" => 'subscription_form.$submitted && subscription_address_form.ship_address_country_id.$error.required' }= t(:error_required) + .error{ "ng-repeat" => 'error in errors.ship_address.country', "ng-show" => 'subscription_address_form.ship_address_country_id.$pristine' } {{ error }} .field %label{ for: "ship_address_state_id"}= t(:state) - %input.ofn-select2.fullwidth#ship_address_state_id{ name: 'ship_address_state_id', type: 'number', data: 'shipStates', required: true, placeholder: t('admin.choose'), ng: { model: 'subscription.ship_address.state_id' } } - .error{ ng: { show: 'subscription_form.$submitted && subscription_address_form.ship_address_state_id.$error.required' } }= t(:error_required) - .error{ ng: { repeat: 'error in errors.ship_address.state', show: 'subscription_address_form.ship_address_state_id.$pristine' } } {{ error }} + %input.ofn-select2.fullwidth#ship_address_state_id{ "name" => 'ship_address_state_id', "type" => 'number', "data" => 'shipStates', "required" => true, "placeholder" => t('admin.choose'), "ng-model" => 'subscription.ship_address.state_id' } + .error{ "ng-show" => 'subscription_form.$submitted && subscription_address_form.ship_address_state_id.$error.required' }= t(:error_required) + .error{ "ng-repeat" => 'error in errors.ship_address.state', "ng-show" => 'subscription_address_form.ship_address_state_id.$pristine' } {{ error }} diff --git a/app/views/admin/subscriptions/_autocomplete.html.haml b/app/views/admin/subscriptions/_autocomplete.html.haml index 784c77009e..04121afe8e 100644 --- a/app/views/admin/subscriptions/_autocomplete.html.haml +++ b/app/views/admin/subscriptions/_autocomplete.html.haml @@ -9,12 +9,12 @@ %td.vertical-align-top .field = label_tag :add_variant_id, t('.name_or_sku') - %input#add_variant_id.variant_autocomplete.fullwidth{ type: 'number', ng: { model: 'newItem.variant_id' } } + %input#add_variant_id.variant_autocomplete.fullwidth{ "type" => 'number', "ng-model" => 'newItem.variant_id' } %td.vertical-align-top .field = label_tag :add_quantity, t('.quantity') - %input#add_quantity.fullwidth{ type: 'number', min: 1, ng: { model: 'newItem.quantity' } } + %input#add_quantity.fullwidth{ "type" => 'number', "min" => 1, "ng-model" => 'newItem.quantity' } %td .actions - %a.icon-plus.button.fullwidth{ href: 'javascript:void(0)', ng: { click: 'addSubscriptionLineItem()' } } + %a.icon-plus.button.fullwidth{ "href" => 'javascript:void(0)', "ng-click" => 'addSubscriptionLineItem()' } = t('.add') diff --git a/app/views/admin/subscriptions/_controls.html.haml b/app/views/admin/subscriptions/_controls.html.haml index ece0c7eecb..b78a6ffce9 100644 --- a/app/views/admin/subscriptions/_controls.html.haml +++ b/app/views/admin/subscriptions/_controls.html.haml @@ -1,5 +1,5 @@ -%hr.divider.sixteen.columns.alpha.omega{ ng: { show: 'shop_id && subscriptions.length > 0' } } -.controls.sixteen.columns.alpha.omega{ ng: { show: 'shop_id && subscriptions.length > 0' } } +%hr.divider.sixteen.columns.alpha.omega{ "ng-show" => 'shop_id && subscriptions.length > 0' } +.controls.sixteen.columns.alpha.omega{ "ng-show" => 'shop_id && subscriptions.length > 0' } .twelve.columns.alpha   .four.columns.omega diff --git a/app/views/admin/subscriptions/_details.html.haml b/app/views/admin/subscriptions/_details.html.haml index 9015d16024..819bdf30e0 100644 --- a/app/views/admin/subscriptions/_details.html.haml +++ b/app/views/admin/subscriptions/_details.html.haml @@ -3,42 +3,42 @@ .row .seven.columns.alpha.field %label{ for: 'customer_id'}= t('admin.customer') - %input.ofn-select2.fullwidth#customer_id{ name: 'customer_id', type: 'number', data: 'customers', text: 'email', required: true, placeholder: t('admin.choose'), ng: { model: 'subscription.customer_id', disabled: 'subscription.id' } } - .error{ ng: { show: 'subscription_form.$submitted && subscription_details_form.customer_id.$error.required' } }= t(:error_required) - .error{ ng: { repeat: 'error in errors.customer', show: 'subscription_details_form.customer_id.$pristine' } } {{ error }} + %input.ofn-select2.fullwidth#customer_id{ "name" => 'customer_id', "type" => 'number', "data" => 'customers', "text" => 'email', "required" => true, "placeholder" => t('admin.choose'), "ng-model" => 'subscription.customer_id', "ng-disabled" => 'subscription.id' } + .error{ "ng-show" => 'subscription_form.$submitted && subscription_details_form.customer_id.$error.required' }= t(:error_required) + .error{ "ng-repeat" => 'error in errors.customer', "ng-show" => 'subscription_details_form.customer_id.$pristine' } {{ error }} .two.columns   .seven.columns.omega.field %label{ for: 'schedule_id'}= t('admin.schedule') - %input.ofn-select2.fullwidth#schedule_id{ name: 'schedule_id', type: 'number', data: 'schedules', required: true, placeholder: t('admin.choose'), ng: { model: 'subscription.schedule_id', disabled: 'subscription.id' } } - .error{ ng: { show: 'subscription_form.$submitted && subscription_details_form.schedule_id.$error.required' } }= t(:error_required) - .error{ ng: { repeat: 'error in errors.schedule', show: 'subscription_details_form.schedule_id.$pristine'} } {{ error }} + %input.ofn-select2.fullwidth#schedule_id{ "name" => 'schedule_id', "type" => 'number', "data" => 'schedules', "required" => true, "placeholder" => t('admin.choose'), "ng-model" => 'subscription.schedule_id', "ng-disabled" => 'subscription.id' } + .error{ "ng-show" => 'subscription_form.$submitted && subscription_details_form.schedule_id.$error.required' }= t(:error_required) + .error{ "ng-repeat" => 'error in errors.schedule', "ng-show" => 'subscription_details_form.schedule_id.$pristine' } {{ error }} .row .seven.columns.alpha.field %label{ for: 'payment_method_id'} = t('admin.payment_method') - %span.with-tip.icon-question-sign{ data: { powertip: "#{t('.allowed_payment_method_types_tip')}" } } - %input.ofn-select2.fullwidth#payment_method_id{ name: 'payment_method_id', type: 'number', data: 'paymentMethods', required: true, placeholder: t('admin.choose'), ng: { model: 'subscription.payment_method_id' } } - .error{ ng: { show: 'subscription_form.$submitted && subscription_details_form.payment_method_id.$error.required' } }= t(:error_required) - .error{ ng: { repeat: 'error in errors.payment_method', show: 'subscription_details_form.payment_method_id.$pristine' } } {{ error }} - .error{ ng: { show: 'cardRequired && customer.$promise && customer.$resolved && !customer.allow_charges' } }= t('.charges_not_allowed') - .error{ ng: { show: 'cardRequired && customer.$promise && customer.$resolved && customer.allow_charges && !customer.default_card_present' } }= t('.no_default_card') - .error{ ng: { repeat: 'error in errors.credit_card', show: 'subscription_details_form.payment_method_id.$pristine' } } {{ error }} + %span.with-tip.icon-question-sign{ "data-powertip" => "#{t('.allowed_payment_method_types_tip')}" } + %input.ofn-select2.fullwidth#payment_method_id{ "name" => 'payment_method_id', "type" => 'number', "data" => 'paymentMethods', "required" => true, "placeholder" => t('admin.choose'), "ng-model" => 'subscription.payment_method_id' } + .error{ "ng-show" => 'subscription_form.$submitted && subscription_details_form.payment_method_id.$error.required' }= t(:error_required) + .error{ "ng-repeat" => 'error in errors.payment_method', "ng-show" => 'subscription_details_form.payment_method_id.$pristine' } {{ error }} + .error{ "ng-show" => 'cardRequired && customer.$promise && customer.$resolved && !customer.allow_charges' }= t('.charges_not_allowed') + .error{ "ng-show" => 'cardRequired && customer.$promise && customer.$resolved && customer.allow_charges && !customer.default_card_present' }= t('.no_default_card') + .error{ "ng-repeat" => 'error in errors.credit_card', "ng-show" => 'subscription_details_form.payment_method_id.$pristine' } {{ error }} .two.columns   .seven.columns.omega.field %label{ for: 'shipping_method_id'}= t('admin.shipping_method') - %input.ofn-select2.fullwidth#shipping_method_id{ name: 'shipping_method_id', type: 'number', data: 'shippingMethods', required: true, placeholder: t('admin.choose'), ng: { model: 'subscription.shipping_method_id' } } - .error{ ng: { show: 'subscription_form.$submitted && subscription_details_form.shipping_method_id.$error.required' } }= t(:error_required) - .error{ ng: { repeat: 'error in errors.shipping_method', show: 'subscription_details_form.shipping_method_id.$pristine' } } {{ error }} + %input.ofn-select2.fullwidth#shipping_method_id{ "name" => 'shipping_method_id', "type" => 'number', "data" => 'shippingMethods', "required" => true, "placeholder" => t('admin.choose'), "ng-model" => 'subscription.shipping_method_id' } + .error{ "ng-show" => 'subscription_form.$submitted && subscription_details_form.shipping_method_id.$error.required' }= t(:error_required) + .error{ "ng-repeat" => 'error in errors.shipping_method', "ng-show" => 'subscription_details_form.shipping_method_id.$pristine' } {{ error }} .row .seven.columns.alpha.field %label{ for: 'begins_at'}= t('admin.begins_at') - %input.fullwidth#begins_at{ name: 'begins_at', type: 'text', placeholder: "#{t('.begins_at_placeholder')}", data: { controller: "flatpickr" }, required: true, ng: { model: 'subscription.begins_at' } } - .error{ ng: { show: 'subscription_form.$submitted && subscription_details_form.begins_at.$error.required' } }= t(:error_required) - .error{ ng: { repeat: 'error in errors.begins_at', show: 'subscription_details_form.begins_at.$pristine' } } {{ error }} + %input.fullwidth#begins_at{ "name" => 'begins_at', "type" => 'text', "placeholder" => "#{t('.begins_at_placeholder')}", "required" => true, "data-controller" => "flatpickr", "ng-model" => 'subscription.begins_at' } + .error{ "ng-show" => 'subscription_form.$submitted && subscription_details_form.begins_at.$error.required' }= t(:error_required) + .error{ "ng-repeat" => 'error in errors.begins_at', "ng-show" => 'subscription_details_form.begins_at.$pristine' } {{ error }} .two.columns   .seven.columns.omega.field %label{ for: 'ends_at'}= t('admin.ends_at') - %input.fullwidth#ends_at{ name: 'ends_at', type: 'text', placeholder: "#{t('.ends_at_placeholder')}", data: { controller: "flatpickr" }, ng: { model: 'subscription.ends_at' } } - .error{ ng: { repeat: 'error in errors.ends_at', show: 'subscription_details_form.ends_at.$pristine' } } {{ error }} + %input.fullwidth#ends_at{ "name" => 'ends_at', "type" => 'text', "placeholder" => "#{t('.ends_at_placeholder')}", "data-controller" => "flatpickr", "ng-model" => 'subscription.ends_at' } + .error{ "ng-repeat" => 'error in errors.ends_at', "ng-show" => 'subscription_details_form.ends_at.$pristine' } {{ error }} diff --git a/app/views/admin/subscriptions/_filters.html.haml b/app/views/admin/subscriptions/_filters.html.haml index 870b8ce43a..a3f5cc54b9 100644 --- a/app/views/admin/subscriptions/_filters.html.haml +++ b/app/views/admin/subscriptions/_filters.html.haml @@ -1,11 +1,11 @@ .row.filters .sixteen.columns.alpha.omega .filter_select.five.columns.alpha - %label{ :for => 'query', ng: {class: '{disabled: !shop_id}'} }=t('admin.quick_search') + %label{ "for" => 'query', "ng-class" => '{disabled: !shop_id}' }=t('admin.quick_search') %br - %input.fullwidth{ :type => "text", :id => 'query', ng: { model: 'query', disabled: '!shop_id'}, :placeholder => "#{t('.query_placeholder')}" } + %input.fullwidth{ "type" => "text", "id" => 'query', "placeholder" => "#{t('.query_placeholder')}", "ng-model" => 'query', "ng-disabled" => '!shop_id' } .filter_select.four.columns - %label{ :for => 'shop_id', ng: { bind: "shop_id ? '#{t('admin.shop')}' : '#{t('admin.variant_overrides.index.select_a_shop')}'" } } + %label{ "for" => 'shop_id', "ng-bind" => "shop_id ? '#{t('admin.shop')}' : '#{t('admin.variant_overrides.index.select_a_shop')}'" } %br %input.ofn-select2.fullwidth#shop_id{ 'ng-model' => 'shop_id', name: 'shop_id', data: 'shops' } .seven.columns.omega   diff --git a/app/views/admin/subscriptions/_form.html.haml b/app/views/admin/subscriptions/_form.html.haml index cfb4feddaf..df6f438459 100644 --- a/app/views/admin/subscriptions/_form.html.haml +++ b/app/views/admin/subscriptions/_form.html.haml @@ -1,27 +1,27 @@ -%form.margin-bottom-50{ name: 'subscription_form', novalidate: true, ng: { submit: 'save()' } } +%form.margin-bottom-50{ "name" => 'subscription_form', "novalidate" => true, "ng-submit" => 'save()' } %save-bar{ persist: 'true' } - %div{ ng: { hide: 'subscription.id' } } - %a.button{ href: main_app.admin_subscriptions_path, ng: { show: "['details','review'].indexOf(view) >= 0" } }= t(:cancel) - %input{ type: "button", value: t(:back), ng: { click: 'back()', show: '!!backCallbacks[view]'} } - %input.red{ type: "button", value: t(:next), ng: { click: 'next()', show: '!!nextCallbacks[view]' } } - %input.red{ type: "submit", value: t('.create'), ng: { show: "view == 'review'" } } - %div{ ng: { show: 'subscription.id' } } + %div{ "ng-hide" => 'subscription.id' } + %a.button{ "href" => main_app.admin_subscriptions_path, "ng-show" => "['details','review'].indexOf(view) >= 0" }= t(:cancel) + %input{ "type" => "button", "value" => t(:back), "ng-click" => 'back()', "ng-show" => '!!backCallbacks[view]' } + %input.red{ "type" => "button", "value" => t(:next), "ng-click" => 'next()', "ng-show" => '!!nextCallbacks[view]' } + %input.red{ "type" => "submit", "value" => t('.create'), "ng-show" => "view == 'review'" } + %div{ "ng-show" => 'subscription.id' } %a.button{ href: main_app.admin_subscriptions_path }= t(:close) - %input.red{ type: "button", value: t(:review), ng: { click: "setView('review')", show: "view != 'review'" } } - %input.red{ type: "submit", value: t(:save_changes), ng: { disabled: 'subscription_form.$pristine' } } + %input.red{ "type" => "button", "value" => t(:review), "ng-click" => "setView('review')", "ng-show" => "view != 'review'" } + %input.red{ "type" => "submit", "value" => t(:save_changes), "ng-disabled" => 'subscription_form.$pristine' } - .details{ ng: { show: "view == 'details'" } } - %ng-form{ name: 'subscription_details_form', ng: { controller: 'DetailsController' } } + .details{ "ng-show" => "view == 'details'" } + %ng-form{ "name" => 'subscription_details_form', "ng-controller" => 'DetailsController' } = render 'details' - .address{ ng: { show: "view == 'address'" } } - %ng-form{ name: 'subscription_address_form', ng: { controller: 'AddressController' } } + .address{ "ng-show" => "view == 'address'" } + %ng-form{ "name" => 'subscription_address_form', "ng-controller" => 'AddressController' } = render 'address' - .products{ ng: { show: "view == 'products'" } } - %ng-form{ name: 'subscription_products_form', ng: { controller: 'ProductsController' } } + .products{ "ng-show" => "view == 'products'" } + %ng-form{ "name" => 'subscription_products_form', "ng-controller" => 'ProductsController' } = render :partial => "spree/admin/variants/autocomplete", :formats => :js = render 'products' - .review{ ng: { show: "view == 'review'", controller: 'ReviewController' } } + .review{ "ng-show" => "view == 'review'", "ng-controller" => 'ReviewController' } = render 'review' diff --git a/app/views/admin/subscriptions/_loading_flash.html.haml b/app/views/admin/subscriptions/_loading_flash.html.haml index b4a85be210..a24350ec06 100644 --- a/app/views/admin/subscriptions/_loading_flash.html.haml +++ b/app/views/admin/subscriptions/_loading_flash.html.haml @@ -1,4 +1,4 @@ -%div.sixteen.columns.alpha.omega#loading{ ng: { cloak: true, if: 'shop_id && RequestMonitor.loading' } } +%div.sixteen.columns.alpha.omega#loading{ "ng-cloak" => true, "ng-if" => 'shop_id && RequestMonitor.loading' } = render partial: "components/admin_spinner" %h1 = t('.loading') diff --git a/app/views/admin/subscriptions/_no_results.html.haml b/app/views/admin/subscriptions/_no_results.html.haml index 23ba6297fb..e444bebc55 100644 --- a/app/views/admin/subscriptions/_no_results.html.haml +++ b/app/views/admin/subscriptions/_no_results.html.haml @@ -1,7 +1,7 @@ -%div.margin-top-30.text-center{ ng: { show: 'shop_id && !RequestMonitor.loading && filteredSubscriptions.length == 0' } } - .no-results{ ng: { show: '!filtersApplied()' } } +%div.margin-top-30.text-center{ "ng-show" => 'shop_id && !RequestMonitor.loading && filteredSubscriptions.length == 0' } + .no-results{ "ng-show" => '!filtersApplied()' } %h1.margin-bottom-20=t('.no_subscriptions') %span.text-big=t('.why_dont_you_add_one') - .no-results{ ng: { show: 'filtersApplied()' } } + .no-results{ "ng-show" => 'filtersApplied()' } %h1=t('.no_matching_subscriptions') diff --git a/app/views/admin/subscriptions/_order_update_issues_dialog.html.haml b/app/views/admin/subscriptions/_order_update_issues_dialog.html.haml index 0bd1e9a9ad..9ced6a19c5 100644 --- a/app/views/admin/subscriptions/_order_update_issues_dialog.html.haml +++ b/app/views/admin/subscriptions/_order_update_issues_dialog.html.haml @@ -2,7 +2,7 @@ #order_update_issues_dialog .message.clearfix.margin-bottom-30 .text=t("admin.subscriptions.order_update_issues_msg") - %div{ ng: { controller: 'OrderUpdateIssuesController' } } + %div{ "ng-controller" => 'OrderUpdateIssuesController' } %table %col{ style: 'width: 30%' } %col{ style: 'width: 30%' } @@ -12,14 +12,14 @@ %th= t('admin.order_cycle') %th= t('admin.subscriptions.issue') %tbody - %tr.proxy_order{ :id => "ppo_{{proxyOrder.id}}", ng: { repeat: 'proxyOrder in options.proxyOrders' } } + %tr.proxy_order{ "id" => "ppo_{{proxyOrder.id}}", "ng-repeat" => 'proxyOrder in options.proxyOrders' } %td - %a{ href: '{{::proxyOrder.edit_path}}', target: '_blank', ng: { bind: '::proxyOrder.number' } } + %a{ "href" => '{{::proxyOrder.edit_path}}', "target" => '_blank', "ng-bind" => '::proxyOrder.number' } %td - %div{ ng: { bind: "::orderCycleName(proxyOrder.order_cycle_id)" } } - %div{ ng: { bind: "::orderCycleCloses(proxyOrder.order_cycle_id)" } } - %td.text-center{ ng: { bind: "proxyOrder.update_issues.join(', ')" } } + %div{ "ng-bind" => "::orderCycleName(proxyOrder.order_cycle_id)" } + %div{ "ng-bind" => "::orderCycleCloses(proxyOrder.order_cycle_id)" } + %td.text-center{ "ng-bind" => "proxyOrder.update_issues.join(', ')" } .action-buttons.text-center - %button{ ng: { click: "close()" } } + %button{ "ng-click" => "close()" } OK diff --git a/app/views/admin/subscriptions/_orders_panel.html.haml b/app/views/admin/subscriptions/_orders_panel.html.haml index d99ab196e8..67acb26ee3 100644 --- a/app/views/admin/subscriptions/_orders_panel.html.haml +++ b/app/views/admin/subscriptions/_orders_panel.html.haml @@ -1,5 +1,5 @@ %script{ type: "text/ng-template", id: "admin/panels/proxy_orders.html" } - %form.margin-top-30{ name: 'subscription_form', ng: { controller: 'OrdersPanelController' } } + %form.margin-top-30{ "name" => 'subscription_form', "ng-controller" => 'OrdersPanelController' } .row.subscription-orders .fourteen.columns.offset-by-one %table @@ -13,14 +13,14 @@ %th= t('total') %th.actions %tbody - %tr.proxy_order{ :id => "po_{{proxyOrder.id}}", ng: { repeat: 'proxyOrder in subscription.not_closed_proxy_orders' } } + %tr.proxy_order{ "id" => "po_{{proxyOrder.id}}", "ng-repeat" => 'proxyOrder in subscription.not_closed_proxy_orders' } %td - %div{ ng: { bind: "::orderCycleName(proxyOrder.order_cycle_id)" } } - %div{ ng: { bind: "::orderCycleCloses(proxyOrder.order_cycle_id)" } } + %div{ "ng-bind" => "::orderCycleName(proxyOrder.order_cycle_id)" } + %div{ "ng-bind" => "::orderCycleCloses(proxyOrder.order_cycle_id)" } %td.text-center - %span.state{ ng: { class: "proxyOrder.state", bind: 'stateText(proxyOrder.state)' } } - %td.text-center{ ng: { bind: '(proxyOrder.total || subscription.estimatedTotal()) | localizeCurrency' } } + %span.state{ "ng-class" => "proxyOrder.state", "ng-bind" => 'stateText(proxyOrder.state)' } + %td.text-center{ "ng-bind" => '(proxyOrder.total || subscription.estimatedTotal()) | localizeCurrency' } %td.actions %a.edit-order.icon-edit.no-text{ href: '{{::proxyOrder.edit_path}}', target: '_blank', 'ofn-with-tip' => t(:edit_order), confirm_order_edit: true } - %a.cancel-order.icon-remove.no-text{ href: 'javascript:void(0)', ng: { hide: "proxyOrder.state == 'canceled'", click: "cancelOrder(proxyOrder)" }, 'ofn-with-tip' => t(:cancel_order) } - %a.resume-order.icon-resume.no-text{ href: 'javascript:void(0)', ng: { show: "proxyOrder.state == 'canceled'", click: "resumeOrder(proxyOrder)" }, 'ofn-with-tip' => t(:resume_order) } + %a.cancel-order.icon-remove.no-text{ "href" => 'javascript:void(0)', "ofn-with-tip" => t(:cancel_order), "ng-hide" => "proxyOrder.state == 'canceled'", "ng-click" => "cancelOrder(proxyOrder)" } + %a.resume-order.icon-resume.no-text{ "href" => 'javascript:void(0)', "ofn-with-tip" => t(:resume_order), "ng-show" => "proxyOrder.state == 'canceled'", "ng-click" => "resumeOrder(proxyOrder)" } diff --git a/app/views/admin/subscriptions/_products.html.haml b/app/views/admin/subscriptions/_products.html.haml index 88d206e69d..569ad38c37 100644 --- a/app/views/admin/subscriptions/_products.html.haml +++ b/app/views/admin/subscriptions/_products.html.haml @@ -1,3 +1,3 @@ -%div{ ng: { controller: 'SubscriptionLineItemsController' } } +%div{ "ng-controller" => 'SubscriptionLineItemsController' } = render 'autocomplete' = render 'subscription_line_items' diff --git a/app/views/admin/subscriptions/_products_panel.html.haml b/app/views/admin/subscriptions/_products_panel.html.haml index 330e2fe0c1..bfb5fbe428 100644 --- a/app/views/admin/subscriptions/_products_panel.html.haml +++ b/app/views/admin/subscriptions/_products_panel.html.haml @@ -1,15 +1,15 @@ = render :partial => "spree/admin/variants/autocomplete", :formats => :js %script{ type: "text/ng-template", id: "admin/panels/subscription_products.html" } - %form{ name: 'subscription_form', ng: { controller: 'ProductsPanelController' } } + %form{ "name" => 'subscription_form', "ng-controller" => 'ProductsPanelController' } %div{ style: 'width: 90%; margin: auto;' } = render 'products' - %a.button.update.fullwidth{ ng: { class: "{disabled: saved() && !saving, saving: saving}", click: "save()" } } - %span{ ng: {hide: "saved() || saving" } } + %a.button.update.fullwidth{ "ng-class" => "{disabled: saved() && !saving, saving: saving}", "ng-click" => "save()" } + %span{ "ng-hide" => "saved() || saving" } = t('.save') %i.icon-save - %span{ ng: {show: "saved() && !saving" } } + %span{ "ng-show" => "saved() && !saving" } = t('.saved') %i.icon-ok-sign - %span{ ng: {show: "saving" } } + %span{ "ng-show" => "saving" } = t('.saving') %i.icon-refresh diff --git a/app/views/admin/subscriptions/_review.html.haml b/app/views/admin/subscriptions/_review.html.haml index 9e5fcb7d55..3dd5a97543 100644 --- a/app/views/admin/subscriptions/_review.html.haml +++ b/app/views/admin/subscriptions/_review.html.haml @@ -6,7 +6,7 @@ .five.columns.alpha %h3= t('.details') .eleven.columns.omega - %input#edit-details{ type: "button", value: t(:edit), ng: { click: "setView('details')" } } + %input#edit-details{ "type" => "button", "value" => t(:edit), "ng-click" => "setView('details')" } .row .five.columns.alpha %strong= t('admin.customer') @@ -35,7 +35,7 @@ .five.columns.alpha %h3= t('.address') .eleven.columns.omega - %input#edit-address{ type: "button", value: t(:edit), ng: { click: "setView('address')" } } + %input#edit-address{ "type" => "button", "value" => t(:edit), "ng-click" => "setView('address')" } .row .five.columns.alpha %strong= t('admin.bill_address') @@ -53,7 +53,7 @@ .five.columns.alpha %h3= t('.products') .eleven.columns.omega - %input#edit-products{ type: "button", value: t(:edit), ng: { click: "setView('products')" } } + %input#edit-products{ "type" => "button", "value" => t(:edit), "ng-click" => "setView('products')" } .row %table#subscription-line-items.admin-subscription-review-subscription-line-items %colgroup @@ -69,10 +69,10 @@ %th.total %span= t(:total) %tbody - %tr.item{ id: "sli_{{$index}}", ng: { repeat: "item in subscription.subscription_line_items | filter:{ _destroy: '!true' }", class: { even: 'even', odd: 'odd' } } } + %tr.item{ "id" => "sli_{{$index}}", "ng-repeat" => "item in subscription.subscription_line_items | filter:{ _destroy: '!true' }", "ng-class-even" => 'even', "ng-class-odd" => 'odd' } %td .description {{ item.description }} - .not-in-open-and-upcoming-order-cycles-warning{ ng: { if: '!item.in_open_and_upcoming_order_cycles' } } + .not-in-open-and-upcoming-order-cycles-warning{ "ng-if" => '!item.in_open_and_upcoming_order_cycles' } = t(".no_open_or_upcoming_order_cycle") %td.price.align-center {{ item.price_estimate | localizeCurrency }} %td.quantity {{ item.quantity }} diff --git a/app/views/admin/subscriptions/_subscription_line_items.html.haml b/app/views/admin/subscriptions/_subscription_line_items.html.haml index 561cc76996..1423c1f490 100644 --- a/app/views/admin/subscriptions/_subscription_line_items.html.haml +++ b/app/views/admin/subscriptions/_subscription_line_items.html.haml @@ -14,17 +14,17 @@ %span= t(:total) %th.orders-actions.actions %tbody - %tr.item{ id: "sli_{{$index}}", ng: { repeat: "item in subscription.subscription_line_items | filter:{ _destroy: '!true' }", class: { even: 'even', odd: 'odd' } } } + %tr.item{ "id" => "sli_{{$index}}", "ng-repeat" => "item in subscription.subscription_line_items | filter:{ _destroy: '!true' }", "ng-class-even" => 'even', "ng-class-odd" => 'odd' } %td .description {{ item.description }} - .not-in-open-and-upcoming-order-cycles-warning{ ng: { if: '!item.in_open_and_upcoming_order_cycles' } } + .not-in-open-and-upcoming-order-cycles-warning{ "ng-if" => '!item.in_open_and_upcoming_order_cycles' } = t(".not_in_open_and_upcoming_order_cycles_warning") %td.price.align-center {{ item.price_estimate | localizeCurrency }} %td.quantity - %input{ name: 'quantity', type: 'number', min: 0, ng: { model: 'item.quantity' } } + %input{ "name" => 'quantity', "type" => 'number', "min" => 0, "ng-model" => 'item.quantity' } %td.total.align-center {{ (item.price_estimate * item.quantity) | localizeCurrency }} %td.actions - %a.delete-item.icon-trash.no-text{ ng: { click: 'removeSubscriptionLineItem(item)'}, :href => "javascript:void(0)" } + %a.delete-item.icon-trash.no-text{ "href" => "javascript:void(0)", "ng-click" => 'removeSubscriptionLineItem(item)' } %tbody#subtotal.no-border-top %tr#subtotal-row %td{:colspan => "3"} @@ -34,7 +34,7 @@ %td.total.align-center %span#order_subtotal {{ subscription.estimatedSubtotal() | localizeCurrency }} %td.actions - %tbody#fees.no-border-top{ ng: { show: "subscription.estimatedFees() > 0" } } + %tbody#fees.no-border-top{ "ng-show" => "subscription.estimatedFees() > 0" } %tr#fees-row %td{:colspan => "3"} %b diff --git a/app/views/admin/subscriptions/_table.html.haml b/app/views/admin/subscriptions/_table.html.haml index 4f45080694..507fa4331e 100644 --- a/app/views/admin/subscriptions/_table.html.haml +++ b/app/views/admin/subscriptions/_table.html.haml @@ -1,7 +1,7 @@ = render 'products_panel' = render 'orders_panel' -%table.index#subscriptions{ ng: { cloak: true, show: 'shop_id && !RequestMonitor.loading && filteredSubscriptions.length > 0' } } +%table.index#subscriptions{ "ng-cloak" => true, "ng-show" => 'shop_id && !RequestMonitor.loading && filteredSubscriptions.length > 0' } %col.customer{ width: "20%", 'ng-show' => 'columns.customer.visible' } %col.schedule{ width: "20%", 'ng-show' => 'columns.schedule.visible' } %col.items{ width: "10%", 'ng-show' => 'columns.items.visible' } @@ -16,47 +16,47 @@ %tr -# %th.bulk -# %input{ :type => "checkbox", :name => 'toggle_bulk', 'ng-click' => 'toggleAllCheckboxes()', 'ng-checked' => "allBoxesChecked()" } - %th.customer{ ng: { show: 'columns.customer.visible' } } + %th.customer{ "ng-show" => 'columns.customer.visible' } = t('admin.customer') - %th.schedule{ ng: { show: 'columns.schedule.visible', } } + %th.schedule{ "ng-show" => 'columns.schedule.visible' } = t('admin.schedule') - %th.items{ ng: { show: 'columns.items.visible', } } + %th.items{ "ng-show" => 'columns.items.visible' } = t('admin.items') - %th.orders{ ng: { show: 'columns.orders.visible', } } + %th.orders{ "ng-show" => 'columns.orders.visible' } = t('orders') - %th.status{ ng: { show: 'columns.state.visible', } } + %th.status{ "ng-show" => 'columns.state.visible' } = t('admin.status_state') - %th.begins_on{ ng: { show: 'columns.begins_on.visible', } } + %th.begins_on{ "ng-show" => 'columns.begins_on.visible' } = t('admin.begins_on') - %th.ends_on{ ng: { show: 'columns.ends_on.visible', } } + %th.ends_on{ "ng-show" => 'columns.ends_on.visible' } = t('admin.ends_on') - %th.payment_method{ ng: { show: 'columns.payment_method.visible', } } + %th.payment_method{ "ng-show" => 'columns.payment_method.visible' } = t('admin.payment_method') - %th.shipping_method{ ng: { show: 'columns.shipping_method.visible', } } + %th.shipping_method{ "ng-show" => 'columns.shipping_method.visible' } = t('admin.shipping_method') %th.actions   - %tbody.panel-ctrl{ object: 'subscription', ng: { repeat: "subscription in subscriptions | filter:query as filteredSubscriptions track by subscription.id" } } - %tr.subscription{ :id => "so_{{subscription.id}}", ng: { class: { even: "'even'", odd: "'odd'" } } } - %td.customer{ ng: { show: 'columns.customer.visible'}} + %tbody.panel-ctrl{ "object" => 'subscription', "ng-repeat" => "subscription in subscriptions | filter:query as filteredSubscriptions track by subscription.id" } + %tr.subscription{ "id" => "so_{{subscription.id}}", "ng-class-even" => "'even'", "ng-class-odd" => "'odd'" } + %td.customer{ "ng-show" => 'columns.customer.visible' } %span{ "ng-bind": '::subscription.customer_email' } %br %span{ "ng-bind": '::subscription.customer_full_name' } - %td.schedule{ ng: { show: 'columns.schedule.visible', bind: '::subscription.schedule_name' } } - %td.items.panel-toggle{ name: 'products', ng: { show: 'columns.items.visible' } } - %h5{ ng: { bind: 'itemCount(subscription)' } } - %td.orders.panel-toggle{ name: 'orders', ng: { show: 'columns.orders.visible' } } - %h5{ ng: { bind: 'subscription.not_closed_proxy_orders.length' } } - %td.status{ ng: { show: 'columns.state.visible' } } - %span.state{ ng: { class: "subscription.state", bind: "'spree.subscription_state.' + subscription.state | t" } } - %td.begins_on{ ng: { show: 'columns.begins_on.visible', bind: '::subscription.begins_at' } } - %td.ends_on{ ng: { show: 'columns.ends_on.visible', bind: '::subscription.ends_at' } } - %td.payment_method{ ng: { show: 'columns.payment_method.visible', bind: '::paymentMethodsByID[subscription.payment_method_id].name' } } - %td.shipping_method{ ng: { show: 'columns.shipping_method.visible', bind: '::shippingMethodsByID[subscription.shipping_method_id].name' } } + %td.schedule{ "ng-show" => 'columns.schedule.visible', "ng-bind" => '::subscription.schedule_name' } + %td.items.panel-toggle{ "name" => 'products', "ng-show" => 'columns.items.visible' } + %h5{ "ng-bind" => 'itemCount(subscription)' } + %td.orders.panel-toggle{ "name" => 'orders', "ng-show" => 'columns.orders.visible' } + %h5{ "ng-bind" => 'subscription.not_closed_proxy_orders.length' } + %td.status{ "ng-show" => 'columns.state.visible' } + %span.state{ "ng-class" => "subscription.state", "ng-bind" => "'spree.subscription_state.' + subscription.state | t" } + %td.begins_on{ "ng-show" => 'columns.begins_on.visible', "ng-bind" => '::subscription.begins_at' } + %td.ends_on{ "ng-show" => 'columns.ends_on.visible', "ng-bind" => '::subscription.ends_at' } + %td.payment_method{ "ng-show" => 'columns.payment_method.visible', "ng-bind" => '::paymentMethodsByID[subscription.payment_method_id].name' } + %td.shipping_method{ "ng-show" => 'columns.shipping_method.visible', "ng-bind" => '::shippingMethodsByID[subscription.shipping_method_id].name' } %td.actions - %a.edit-subscription.icon-edit.no-text{ ng: { href: '{{subscription.edit_path}}'}, 'ofn-with-tip' => t('.edit_subscription') } - %a.pause-subscription.icon-pause.no-text{ ng: { click: 'subscription.pause()', hide: '!!subscription.paused_at' }, 'ofn-with-tip' => t('.pause_subscription') , href: 'javascript:void(0)' } - %a.unpause-subscription.icon-play.no-text{ ng: { click: 'subscription.unpause()', show: '!!subscription.paused_at' }, 'ofn-with-tip' => t('.unpause_subscription') , href: 'javascript:void(0)' } - %a.cancel-subscription.icon-remove.no-text{ ng: { click: 'subscription.cancel()', hide: '!!subscription.canceled_at'}, 'ofn-with-tip' => t('.cancel_subscription') , href: 'javascript:void(0)' } + %a.edit-subscription.icon-edit.no-text{ "ofn-with-tip" => t('.edit_subscription'), "ng-href" => '{{subscription.edit_path}}' } + %a.pause-subscription.icon-pause.no-text{ "ofn-with-tip" => t('.pause_subscription'), "href" => 'javascript:void(0)', "ng-click" => 'subscription.pause()', "ng-hide" => '!!subscription.paused_at' } + %a.unpause-subscription.icon-play.no-text{ "ofn-with-tip" => t('.unpause_subscription'), "href" => 'javascript:void(0)', "ng-click" => 'subscription.unpause()', "ng-show" => '!!subscription.paused_at' } + %a.cancel-subscription.icon-remove.no-text{ "ofn-with-tip" => t('.cancel_subscription'), "href" => 'javascript:void(0)', "ng-click" => 'subscription.cancel()', "ng-hide" => '!!subscription.canceled_at' } %tr.panel-row{ object: "subscription", panels: "{products: 'subscription_products', orders: 'proxy_orders'}" } diff --git a/app/views/admin/subscriptions/_wizard_progress.html.haml b/app/views/admin/subscriptions/_wizard_progress.html.haml index d8f381247b..b07660ef9c 100644 --- a/app/views/admin/subscriptions/_wizard_progress.html.haml +++ b/app/views/admin/subscriptions/_wizard_progress.html.haml @@ -1,3 +1,3 @@ %ul.wizard-progress - %li{ ng: { repeat: "step in ['details','address','products','review']", class: '{current: view==step}' } } + %li{ "ng-repeat" => "step in ['details','address','products','review']", "ng-class" => '{current: view==step}' } {{ stepTitleFor(step) }} diff --git a/app/views/admin/subscriptions/edit.html.haml b/app/views/admin/subscriptions/edit.html.haml index 51b4c40045..13706651d8 100644 --- a/app/views/admin/subscriptions/edit.html.haml +++ b/app/views/admin/subscriptions/edit.html.haml @@ -4,7 +4,7 @@ -# - content_for :page_actions do -# %li= button_link_to "Back to subscriptions list", main_app.admin_subscriptions_path, icon: 'icon-arrow-left' -%div{ ng: { app: 'admin.subscriptions', controller: 'SubscriptionController', cloak: true } } +%div{ "ng-app" => 'admin.subscriptions', "ng-controller" => 'SubscriptionController', "ng-cloak" => true } = render 'data' = render 'order_update_issues_dialog' = render 'form' diff --git a/app/views/admin/subscriptions/index.html.haml b/app/views/admin/subscriptions/index.html.haml index 3e0ebebd90..464acf0530 100644 --- a/app/views/admin/subscriptions/index.html.haml +++ b/app/views/admin/subscriptions/index.html.haml @@ -15,7 +15,7 @@ = render 'data' = render 'order_update_issues_dialog' -%div.margin-bottom-50{ ng: { controller: 'SubscriptionsController' } } +%div.margin-bottom-50{ "ng-controller" => 'SubscriptionsController' } %save-bar{ dirty: "false", persist: "false" } = render 'filters' = render 'controls' diff --git a/app/views/admin/subscriptions/new.html.haml b/app/views/admin/subscriptions/new.html.haml index 6ac3749982..288926d83f 100644 --- a/app/views/admin/subscriptions/new.html.haml +++ b/app/views/admin/subscriptions/new.html.haml @@ -6,7 +6,7 @@ -# - content_for :page_actions do -# %li= button_link_to "Back to subscriptions list", main_app.admin_subscriptions_path, icon: 'icon-arrow-left' -%div{ ng: { app: 'admin.subscriptions', controller: 'SubscriptionController', cloak: true } } +%div{ "ng-app" => 'admin.subscriptions', "ng-controller" => 'SubscriptionController', "ng-cloak" => true } = render 'data' = render 'wizard_progress' = render 'order_update_issues_dialog' diff --git a/app/views/admin/variant_overrides/_controls.html.haml b/app/views/admin/variant_overrides/_controls.html.haml index 1f407a4b35..b7411c850e 100644 --- a/app/views/admin/variant_overrides/_controls.html.haml +++ b/app/views/admin/variant_overrides/_controls.html.haml @@ -1,15 +1,15 @@ -%hr.divider.sixteen.columns.alpha.omega{ ng: { show: 'hub_id && products.length > 0' } } -.controls.sixteen.columns.alpha.omega{ ng: { show: 'hub_id && products.length > 0' } } +%hr.divider.sixteen.columns.alpha.omega{ "ng-show" => 'hub_id && products.length > 0' } +.controls.sixteen.columns.alpha.omega{ "ng-show" => 'hub_id && products.length > 0' } .eight.columns.alpha = render 'admin/shared/bulk_actions_dropdown' = render 'admin/shared/views_dropdown' - %span.text-big.with-tip.icon-question-sign{ ng: { show: 'views.inventory.visible' } , data: { powertip: "#{t('admin.variant_overrides.index.inventory_powertip')}" } } - %span.text-big.with-tip.icon-question-sign{ ng: { show: 'views.hidden.visible' } , data: { powertip: "#{t('admin.variant_overrides.index.hidden_powertip')}" } } - %span.text-big.with-tip.icon-question-sign{ ng: { show: 'views.new.visible' } , data: { powertip: "#{t('admin.variant_overrides.index.new_powertip')}" } } + %span.text-big.with-tip.icon-question-sign{ "ng-show" => 'views.inventory.visible', "data-powertip" => "#{t('admin.variant_overrides.index.inventory_powertip')}" } + %span.text-big.with-tip.icon-question-sign{ "ng-show" => 'views.hidden.visible', "data-powertip" => "#{t('admin.variant_overrides.index.hidden_powertip')}" } + %span.text-big.with-tip.icon-question-sign{ "ng-show" => 'views.new.visible', "data-powertip" => "#{t('admin.variant_overrides.index.new_powertip')}" } .four.columns   - .four.columns.omega{ ng: { show: 'views.new.visible' } } - %button.fullwidth{ type: 'button', ng: { click: "selectView('inventory')" } } + .four.columns.omega{ "ng-show" => 'views.new.visible' } + %button.fullwidth{ "type" => 'button', "ng-click" => "selectView('inventory')" } %i.icon-chevron-left = t('.back_to_my_inventory') - .four.columns.omega{ng: { show: 'views.inventory.visible' } } + .four.columns.omega{ "ng-show" => 'views.inventory.visible' } %columns-dropdown{ action: "#{controller_name}_#{action_name}" } diff --git a/app/views/admin/variant_overrides/_filters.html.haml b/app/views/admin/variant_overrides/_filters.html.haml index bafb413ae5..a8cb0f744b 100644 --- a/app/views/admin/variant_overrides/_filters.html.haml +++ b/app/views/admin/variant_overrides/_filters.html.haml @@ -1,20 +1,20 @@ .filters.sixteen.columns.alpha.omega .filter.four.columns.alpha - %label{for: 'query', ng: {class: '{disabled: !hub_id}'} }=t('admin.quick_search') + %label{ "for" => 'query', "ng-class" => '{disabled: !hub_id}' }=t('admin.quick_search') %br - %input.fullwidth{type: "text", id: 'query', ng: {model: 'query', disabled: '!hub_id'} } + %input.fullwidth{ "type" => "text", "id" => 'query', "ng-model" => 'query', "ng-disabled" => '!hub_id' } .filter_select.three.columns - %label{for: 'hub_id', ng: {bind: "hub_id ? '#{t('admin.shop')}' : '#{t('admin.variant_overrides.index.select_a_shop')}'" } } + %label{ "for" => 'hub_id', "ng-bind" => "hub_id ? '#{t('admin.shop')}' : '#{t('admin.variant_overrides.index.select_a_shop')}'" } %br - %select.select2.fullwidth#hub_id{name: 'hub_id', ng: {model: 'hub_id', options: 'hub.id as hub.name for (id, hub) in hubs' } } + %select.select2.fullwidth#hub_id{ "name" => 'hub_id', "ng-model" => 'hub_id', "ng-options" => 'hub.id as hub.name for (id, hub) in hubs' } .filter_select.three.columns - %label{for: 'producer_filter', ng: {class: '{disabled: !hub_id}'} }=t('admin.producer') + %label{ "for" => 'producer_filter', "ng-class" => '{disabled: !hub_id}' }=t('admin.producer') %br - %input.ofn-select2.fullwidth{id: 'producer_filter', type: 'number', data: 'producers', blank: "{id: 0, name: '#{t(:all)}'}", ng: {model: 'producerFilter', disabled: '!hub_id' } } + %input.ofn-select2.fullwidth{ "id" => 'producer_filter', "type" => 'number', "data" => 'producers', "blank" => "{id: 0, name: '#{t(:all)}'}", "ng-model" => 'producerFilter', "ng-disabled" => '!hub_id' } .filter_select.three.columns - %label{ :for => 'import_date_filter', ng: {class: '{disabled: !hub_id}'} } #{t('admin.variant_overrides.index.import_date')} + %label{ "for" => 'import_date_filter', "ng-class" => '{disabled: !hub_id}' } #{t('admin.variant_overrides.index.import_date')} %br - %select.fullwidth{id: 'import_date_filter', 'ofn-select2-min-search' => 5, ng: {model: 'importDateFilter', options: 'date.id as date.name for date in import_dates', disabled: '!hub_id', init: "import_dates = #{@import_dates}"} } + %select.fullwidth{ "id" => 'import_date_filter', "ofn-select2-min-search" => 5, "ng-model" => 'importDateFilter', "ng-options" => 'date.id as date.name for date in import_dates', "ng-disabled" => '!hub_id', "ng-init" => "import_dates = #{@import_dates}" } %options{value: '0', selected: 'selected'} #{t(:all)} -# .filter_select{ :class => "three columns" } -# %label{ :for => 'distributor_filter' }Hub @@ -27,4 +27,4 @@ .filter_clear.three.columns.omega %label{ :for => 'clear_all_filters' } %br - %input.red.fullwidth{ :type => 'button', :id => 'clear_all_filters', :value => "#{t('admin.clear_all')}", ng: { click: "resetSelectFilters()", disabled: '!hub_id'} } + %input.red.fullwidth{ "type" => 'button', "id" => 'clear_all_filters', "value" => "#{t('admin.clear_all')}", "ng-click" => "resetSelectFilters()", "ng-disabled" => '!hub_id' } diff --git a/app/views/admin/variant_overrides/_hidden_products.html.haml b/app/views/admin/variant_overrides/_hidden_products.html.haml index 38f144b479..440b2040e0 100644 --- a/app/views/admin/variant_overrides/_hidden_products.html.haml +++ b/app/views/admin/variant_overrides/_hidden_products.html.haml @@ -1,5 +1,5 @@ -%div{ ng: { show: 'views.hidden.visible' } } - %table#hidden-products{ ng: { show: 'filteredProducts.length > 0' } } +%div{ "ng-show" => 'views.hidden.visible' } + %table#hidden-products{ "ng-show" => 'filteredProducts.length > 0' } %col.producer{ width: "20%" } %col.product{ width: "20%" } %col.variant{ width: "20%" } @@ -10,13 +10,13 @@ %th.product=t('admin.product') %th.variant=t('admin.variant') %th.add=t('admin.variant_overrides.index.add') - %tbody{ ng: { repeat: 'product in filteredProducts | limitTo:productLimit' } } - %tr{ id: "v_{{variant.id}}", ng: { repeat: 'variant in product.variants | inventoryVariants:hub_id:views' } } - %td.producer{ ng: { bind: '::producersByID[product.producer_id].name'} } - %td.product{ ng: { bind: '::product.name'} } + %tbody{ "ng-repeat" => 'product in filteredProducts | limitTo:productLimit' } + %tr{ "id" => "v_{{variant.id}}", "ng-repeat" => 'variant in product.variants | inventoryVariants:hub_id:views' } + %td.producer{ "ng-bind" => '::producersByID[product.producer_id].name' } + %td.product{ "ng-bind" => '::product.name' } %td.variant - %span{ ng: { bind: '::variant.display_name || ""'} } - .variant-override-unit{ ng: { bind: '::variant.unit_to_display'} } + %span{ "ng-bind" => '::variant.display_name || ""' } + .variant-override-unit{ "ng-bind" => '::variant.unit_to_display' } %td.add - %button.fullwidth.icon-plus{ ng: { click: "setVisibility(hub_id,variant.id,true)" } } + %button.fullwidth.icon-plus{ "ng-click" => "setVisibility(hub_id,variant.id,true)" } = t('admin.variant_overrides.index.add') diff --git a/app/views/admin/variant_overrides/_loading_flash.html.haml b/app/views/admin/variant_overrides/_loading_flash.html.haml index 0095c543e8..fdf2bb76d2 100644 --- a/app/views/admin/variant_overrides/_loading_flash.html.haml +++ b/app/views/admin/variant_overrides/_loading_flash.html.haml @@ -1,4 +1,4 @@ -%div.sixteen.columns.alpha.omega#loading{ ng: { cloak: true, if: 'hub_id && products.length == 0 && RequestMonitor.loading' } } +%div.sixteen.columns.alpha.omega#loading{ "ng-cloak" => true, "ng-if" => 'hub_id && products.length == 0 && RequestMonitor.loading' } = render partial: "components/admin_spinner" %h1 = t('.loading_inventory') diff --git a/app/views/admin/variant_overrides/_new_products.html.haml b/app/views/admin/variant_overrides/_new_products.html.haml index 731535d06d..88cfd798a4 100644 --- a/app/views/admin/variant_overrides/_new_products.html.haml +++ b/app/views/admin/variant_overrides/_new_products.html.haml @@ -1,4 +1,4 @@ -%table#new-products{ ng: { show: 'views.new.visible && filteredProducts.length > 0' } } +%table#new-products{ "ng-show" => 'views.new.visible && filteredProducts.length > 0' } %col.producer{ width: "20%" } %col.product{ width: "20%" } %col.variant{ width: "20%" } @@ -11,16 +11,16 @@ %th.variant=t('admin.variant') %th.add=t('admin.variant_overrides.index.add') %th.hide=t('admin.variant_overrides.index.hide') - %tbody{ ng: { repeat: 'product in filteredProducts | limitTo:productLimit' } } - %tr{ id: "v_{{variant.id}}", ng: { repeat: 'variant in product.variants | inventoryVariants:hub_id:views' } } - %td.producer{ ng: { bind: { html: '::producersByID[product.producer_id].name'} } } - %td.product{ ng: { bind: '::product.name'} } + %tbody{ "ng-repeat" => 'product in filteredProducts | limitTo:productLimit' } + %tr{ "id" => "v_{{variant.id}}", "ng-repeat" => 'variant in product.variants | inventoryVariants:hub_id:views' } + %td.producer{ "ng-bind-html" => '::producersByID[product.producer_id].name' } + %td.product{ "ng-bind" => '::product.name' } %td.variant - %span{ ng: { bind: '::variant.display_name || ""'} } - .variant-override-unit{ ng: { bind: '::variant.unit_to_display'} } + %span{ "ng-bind" => '::variant.display_name || ""' } + .variant-override-unit{ "ng-bind" => '::variant.unit_to_display' } %td.add - %button.fullwidth.icon-plus{ ng: { click: "setVisibility(hub_id,variant.id,true)" } } + %button.fullwidth.icon-plus{ "ng-click" => "setVisibility(hub_id,variant.id,true)" } = t('admin.variant_overrides.index.add') %td.hide - %button.fullwidth.icon-remove{ ng: { click: "setVisibility(hub_id,variant.id,false)" } } + %button.fullwidth.icon-remove{ "ng-click" => "setVisibility(hub_id,variant.id,false)" } = t('admin.variant_overrides.index.hide') diff --git a/app/views/admin/variant_overrides/_new_products_alert.html.haml b/app/views/admin/variant_overrides/_new_products_alert.html.haml index 385616d817..f36aee06f3 100644 --- a/app/views/admin/variant_overrides/_new_products_alert.html.haml +++ b/app/views/admin/variant_overrides/_new_products_alert.html.haml @@ -1,5 +1,3 @@ -%div{ ng: { show: '(newProductCount = (products | hubPermissions:hubPermissions:hub_id | newInventoryProducts:hub_id).length) > 0 && !views.new.visible && !alertDismissed' } } +%div{ "ng-show" => '(newProductCount = (products | hubPermissions:hubPermissions:hub_id | newInventoryProducts:hub_id).length) > 0 && !views.new.visible && !alertDismissed' } %hr.divider.sixteen.columns.alpha.omega - %alert-row{ message: "#{t('admin.variant_overrides.index.new_products_alert_message', new_product_count: '{{ newProductCount }}')}", - dismissed: "alertDismissed", - button: { text: "#{t('admin.variant_overrides.index.review_now')}", action: "selectView('new')" } } + %alert-row{ "message" => "#{t('admin.variant_overrides.index.new_products_alert_message', new_product_count: '{{ newProductCount }}')}", "dismissed" => "alertDismissed", "button-text" => "#{t('admin.variant_overrides.index.review_now')}", "button-action" => "selectView('new')" } diff --git a/app/views/admin/variant_overrides/_no_results.html.haml b/app/views/admin/variant_overrides/_no_results.html.haml index 7ec4e68f0e..3267673102 100644 --- a/app/views/admin/variant_overrides/_no_results.html.haml +++ b/app/views/admin/variant_overrides/_no_results.html.haml @@ -1,7 +1,7 @@ -%div.text-big.no-results{ ng: { show: 'hub_id && products.length > 0 && filteredProducts.length == 0' } } - %span{ ng: { show: 'views.inventory.visible && !filtersApplied()' } }=t('admin.variant_overrides.index.currently_empty') - %span{ ng: { show: 'views.inventory.visible && filtersApplied()' } }=t('admin.variant_overrides.index.no_matching_products') - %span{ ng: { show: 'views.hidden.visible && !filtersApplied()' } }=t('admin.variant_overrides.index.no_hidden_products') - %span{ ng: { show: 'views.hidden.visible && filtersApplied()' } }=t('admin.variant_overrides.index.no_matching_hidden_products') - %span{ ng: { show: 'views.new.visible && !filtersApplied()' } }=t('admin.variant_overrides.index.no_new_products') - %span{ ng: { show: 'views.new.visible && filtersApplied()' } }=t('admin.variant_overrides.index.no_matching_new_products') +%div.text-big.no-results{ "ng-show" => 'hub_id && products.length > 0 && filteredProducts.length == 0' } + %span{ "ng-show" => 'views.inventory.visible && !filtersApplied()' }=t('admin.variant_overrides.index.currently_empty') + %span{ "ng-show" => 'views.inventory.visible && filtersApplied()' }=t('admin.variant_overrides.index.no_matching_products') + %span{ "ng-show" => 'views.hidden.visible && !filtersApplied()' }=t('admin.variant_overrides.index.no_hidden_products') + %span{ "ng-show" => 'views.hidden.visible && filtersApplied()' }=t('admin.variant_overrides.index.no_matching_hidden_products') + %span{ "ng-show" => 'views.new.visible && !filtersApplied()' }=t('admin.variant_overrides.index.no_new_products') + %span{ "ng-show" => 'views.new.visible && filtersApplied()' }=t('admin.variant_overrides.index.no_matching_new_products') diff --git a/app/views/admin/variant_overrides/_products.html.haml b/app/views/admin/variant_overrides/_products.html.haml index e8d239b803..d50a99e9b5 100644 --- a/app/views/admin/variant_overrides/_products.html.haml +++ b/app/views/admin/variant_overrides/_products.html.haml @@ -1,32 +1,32 @@ -%form{ name: 'variant_overrides_form', ng: { show: "views.inventory.visible" } } +%form{ "name" => 'variant_overrides_form', "ng-show" => "views.inventory.visible" } %save-bar{ dirty: "customers_form.$dirty", persist: "false" } - %input.red{ type: "button", value: t(:save_changes), ng: { click: "update()", disabled: "!variant_overrides_form.$dirty" } } + %input.red{ "type" => "button", "value" => t(:save_changes), "ng-click" => "update()", "ng-disabled" => "!variant_overrides_form.$dirty" } %table.index.bulk#variant-overrides - %col.producer{ width: "20%", ng: { show: 'columns.producer.visible' } } - %col.product{ width: "20%", ng: { show: 'columns.product.visible' } } - %col.sku{ width: "20%", ng: { show: 'columns.sku.visible' } } - %col.price{ width: "10%", ng: { show: 'columns.price.visible' } } - %col.on_hand{ width: "10%", ng: { show: 'columns.on_hand.visible' } } - %col.on_demand{ width: "10%", ng: { show: 'columns.on_demand.visible' } } - %col.reset{ width: "1%", ng: { show: 'columns.reset.visible' } } - %col.reset{ width: "15%", ng: { show: 'columns.reset.visible' } } - %col.inheritance{ width: "5%", ng: { show: 'columns.inheritance.visible' } } - %col.tags{ width: "30%", ng: { show: 'columns.tags.visible' } } - %col.visibility{ width: "10%", ng: { show: 'columns.visibility.visible' } } - %col.visibility{ width: "10%", ng: { show: 'columns.import_date.visible' } } + %col.producer{ "width" => "20%", "ng-show" => 'columns.producer.visible' } + %col.product{ "width" => "20%", "ng-show" => 'columns.product.visible' } + %col.sku{ "width" => "20%", "ng-show" => 'columns.sku.visible' } + %col.price{ "width" => "10%", "ng-show" => 'columns.price.visible' } + %col.on_hand{ "width" => "10%", "ng-show" => 'columns.on_hand.visible' } + %col.on_demand{ "width" => "10%", "ng-show" => 'columns.on_demand.visible' } + %col.reset{ "width" => "1%", "ng-show" => 'columns.reset.visible' } + %col.reset{ "width" => "15%", "ng-show" => 'columns.reset.visible' } + %col.inheritance{ "width" => "5%", "ng-show" => 'columns.inheritance.visible' } + %col.tags{ "width" => "30%", "ng-show" => 'columns.tags.visible' } + %col.visibility{ "width" => "10%", "ng-show" => 'columns.visibility.visible' } + %col.visibility{ "width" => "10%", "ng-show" => 'columns.import_date.visible' } %thead - %tr{ ng: { controller: "ColumnsCtrl" } } - %th.producer{ ng: { show: 'columns.producer.visible' } }=t('admin.producer') - %th.product{ ng: { show: 'columns.product.visible' } }=t('admin.product') - %th.sku{ ng: { show: 'columns.sku.visible' } }=t('admin.sku') - %th.price{ ng: { show: 'columns.price.visible' } }=t('admin.price') - %th.on_hand{ ng: { show: 'columns.on_hand.visible' } }=t('admin.on_hand') - %th.on_demand{ ng: { show: 'columns.on_demand.visible' } }=t('admin.on_demand?') - %th.reset{ colspan: 2, ng: { show: 'columns.reset.visible' } }=t('admin.variant_overrides.index.enable_reset?') - %th.inheritance{ ng: { show: 'columns.inheritance.visible' } }=t('admin.variant_overrides.index.inherit?') - %th.tags{ ng: { show: 'columns.tags.visible' } }=t('admin.tags') - %th.visibility{ ng: { show: 'columns.visibility.visible' } }=t('admin.variant_overrides.index.hide') - %th.import_date{ ng: { show: 'columns.import_date.visible' } }=t('admin.variant_overrides.index.import_date') - %tbody{ ng: {repeat: 'product in filteredProducts = (products | hubPermissions:hubPermissions:hub_id | inventoryProducts:hub_id:views | attrFilter:{producer_id:producerFilter} | importDate:hub_id:importDateFilter | filter:query) | limitTo:productLimit' } } + %tr{ "ng-controller" => "ColumnsCtrl" } + %th.producer{ "ng-show" => 'columns.producer.visible' }=t('admin.producer') + %th.product{ "ng-show" => 'columns.product.visible' }=t('admin.product') + %th.sku{ "ng-show" => 'columns.sku.visible' }=t('admin.sku') + %th.price{ "ng-show" => 'columns.price.visible' }=t('admin.price') + %th.on_hand{ "ng-show" => 'columns.on_hand.visible' }=t('admin.on_hand') + %th.on_demand{ "ng-show" => 'columns.on_demand.visible' }=t('admin.on_demand?') + %th.reset{ "colspan" => 2, "ng-show" => 'columns.reset.visible' }=t('admin.variant_overrides.index.enable_reset?') + %th.inheritance{ "ng-show" => 'columns.inheritance.visible' }=t('admin.variant_overrides.index.inherit?') + %th.tags{ "ng-show" => 'columns.tags.visible' }=t('admin.tags') + %th.visibility{ "ng-show" => 'columns.visibility.visible' }=t('admin.variant_overrides.index.hide') + %th.import_date{ "ng-show" => 'columns.import_date.visible' }=t('admin.variant_overrides.index.import_date') + %tbody{ "ng-repeat" => 'product in filteredProducts = (products | hubPermissions:hubPermissions:hub_id | inventoryProducts:hub_id:views | attrFilter:{producer_id:producerFilter} | importDate:hub_id:importDateFilter | filter:query) | limitTo:productLimit' } = render 'admin/variant_overrides/products_product' = render 'admin/variant_overrides/products_variants' diff --git a/app/views/admin/variant_overrides/_products_product.html.haml b/app/views/admin/variant_overrides/_products_product.html.haml index 312273d4d2..070abddd87 100644 --- a/app/views/admin/variant_overrides/_products_product.html.haml +++ b/app/views/admin/variant_overrides/_products_product.html.haml @@ -1,12 +1,12 @@ %tr.product.even - %td.producer{ ng: { show: 'columns.producer.visible', bind: { html: '::producersByID[product.producer_id].name'} } } - %td.product{ ng: { show: 'columns.product.visible', bind: '::product.name'} } - %td.sku{ ng: { show: 'columns.sku.visible' } } - %td.price{ ng: { show: 'columns.price.visible' } } - %td.on_hand{ ng: { show: 'columns.on_hand.visible' } } - %td.on_demand{ ng: { show: 'columns.on_demand.visible' } } - %td.reset{ colspan: 2, ng: { show: 'columns.reset.visible' } } - %td.inheritance{ ng: { show: 'columns.inheritance.visible' } } - %td.tags{ ng: { show: 'columns.tags.visible' } } - %td.visibility{ ng: { show: 'columns.visibility.visible' } } - %td.import_date{ ng: { show: 'columns.import_date.visible' } } + %td.producer{ "ng-show" => 'columns.producer.visible', "ng-bind-html" => '::producersByID[product.producer_id].name' } + %td.product{ "ng-show" => 'columns.product.visible', "ng-bind" => '::product.name' } + %td.sku{ "ng-show" => 'columns.sku.visible' } + %td.price{ "ng-show" => 'columns.price.visible' } + %td.on_hand{ "ng-show" => 'columns.on_hand.visible' } + %td.on_demand{ "ng-show" => 'columns.on_demand.visible' } + %td.reset{ "colspan" => 2, "ng-show" => 'columns.reset.visible' } + %td.inheritance{ "ng-show" => 'columns.inheritance.visible' } + %td.tags{ "ng-show" => 'columns.tags.visible' } + %td.visibility{ "ng-show" => 'columns.visibility.visible' } + %td.import_date{ "ng-show" => 'columns.import_date.visible' } diff --git a/app/views/admin/variant_overrides/_products_variants.html.haml b/app/views/admin/variant_overrides/_products_variants.html.haml index 33f9fb9a61..8245745a5c 100644 --- a/app/views/admin/variant_overrides/_products_variants.html.haml +++ b/app/views/admin/variant_overrides/_products_variants.html.haml @@ -1,27 +1,27 @@ -%tr.variant{ id: "v_{{variant.id}}", ng: {repeat: 'variant in product.variants | inventoryVariants:hub_id:views'} } - %td.producer{ ng: { show: 'columns.producer.visible' } } - %td.product{ ng: { show: 'columns.product.visible' } } - %span{ ng: { bind: '::variant.display_name || ""'} } - .variant-override-unit{ ng: { bind: '::variant.unit_to_display'} } - %td.sku{ ng: { show: 'columns.sku.visible' } } - %input{name: 'variant-overrides-{{ variant.id }}-sku', type: 'text', ng: {model: 'variantOverrides[hub_id][variant.id].sku'}, placeholder: '{{ variant.sku }}', 'ofn-track-variant-override' => 'sku'} - %td.price{ ng: { show: 'columns.price.visible' } } - %input{name: 'variant-overrides-{{ variant.id }}-price', type: 'text', ng: {model: 'variantOverrides[hub_id][variant.id].price'}, placeholder: '{{ variant.price }}', 'ofn-track-variant-override' => 'price'} - %td.on_hand{ ng: { show: 'columns.on_hand.visible' } } - %input{name: 'variant-overrides-{{ variant.id }}-count_on_hand', type: 'text', ng: { model: 'variantOverrides[hub_id][variant.id].count_on_hand', readonly: 'variantOverrides[hub_id][variant.id].on_demand != false' }, placeholder: '{{ countOnHandPlaceholder(variant, hub_id) }}', 'ofn-track-variant-override' => 'count_on_hand'} - %td.on_demand{ ng: { show: 'columns.on_demand.visible' } } - %select{ name: 'variant-overrides-{{ variant.id }}-on_demand', ng: { model: 'variantOverrides[hub_id][variant.id].on_demand', change: 'updateCountOnHand(variant, hub_id)', options: 'option.value as option.description for option in onDemandOptions' }, 'ofn-track-variant-override' => 'on_demand' } - %td.reset{ ng: { show: 'columns.reset.visible' } } - %input{name: 'variant-overrides-{{ variant.id }}-resettable', type: 'checkbox', ng: {model: 'variantOverrides[hub_id][variant.id].resettable'}, placeholder: '{{ variant.resettable }}', 'ofn-track-variant-override' => 'resettable'} - %td.reset{ ng: { show: 'columns.reset.visible' } } - %input{name: 'variant-overrides-{{ variant.id }}-default_stock', type: 'text', ng: {model: 'variantOverrides[hub_id][variant.id].default_stock'}, placeholder: '{{ variant.default_stock ? variant.default_stock : ("admin.variant_overrides.index.default_stock" | t)}}', 'ofn-track-variant-override' => 'default_stock'} - %td.inheritance{ ng: { show: 'columns.inheritance.visible' } } - %input.field{ :type => 'checkbox', name: 'variant-overrides-{{ variant.id }}-inherit', ng: { model: 'inherit' }, 'track-inheritance' => true } - %td.tags{ ng: { show: 'columns.tags.visible' } } +%tr.variant{ "id" => "v_{{variant.id}}", "ng-repeat" => 'variant in product.variants | inventoryVariants:hub_id:views' } + %td.producer{ "ng-show" => 'columns.producer.visible' } + %td.product{ "ng-show" => 'columns.product.visible' } + %span{ "ng-bind" => '::variant.display_name || ""' } + .variant-override-unit{ "ng-bind" => '::variant.unit_to_display' } + %td.sku{ "ng-show" => 'columns.sku.visible' } + %input{ "name" => 'variant-overrides-{{ variant.id }}-sku', "type" => 'text', "placeholder" => '{{ variant.sku }}', "ofn-track-variant-override" => 'sku', "ng-model" => 'variantOverrides[hub_id][variant.id].sku' } + %td.price{ "ng-show" => 'columns.price.visible' } + %input{ "name" => 'variant-overrides-{{ variant.id }}-price', "type" => 'text', "placeholder" => '{{ variant.price }}', "ofn-track-variant-override" => 'price', "ng-model" => 'variantOverrides[hub_id][variant.id].price' } + %td.on_hand{ "ng-show" => 'columns.on_hand.visible' } + %input{ "name" => 'variant-overrides-{{ variant.id }}-count_on_hand', "type" => 'text', "placeholder" => '{{ countOnHandPlaceholder(variant, hub_id) }}', "ofn-track-variant-override" => 'count_on_hand', "ng-model" => 'variantOverrides[hub_id][variant.id].count_on_hand', "ng-readonly" => 'variantOverrides[hub_id][variant.id].on_demand != false' } + %td.on_demand{ "ng-show" => 'columns.on_demand.visible' } + %select{ "name" => 'variant-overrides-{{ variant.id }}-on_demand', "ofn-track-variant-override" => 'on_demand', "ng-model" => 'variantOverrides[hub_id][variant.id].on_demand', "ng-change" => 'updateCountOnHand(variant, hub_id)', "ng-options" => 'option.value as option.description for option in onDemandOptions' } + %td.reset{ "ng-show" => 'columns.reset.visible' } + %input{ "name" => 'variant-overrides-{{ variant.id }}-resettable', "type" => 'checkbox', "placeholder" => '{{ variant.resettable }}', "ofn-track-variant-override" => 'resettable', "ng-model" => 'variantOverrides[hub_id][variant.id].resettable' } + %td.reset{ "ng-show" => 'columns.reset.visible' } + %input{ "name" => 'variant-overrides-{{ variant.id }}-default_stock', "type" => 'text', "placeholder" => '{{ variant.default_stock ? variant.default_stock : ("admin.variant_overrides.index.default_stock" | t)}}', "ofn-track-variant-override" => 'default_stock', "ng-model" => 'variantOverrides[hub_id][variant.id].default_stock' } + %td.inheritance{ "ng-show" => 'columns.inheritance.visible' } + %input.field{ "type" => 'checkbox', "name" => 'variant-overrides-{{ variant.id }}-inherit', "track-inheritance" => true, "ng-model" => 'inherit' } + %td.tags{ "ng-show" => 'columns.tags.visible' } .tag_watcher{ 'track-tag-list' => true } %tags_with_translation{ object: 'variantOverrides[hub_id][variant.id]', form: 'variant_overrides_form' } - %td.visibility{ ng: { show: 'columns.visibility.visible' } } - %button.icon-remove.fullwidth{ :type => 'button', ng: { click: "setVisibility(hub_id,variant.id,false)" } } + %td.visibility{ "ng-show" => 'columns.visibility.visible' } + %button.icon-remove.fullwidth{ "type" => 'button', "ng-click" => "setVisibility(hub_id,variant.id,false)" } = t('admin.variant_overrides.index.hide') - %td.import_date{ ng: { show: 'columns.import_date.visible' } } + %td.import_date{ "ng-show" => 'columns.import_date.visible' } %span {{variantOverrides[hub_id][variant.id].import_date | date:"MMMM dd, yyyy HH:mm"}} diff --git a/app/views/admin/variant_overrides/_show_more.html.haml b/app/views/admin/variant_overrides/_show_more.html.haml index a6414a6d52..5fb2359afd 100644 --- a/app/views/admin/variant_overrides/_show_more.html.haml +++ b/app/views/admin/variant_overrides/_show_more.html.haml @@ -1,4 +1,4 @@ -.text-center{ ng: { show: "filteredProducts.length > productLimit" } } - %input{ type: 'button', value: t(:show_more), ng: { click: 'productLimit = productLimit + 10' } } +.text-center{ "ng-show" => "filteredProducts.length > productLimit" } + %input{ "type" => 'button', "value" => t(:show_more), "ng-click" => 'productLimit = productLimit + 10' } - %input{ type: 'button', value: "#{t(:show_all)} ({{ filteredProducts.length - productLimit }} More)", ng: { click: 'productLimit = filteredProducts.length' } } + %input{ "type" => 'button', "value" => "#{t(:show_all)} ({{ filteredProducts.length - productLimit }} More)", "ng-click" => 'productLimit = filteredProducts.length' } diff --git a/app/views/admin/variant_overrides/index.html.haml b/app/views/admin/variant_overrides/index.html.haml index 16beaad7b9..f64615ab3c 100644 --- a/app/views/admin/variant_overrides/index.html.haml +++ b/app/views/admin/variant_overrides/index.html.haml @@ -1,13 +1,13 @@ = render 'admin/variant_overrides/header' = render 'admin/variant_overrides/data' -.margin-bottom-50{ ng: { app: 'admin.variantOverrides', controller: 'AdminVariantOverridesCtrl', init: 'initialise()' } } +.margin-bottom-50{ "ng-app" => 'admin.variantOverrides', "ng-controller" => 'AdminVariantOverridesCtrl', "ng-init" => 'initialise()' } = render 'admin/variant_overrides/filters' = render 'admin/variant_overrides/new_products_alert' = render 'admin/variant_overrides/loading_flash' = render 'admin/variant_overrides/controls' = render 'admin/variant_overrides/no_results' - %div{ ng: { cloak: true, show: 'hub_id && filteredProducts.length > 0' } } + %div{ "ng-cloak" => true, "ng-show" => 'hub_id && filteredProducts.length > 0' } = render 'admin/variant_overrides/new_products' = render 'admin/variant_overrides/hidden_products' = render 'admin/variant_overrides/products' diff --git a/app/views/enterprises/shop.html.haml b/app/views/enterprises/shop.html.haml index 628f4b8630..13239b7208 100644 --- a/app/views/enterprises/shop.html.haml +++ b/app/views/enterprises/shop.html.haml @@ -17,9 +17,9 @@ - if @shopfront_layout == 'embedded' = render partial: 'shop/blocked_cookies' - .alert-box.changeable-orders-alert.info.animate-show{ ng: { show: "alert.visible && alert.html", cloak: true } } - %span{ ng: { bind: { html: "alert.html" } } } - %a.close{ ng: { click: "alert.close()" } } × + .alert-box.changeable-orders-alert.info.animate-show{ "ng-show" => "alert.visible && alert.html", "ng-cloak" => true } + %span{ "ng-bind-html" => "alert.html" } + %a.close{ "ng-click" => "alert.close()" } × - content_for :order_cycle_form do = render partial: "change_order_cycle" diff --git a/app/views/layouts/_login_modal.html.haml b/app/views/layouts/_login_modal.html.haml index b5fda75568..68d89a6b7e 100644 --- a/app/views/layouts/_login_modal.html.haml +++ b/app/views/layouts/_login_modal.html.haml @@ -5,19 +5,19 @@ %div{ "data-controller": "tabs" } %dl.tabs %dd - %a{ data: { "tabs-target": "tab", "action": "tabs#select" } }= t(:label_login) + %a{ "data-tabs-target" => "tab", "data-action" => "tabs#select" }= t(:label_login) %dd - %a{ data: { "tabs-target": "tab", "action": "tabs#select" } }= t(:label_signup) + %a{ "data-tabs-target" => "tab", "data-action" => "tabs#select" }= t(:label_signup) %dd - %a{ data: { "tabs-target": "tab", "action": "tabs#select" } }= t(:forgot_password) + %a{ "data-tabs-target" => "tab", "data-action" => "tabs#select" }= t(:forgot_password) .tabs-content .content.active - %div{ data: { "tabs-target": "content" } } + %div{ "data-tabs-target" => "content" } = render "layouts/login_tab" - %div{ data: { "tabs-target": "content" } } + %div{ "data-tabs-target" => "content" } = render "layouts/signup_tab" - %div{ data: { "tabs-target": "content" } } + %div{ "data-tabs-target" => "content" } = render "layouts/forgot_tab" %a.close-reveal-modal{ "data-action": "click->login-modal#close" } diff --git a/app/views/producers/_skinny.html.haml b/app/views/producers/_skinny.html.haml index 6e05619d07..d4a3a53357 100644 --- a/app/views/producers/_skinny.html.haml +++ b/app/views/producers/_skinny.html.haml @@ -4,14 +4,14 @@ .row.vertical-align-middle .columns.small-12 %a.is_distributor{"ng-href" => "{{::producer.path}}", "ng-attr-target" => "{{ embedded_layout ? '_blank' : undefined}}", "data-is-link" => "true"} - %i{ng: {class: "::producer.producer_icon_font"}} + %i{ "ng-class" => "::producer.producer_icon_font" } %span.margin-top %strong{"ng-bind" => "::producer.name"} %span.producer-name{"ng-if" => "::!producer.is_distributor" } .row.vertical-align-middle .columns.small-12 - %i{ng: {class: "::producer.producer_icon_font"}} + %i{ "ng-class" => "::producer.producer_icon_font" } %span.margin-top %strong{"ng-bind" => "::producer.name"} diff --git a/app/views/registration/_modal.html.haml b/app/views/registration/_modal.html.haml index 5fa1da9296..a91a3ac8c7 100644 --- a/app/views/registration/_modal.html.haml +++ b/app/views/registration/_modal.html.haml @@ -1,10 +1,10 @@ %script{ type: "text/ng-template", id: "registration.html" } %div#registration-modal{"ng-controller" => "RegistrationCtrl"} - %div{ ng: { show: "currentStep() == 'introduction'" } } + %div{ "ng-show" => "currentStep() == 'introduction'" } %ng-include{ src: "'registration/introduction.html'" } - %div{ ng: { repeat: 'step in steps', show: "currentStep() == step" } } + %div{ "ng-repeat" => 'step in steps', "ng-show" => "currentStep() == step" } %ng-include{ src: "'registration/'+ step + '.html'" } - %div{ ng: { show: "currentStep() == 'finished'" } } + %div{ "ng-show" => "currentStep() == 'finished'" } %ng-include{ src: "'registration/finished.html'" } %a.close-reveal-modal{"ng-click" => "$close()"} diff --git a/app/views/registration/authenticate.html.haml b/app/views/registration/authenticate.html.haml index 4b62d71c7c..6b6b5aa618 100644 --- a/app/views/registration/authenticate.html.haml +++ b/app/views/registration/authenticate.html.haml @@ -9,19 +9,19 @@ %div{ "data-controller": "tabs" } %dl.tabs %dd - %a{ data: { "tabs-target": "tab", "action": "tabs#select" } }= t(:label_signup) + %a{ "data-tabs-target" => "tab", "data-action" => "tabs#select" }= t(:label_signup) %dd - %a{ data: { "tabs-target": "tab", "action": "tabs#select" } }= t(:label_login) + %a{ "data-tabs-target" => "tab", "data-action" => "tabs#select" }= t(:label_login) %dd - %a{ data: { "tabs-target": "tab", "action": "tabs#select" } }= t(:forgot_password) + %a{ "data-tabs-target" => "tab", "data-action" => "tabs#select" }= t(:forgot_password) .tabs-content .content.active - %div{ data: { "tabs-target": "content" } } + %div{ "data-tabs-target" => "content" } = render "layouts/signup_tab" - %div{ data: { "tabs-target": "content" } } + %div{ "data-tabs-target" => "content" } = render "layouts/login_tab" - %div{ data: { "tabs-target": "content" } } + %div{ "data-tabs-target" => "content" } = render "layouts/forgot_tab" %a.close-reveal-modal{ "data-action": "click->login-modal#returnHome" } diff --git a/app/views/registration/steps/_about.html.haml b/app/views/registration/steps/_about.html.haml index 65a688e54b..413e78f10b 100644 --- a/app/views/registration/steps/_about.html.haml +++ b/app/views/registration/steps/_about.html.haml @@ -7,49 +7,49 @@ %h2= t(".headline") %h5 = t(".message") - %span{ ng: { class: "{brick: !enterprise.is_primary_producer, turquoise: enterprise.is_primary_producer}" } } + %span{ "ng-class" => "{brick: !enterprise.is_primary_producer, turquoise: enterprise.is_primary_producer}" } {{ enterprise.name }} - %form{ name: 'about', novalidate: true, ng: { controller: "RegistrationFormCtrl", submit: "selectIfValid('images', about)" } } + %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{ "ofn-inline-alert" => true, "ng-show" => "visible" } %h6{ "ng-bind" => "'registration.steps.about.success' | t:{enterprise: enterprise.name}" } %span= t(".registration_exit_message") - %a.close{ ng: { click: "close()" } } × + %a.close{ "ng-click" => "close()" } × .small-12.large-8.columns .row .small-12.columns .field %label{ for: 'enterprise_description' }= t(".enterprise_description") - %input.chunky{ id: 'enterprise_description', placeholder: "{{'registration.steps.about.enterprise_description_placeholder' | t}}", ng: { model: 'enterprise.description' } } + %input.chunky{ "id" => 'enterprise_description', "placeholder" => "{{'registration.steps.about.enterprise_description_placeholder' | t}}", "ng-model" => 'enterprise.description' } .row .small-12.columns .field %label{ for: 'enterprise_long_desc' }= t(".enterprise_long_desc") - %textarea.chunky{ id: 'enterprise_long_desc', rows: 6, placeholder: "{{'registration.steps.about.enterprise_long_desc_placeholder' | t}}", ng: { model: 'enterprise.long_description' } } + %textarea.chunky{ "id" => 'enterprise_long_desc', "rows" => 6, "placeholder" => "{{'registration.steps.about.enterprise_long_desc_placeholder' | t}}", "ng-model" => 'enterprise.long_description' } %small{ "ng-bind" => "'registration.steps.about.enterprise_long_desc_length' | t:{num: enterprise.long_description.length}" } .small-12.large-4.columns .row .small-12.columns .field %label{ for: 'enterprise_abn' }= t(".enterprise_abn")+":" - %input.chunky{ id: 'enterprise_abn', placeholder: "{{'registration.steps.about.enterprise_abn_placeholder' | t}}", ng: { model: 'enterprise.abn' } } + %input.chunky{ "id" => 'enterprise_abn', "placeholder" => "{{'registration.steps.about.enterprise_abn_placeholder' | t}}", "ng-model" => 'enterprise.abn' } .row .small-12.columns .field %label{ for: 'enterprise_acn' }= t(".enterprise_acn")+":" - %input.chunky{ id: 'enterprise_acn', placeholder: "{{'registration.steps.about.enterprise_acn_placeholder' | t}}", ng: { model: 'enterprise.acn' } } + %input.chunky{ "id" => 'enterprise_acn', "placeholder" => "{{'registration.steps.about.enterprise_acn_placeholder' | t}}", "ng-model" => 'enterprise.acn' } .row .small-12.columns .field %label{ for: 'enterprise_charges_sales_tax' }= t(:charges_sales_tax) - %input{ id: 'enterprise_charges_sales_tax_true', type: 'radio', name: 'charges_sales_tax', value: 'true', required: true, ng: { model: 'enterprise.charges_sales_tax' } } + %input{ "id" => 'enterprise_charges_sales_tax_true', "type" => 'radio', "name" => 'charges_sales_tax', "value" => 'true', "required" => true, "ng-model" => 'enterprise.charges_sales_tax' } %label{ for: 'enterprise_charges_sales_tax_true' } {{'say_yes' | t}} - %input{ id: 'enterprise_charges_sales_tax_false', type: 'radio', name: 'charges_sales_tax', value: 'false', required: true, ng: { model: 'enterprise.charges_sales_tax' } } + %input{ "id" => 'enterprise_charges_sales_tax_false', "type" => 'radio', "name" => 'charges_sales_tax', "value" => 'false', "required" => true, "ng-model" => 'enterprise.charges_sales_tax' } %label{ for: 'enterprise_charges_sales_tax_false' } {{'say_no' | t}} - %span.error.small-12.columns{ ng: { show: "about.charges_sales_tax.$error.required && submitted" } } + %span.error.small-12.columns{ "ng-show" => "about.charges_sales_tax.$error.required && submitted" } = t(".enterprise_tax_required") .row.buttons.pad-top diff --git a/app/views/registration/steps/_contact.html.haml b/app/views/registration/steps/_contact.html.haml index 370101ada3..944d4cb696 100644 --- a/app/views/registration/steps/_contact.html.haml +++ b/app/views/registration/steps/_contact.html.haml @@ -7,30 +7,30 @@ %h2= t('registration.steps.introduction.registration_greeting') %h5{ "ng-bind" => "'registration.steps.contact.who_is_managing_enterprise' | t:{enterprise: enterprise.name}" } - %form{ name: 'contact', novalidate: true, ng: { controller: "RegistrationFormCtrl", submit: "selectIfValid('type',contact)" } } + %form{ "name" => 'contact', "novalidate" => true, "ng-controller" => "RegistrationFormCtrl", "ng-submit" => "selectIfValid('type',contact)" } .row.content .small-12.medium-12.large-7.columns .row .small-12.columns.field %label{ for: 'enterprise_contact' }= t(".contact_field") - %input.chunky.small-12.columns{ id: 'enterprise_contact', name: 'contact_name', required: true, placeholder: "{{'registration.steps.contact.contact_field_placeholder' | t}}", ng: { model: 'enterprise.contact_name' } } - %span.error.small-12.columns{ ng: { show: "contact.contact_name.$error.required && submitted" } } + %input.chunky.small-12.columns{ "id" => 'enterprise_contact', "name" => 'contact_name', "required" => true, "placeholder" => "{{'registration.steps.contact.contact_field_placeholder' | t}}", "ng-model" => 'enterprise.contact_name' } + %span.error.small-12.columns{ "ng-show" => "contact.contact_name.$error.required && submitted" } = t(".contact_field_required") .row .small-12.columns.field %label{ for: 'enterprise_email_address' }= t("admin.enterprises.form.contact.email_address")+":" - %input.chunky.small-12.columns{ id: 'enterprise_email_address', name: 'email_address', type: 'email', placeholder: t('admin.enterprises.form.contact.email_address_placeholder'), ng: { model: 'enterprise.email_address' } } + %input.chunky.small-12.columns{ "id" => 'enterprise_email_address', "name" => 'email_address', "type" => 'email', "placeholder" => t('admin.enterprises.form.contact.email_address_placeholder'), "ng-model" => 'enterprise.email_address' } .row .small-12.columns.field %label{ for: 'enterprise_phone' }= t(".phone_field")+":" - %input.chunky.small-12.columns{ id: 'enterprise_phone', name: 'phone', placeholder: "{{'registration.steps.contact.phone_field_placeholder' | t}}", ng: { model: 'enterprise.phone' } } + %input.chunky.small-12.columns{ "id" => 'enterprise_phone', "name" => 'phone', "placeholder" => "{{'registration.steps.contact.phone_field_placeholder' | t}}", "ng-model" => 'enterprise.phone' } .row .small-12.columns.field %label{ "for" => 'enterprise_whatsapp_phone', 'data-toggle' => "tooltip", 'title' => "{{'registration.steps.contact.whatsapp_phone_tooltip' | t}}" }= t(".whatsapp_phone_field")+":" - %input.chunky.small-12.columns{ id: 'enterprise_whatsapp_phone', name: 'whatsapp_phone', placeholder: "{{'registration.steps.contact.whatsapp_phone_field_placeholder' | t}}", ng: { model: 'enterprise.whatsapp_phone' } } + %input.chunky.small-12.columns{ "id" => 'enterprise_whatsapp_phone', "name" => 'whatsapp_phone', "placeholder" => "{{'registration.steps.contact.whatsapp_phone_field_placeholder' | t}}", "ng-model" => 'enterprise.whatsapp_phone' } .small-12.medium-12.large-5.hide-for-small-only .row.buttons .small-12.columns - %input.button.secondary{ type: "button", value: "{{'back' | t}}", ng: { click: "select('details')" } } + %input.button.secondary{ "type" => "button", "value" => "{{'back' | t}}", "ng-click" => "select('details')" } %input.button.primary.right{ type: "submit", value: "{{'continue' | t}}" } diff --git a/app/views/registration/steps/_details.html.haml b/app/views/registration/steps/_details.html.haml index 906b3a5745..51d6356f5a 100644 --- a/app/views/registration/steps/_details.html.haml +++ b/app/views/registration/steps/_details.html.haml @@ -5,56 +5,56 @@ .small-12.columns %header %h2= t('.headline') - %h5{ ng: { if: "::enterprise.type != 'own'" } }= t(".enterprise") - %h5{ ng: { if: "::enterprise.type == 'own'" } }= t(".producer") - %form{ name: 'details', novalidate: true, ng: { controller: "RegistrationFormCtrl", submit: "selectIfValid('contact',details)" } } + %h5{ "ng-if" => "::enterprise.type != 'own'" }= t(".enterprise") + %h5{ "ng-if" => "::enterprise.type == 'own'" }= t(".producer") + %form{ "name" => 'details', "novalidate" => true, "ng-controller" => "RegistrationFormCtrl", "ng-submit" => "selectIfValid('contact',details)" } .row .small-12.medium-9.large-12.columns.end .field - %label{ for: 'enterprise_name', ng: { if: "::enterprise.type != 'own'" } }= t(".enterprise_name_field") - %label{ for: 'enterprise_name', ng: { if: "::enterprise.type == 'own'" } }= t(".producer_name_field") - %input.chunky{ id: 'enterprise_name', name: 'name', placeholder: "{{'registration.steps.details.producer_name_field_placeholder' | t}}", required: true, ng: { model: 'enterprise.name' } } - %span.error{ ng: { show: "details.name.$error.required && submitted" } } + %label{ "for" => 'enterprise_name', "ng-if" => "::enterprise.type != 'own'" }= t(".enterprise_name_field") + %label{ "for" => 'enterprise_name', "ng-if" => "::enterprise.type == 'own'" }= t(".producer_name_field") + %input.chunky{ "id" => 'enterprise_name', "name" => 'name', "placeholder" => "{{'registration.steps.details.producer_name_field_placeholder' | t}}", "required" => true, "ng-model" => 'enterprise.name' } + %span.error{ "ng-show" => "details.name.$error.required && submitted" } = t(".producer_name_field_error") .row .small-12.medium-9.large-6.columns .field %label{ for: 'enterprise_address' }= t(".address1_field") - %input.chunky{ id: 'enterprise_address', name: 'address1', required: true, placeholder: "{{'registration.steps.details.address1_field_placeholder' | t}}", required: true, ng: { model: 'enterprise.address.address1' } } - %span.error{ ng: { show: "details.address1.$error.required && submitted" } } + %input.chunky{ "id" => 'enterprise_address', "name" => 'address1', "required" => true, "placeholder" => "{{'registration.steps.details.address1_field_placeholder' | t}}", "ng-model" => 'enterprise.address.address1' } + %span.error{ "ng-show" => "details.address1.$error.required && submitted" } = t(".address1_field_error") .field %label{ for: 'enterprise_address2' }= t(".address2_field") - %input.chunky{ id: 'enterprise_address2', name: 'address2', required: false, placeholder: "", required: false, ng: { model: 'enterprise.address.address2' } } + %input.chunky{ "id" => 'enterprise_address2', "name" => 'address2', "required" => false, "placeholder" => "", "ng-model" => 'enterprise.address.address2' } .small-12.medium-9.large-6.columns.end .row .small-12.medium-8.large-8.columns .field %label{ for: 'enterprise_city' }= t('.suburb_field') - %input.chunky{ id: 'enterprise_city', name: 'city', required: true, placeholder: "{{'registration.steps.details.suburb_field_placeholder' | t}}", ng: { model: 'enterprise.address.city' } } - %span.error{ ng: { show: "details.city.$error.required && submitted" } } + %input.chunky{ "id" => 'enterprise_city', "name" => 'city', "required" => true, "placeholder" => "{{'registration.steps.details.suburb_field_placeholder' | t}}", "ng-model" => 'enterprise.address.city' } + %span.error{ "ng-show" => "details.city.$error.required && submitted" } = t(".suburb_field_error") .small-12.medium-4.large-4.columns .field %label{ for: 'enterprise_zipcode' }= t(".postcode_field") - %input.chunky{ id: 'enterprise_zipcode', name: 'zipcode', required: true, placeholder: "{{'registration.steps.details.postcode_field_placeholder' | t}}", ng: { model: 'enterprise.address.zipcode' } } - %span.error{ ng: { show: "details.zipcode.$error.required && submitted" } } + %input.chunky{ "id" => 'enterprise_zipcode', "name" => 'zipcode', "required" => true, "placeholder" => "{{'registration.steps.details.postcode_field_placeholder' | t}}", "ng-model" => 'enterprise.address.zipcode' } + %span.error{ "ng-show" => "details.zipcode.$error.required && submitted" } = t(".postcode_field_error") .row .small-12.medium-8.large-8.columns .field %label{ for: 'enterprise_country' }= t(".country_field") - %select.chunky{ id: 'enterprise_country', name: 'country', required: true, ng: { init: "setDefaultCountry(#{DefaultCountry.id})", model: 'enterprise.country', options: 'c as c.name for c in countries' } } - %span.error{ ng: { show: "details.country.$error.required && submitted" } } + %select.chunky{ "id" => 'enterprise_country', "name" => 'country', "required" => true, "ng-init" => "setDefaultCountry(#{DefaultCountry.id})", "ng-model" => 'enterprise.country', "ng-options" => 'c as c.name for c in countries' } + %span.error{ "ng-show" => "details.country.$error.required && submitted" } = t(".country_field_error") .small-12.medium-4.large-4.columns .field %label{ for: 'enterprise_state' }= t(".state_field") - %select.chunky{ id: 'enterprise_state', name: 'state', ng: { model: 'enterprise.address.state_id', options: 's.id as s.abbr for s in enterprise.country.states', show: 'countryHasStates()', required: 'countryHasStates()' } } - %span.error{ ng: { show: "details.state.$error.required && submitted" } } + %select.chunky{ "id" => 'enterprise_state', "name" => 'state', "ng-model" => 'enterprise.address.state_id', "ng-options" => 's.id as s.abbr for s in enterprise.country.states', "ng-show" => 'countryHasStates()', "ng-required" => 'countryHasStates()' } + %span.error{ "ng-show" => "details.state.$error.required && submitted" } = t(".state_field_error") = render 'registration/steps/location_map' if using_google_maps? diff --git a/app/views/registration/steps/_images.html.haml b/app/views/registration/steps/_images.html.haml index b52c179f3c..a26756d440 100644 --- a/app/views/registration/steps/_images.html.haml +++ b/app/views/registration/steps/_images.html.haml @@ -1,5 +1,5 @@ %script{ type: "text/ng-template", id: "registration/images.html" } - .container#registration-images{ 'nv-file-drop' => true, uploader: "imageUploader", options:"{ alias: imageStep }", ng: { controller: "EnterpriseImageCtrl" } } + .container#registration-images{ "nv-file-drop" => true, "uploader" => "imageUploader", "options" => "{ alias: imageStep }", "ng-controller" => "EnterpriseImageCtrl" } %ng-include{ src: "'registration/steps.html'" } .row .small-12.columns @@ -7,17 +7,17 @@ %h2= t(".headline") %h5= t(".description") - %form{ name: 'images', novalidate: true, ng: { controller: "RegistrationFormCtrl", submit: "select('social')" } } - .row{ ng: { repeat: 'image_step in imageSteps', show: "imageStep == image_step" } } + %form{ "name" => 'images', "novalidate" => true, "ng-controller" => "RegistrationFormCtrl", "ng-submit" => "select('social')" } + .row{ "ng-repeat" => 'image_step in imageSteps', "ng-show" => "imageStep == image_step" } %ng-include{ src: "'registration/'+ image_step + '.html'" } - .row.buttons.pad-top{ ng: { if: "imageStep == 'logo'" } } + .row.buttons.pad-top{ "ng-if" => "imageStep == 'logo'" } .small-12.columns - %input.button.secondary{ type: "button", value: t(".back"), ng: { click: "select('about')" } } + %input.button.secondary{ "type" => "button", "value" => t(".back"), "ng-click" => "select('about')" }   - %input.button.primary.right{ type: "button", value: t(".continue"), ng: { click: "imageSelect('promo')" } } + %input.button.primary.right{ "type" => "button", "value" => t(".continue"), "ng-click" => "imageSelect('promo')" } - .row.buttons.pad-top{ ng: { if: "imageStep == 'promo'" } } + .row.buttons.pad-top{ "ng-if" => "imageStep == 'promo'" } .small-12.columns - %input.button.secondary{ type: "button", value: t(".back"), ng: { click: "imageSelect('logo')" } } + %input.button.secondary{ "type" => "button", "value" => t(".back"), "ng-click" => "imageSelect('logo')" } %input.button.primary.right{ type: "submit", value: t(".continue") } diff --git a/app/views/registration/steps/_introduction.html.haml b/app/views/registration/steps/_introduction.html.haml index 90cbabff83..dc41abe2e9 100644 --- a/app/views/registration/steps/_introduction.html.haml +++ b/app/views/registration/steps/_introduction.html.haml @@ -44,8 +44,8 @@ #{t(:enterprise_tos_message)} = link_to_platform_terms %p.tos-checkbox - %input{ type: 'checkbox', name: 'accept_terms', id: 'accept_terms', ng: { model: "tos_accepted" } } + %input{ "type" => 'checkbox', "name" => 'accept_terms', "id" => 'accept_terms', "ng-model" => "tos_accepted" } %label{for: "accept_terms"} #{t(:enterprise_tos_agree)} .small-12.medium-6.columns - %input.button.primary.left{ type: "button", value: "{{'registration.steps.introduction.registration_action' | t}}", ng: { click: "select('details')", disabled: "tos_required && !tos_accepted", model: "tos_accepted"} } + %input.button.primary.left{ "type" => "button", "value" => "{{'registration.steps.introduction.registration_action' | t}}", "ng-click" => "select('details')", "ng-disabled" => "tos_required && !tos_accepted", "ng-model" => "tos_accepted" } diff --git a/app/views/registration/steps/_limit_reached.html.haml b/app/views/registration/steps/_limit_reached.html.haml index 7a486e5743..ee5140b769 100644 --- a/app/views/registration/steps/_limit_reached.html.haml +++ b/app/views/registration/steps/_limit_reached.html.haml @@ -14,4 +14,4 @@ .row .small-12.columns %hr - %input.button.primary{ type: "button", value: "{{'registration.steps.limit_reached.action' | t}}", ng: { click: "close()" } } + %input.button.primary{ "type" => "button", "value" => "{{'registration.steps.limit_reached.action' | t}}", "ng-click" => "close()" } diff --git a/app/views/registration/steps/_location_map.html.haml b/app/views/registration/steps/_location_map.html.haml index 1d6baeb9ac..031edbec98 100644 --- a/app/views/registration/steps/_location_map.html.haml +++ b/app/views/registration/steps/_location_map.html.haml @@ -1,19 +1,19 @@ %div .center - %input.button.primary{ type: "button", value: "{{'registration.steps.details.locate_address' | t}}", ng: { click: "locateAddress()" } } - .center{ ng: {if: "latLong"}} + %input.button.primary{ "type" => "button", "value" => "{{'registration.steps.details.locate_address' | t}}", "ng-click" => "locateAddress()" } + .center{ "ng-if" => "latLong" } %strong {{'registration.steps.details.drag_pin' | t}} .small-12.medium-9.large-12.columns.end - .map-container--registration{id: "registration-map", ng: {if: "!!map"}} + .map-container--registration{ "id" => "registration-map", "ng-if" => "!!map" } %ui-gmap-google-map{ center: "map.center", zoom: "map.zoom"} %ui-gmap-marker{idKey: 1, coords: "latLong", options: '{ draggable: true}'} - .center{ ng: {if: "latLong"}} + .center{ "ng-if" => "latLong" } .field - %input{ type: 'checkbox', id: 'confirm_address', name: 'confirm_address', ng: { click: 'toggleAddressConfirmed()' } } + %input{ "type" => 'checkbox', "id" => 'confirm_address', "name" => 'confirm_address', "ng-click" => 'toggleAddressConfirmed()' } %label{ for: 'confirm_address' } {{'registration.steps.details.confirm_address' | t}} - .small-12.medium-9.large-12.columns.end{ ng: {if: "latLong"}} + .small-12.medium-9.large-12.columns.end{ "ng-if" => "latLong" } .field %strong {{'registration.steps.details.drag_map_marker' | t}} diff --git a/app/views/registration/steps/_logo.html.haml b/app/views/registration/steps/_logo.html.haml index 06de18ff4d..34695a0e70 100644 --- a/app/views/registration/steps/_logo.html.haml +++ b/app/views/registration/steps/_logo.html.haml @@ -37,10 +37,10 @@ .row.pad-top .small-12.columns.center #image-placeholder.logo - %img{ ng: { show: "imageSrc() && !imageUploader.isUploading", src: '{{ imageSrc() }}' } } - .message{ ng: { hide: "imageSrc() || imageUploader.isUploading" } } + %img{ "ng-show" => "imageSrc() && !imageUploader.isUploading", "ng-src" => '{{ imageSrc() }}' } + .message{ "ng-hide" => "imageSrc() || imageUploader.isUploading" } = t(".logo_placeholder") - .loading{ ng: { hide: "!imageUploader.isUploading" } } + .loading{ "ng-hide" => "!imageUploader.isUploading" } = render partial: "components/spinner" %br/ = t("registration.steps.images.uploading") diff --git a/app/views/registration/steps/_promo.html.haml b/app/views/registration/steps/_promo.html.haml index 3a9d94db75..b9c06b54b3 100644 --- a/app/views/registration/steps/_promo.html.haml +++ b/app/views/registration/steps/_promo.html.haml @@ -35,10 +35,10 @@ .row.pad-top .small-12.columns.center #image-placeholder.promo - %img{ ng: { show: "imageSrc() && !imageUploader.isUploading", src: '{{ imageSrc() }}' } } - .message{ ng: { hide: "imageSrc() || imageUploader.isUploading" } } + %img{ "ng-show" => "imageSrc() && !imageUploader.isUploading", "ng-src" => '{{ imageSrc() }}' } + .message{ "ng-hide" => "imageSrc() || imageUploader.isUploading" } = t(".promo_image_placeholder") - .loading{ ng: { hide: "!imageUploader.isUploading" } } + .loading{ "ng-hide" => "!imageUploader.isUploading" } = render partial: "components/spinner" %br/ = t("registration.steps.images.uploading") diff --git a/app/views/registration/steps/_social.html.haml b/app/views/registration/steps/_social.html.haml index 9cd86ead1c..cf143cbec2 100644 --- a/app/views/registration/steps/_social.html.haml +++ b/app/views/registration/steps/_social.html.haml @@ -8,38 +8,38 @@ %h2= t(".enterprise_final_step") %h5{ "ng-bind" => "'registration.steps.social.enterprise_social_text' | t:{enterprise: enterprise.name}" } - %form{ name: 'social', novalidate: true, ng: { controller: "RegistrationFormCtrl", submit: "update('finished',social)" } } + %form{ "name" => 'social', "novalidate" => true, "ng-controller" => "RegistrationFormCtrl", "ng-submit" => "update('finished',social)" } .row.content .small-12.large-7.columns .row .small-12.columns .field %label{ for: 'enterprise_website' }= t(".website")+":" - %input.chunky{ id: 'enterprise_website', placeholder: "{{'registration.steps.social.website_placeholder' | t}}", ng: { model: 'enterprise.website' } } + %input.chunky{ "id" => 'enterprise_website', "placeholder" => "{{'registration.steps.social.website_placeholder' | t}}", "ng-model" => 'enterprise.website' } .row .small-12.columns .field %label{ for: 'enterprise_facebook' }= t(".facebook")+":" - %input.chunky{ id: 'enterprise_facebook', placeholder: "{{'registration.steps.social.facebook_placeholder' | t}}", ng: { model: 'enterprise.facebook' } } + %input.chunky{ "id" => 'enterprise_facebook', "placeholder" => "{{'registration.steps.social.facebook_placeholder' | t}}", "ng-model" => 'enterprise.facebook' } .row .small-12.columns .field %label{ for: 'enterprise_linkedin' }= t(".linkedin")+":" - %input.chunky{ id: 'enterprise_linkedin', placeholder: "{{'registration.steps.social.linkedin_placeholder' | t}}", ng: { model: 'enterprise.linkedin' } } + %input.chunky{ "id" => 'enterprise_linkedin', "placeholder" => "{{'registration.steps.social.linkedin_placeholder' | t}}", "ng-model" => 'enterprise.linkedin' } .small-12.large-5.columns .row .small-12.columns .field %label{ for: 'enterprise_twitter' }= t(".twitter")+":" - %input.chunky{ id: 'enterprise_twitter', placeholder: "{{'registration.steps.social.twitter_placeholder' | t}}", ng: { model: 'enterprise.twitter' } } + %input.chunky{ "id" => 'enterprise_twitter', "placeholder" => "{{'registration.steps.social.twitter_placeholder' | t}}", "ng-model" => 'enterprise.twitter' } .row .small-12.columns .field %label{ for: 'enterprise_instagram' }= t(".instagram")+":" - %input.chunky{ id: 'enterprise_instagram', placeholder: "{{'registration.steps.social.instagram_placeholder' | t}}", ng: { model: 'enterprise.instagram' } } + %input.chunky{ "id" => 'enterprise_instagram', "placeholder" => "{{'registration.steps.social.instagram_placeholder' | t}}", "ng-model" => 'enterprise.instagram' } %span.error.small-12.columns#instagram-error{ style: "display: none" } .row.buttons .small-12.columns - %input.button.secondary{ type: "button", value: "{{'back' | t}}", ng: { click: "select('images')" } } + %input.button.secondary{ "type" => "button", "value" => "{{'back' | t}}", "ng-click" => "select('images')" } %input.button.primary.right{ type: "submit", value: "{{'continue' | t}}" } diff --git a/app/views/registration/steps/_steps.html.haml b/app/views/registration/steps/_steps.html.haml index 081cd97d98..611154fe76 100644 --- a/app/views/registration/steps/_steps.html.haml +++ b/app/views/registration/steps/_steps.html.haml @@ -1,5 +1,5 @@ %script{ type: "text/ng-template", id: "registration/steps.html" } .row#progress-bar - .small-12.medium-2.columns.item{ ng: { repeat: 'step in steps', class: "{active: (currentStep() == step),'show-for-medium-up': (currentStep() != step)}" } } + .small-12.medium-2.columns.item{ "ng-repeat" => 'step in steps', "ng-class" => "{active: (currentStep() == step),'show-for-medium-up': (currentStep() != step)}" } {{ $index+1 + ". " + ('registration.steps.' + step + '.title' | t) }} diff --git a/app/views/registration/steps/_type.html.haml b/app/views/registration/steps/_type.html.haml index 01482fd160..7a4ec8d8d5 100644 --- a/app/views/registration/steps/_type.html.haml +++ b/app/views/registration/steps/_type.html.haml @@ -10,24 +10,24 @@ %h4 = t(".question") - %form{ name: 'type', novalidate: true, ng: { controller: "RegistrationFormCtrl", submit: "create(type)" } } - .row#enterprise-types{ 'data-equalizer' => true, ng: { if: "::enterprise.type != 'own'" } } + %form{ "name" => 'type', "novalidate" => true, "ng-controller" => "RegistrationFormCtrl", "ng-submit" => "create(type)" } + .row#enterprise-types{ "data-equalizer" => true, "ng-if" => "::enterprise.type != 'own'" } .small-12.columns.field .row .small-12.medium-6.large-6.columns{ 'data-equalizer-watch' => true } - %a.btnpanel#producer-panel{ href: "#", ng: { click: "enterprise.is_primary_producer = true", class: "{selected: enterprise.is_primary_producer}" } } + %a.btnpanel#producer-panel{ "href" => "#", "ng-click" => "enterprise.is_primary_producer = true", "ng-class" => "{selected: enterprise.is_primary_producer}" } %i.ofn-i_059-producer %h4= t(".yes_producer") .small-12.medium-6.large-6.columns{ 'data-equalizer-watch' => true } - %a.btnpanel#hub-panel{ href: "#", ng: { click: "enterprise.is_primary_producer = false", class: "{selected: enterprise.is_primary_producer == false}" } } + %a.btnpanel#hub-panel{ "href" => "#", "ng-click" => "enterprise.is_primary_producer = false", "ng-class" => "{selected: enterprise.is_primary_producer == false}" } %i.ofn-i_063-hub %h4= t(".no_producer") .row .small-12.columns - %input.chunky{ id: 'enterprise_is_primary_producer', name: 'is_primary_producer', type: "hidden", required: true, ng: { model: 'enterprise.is_primary_producer' } } - %span.error{ ng: { show: "type.is_primary_producer.$error.required && submitted" } } + %input.chunky{ "id" => 'enterprise_is_primary_producer', "name" => 'is_primary_producer', "type" => "hidden", "required" => true, "ng-model" => 'enterprise.is_primary_producer' } + %span.error{ "ng-show" => "type.is_primary_producer.$error.required && submitted" } = t(".producer_field_error") .row .small-12.columns @@ -44,5 +44,5 @@ .row.buttons .small-12.columns - %input.button.secondary{ type: "button", value: "{{'back' | t}}", ng: { click: "select('contact')" } } - %input.button.primary.right{ ng: { disabled: 'isDisabled' }, type: "submit", value: t(".create_profile") } + %input.button.secondary{ "type" => "button", "value" => "{{'back' | t}}", "ng-click" => "select('contact')" } + %input.button.primary.right{ "type" => "submit", "value" => t(".create_profile"), "ng-disabled" => 'isDisabled' } diff --git a/app/views/shared/menu/_alert.html.haml b/app/views/shared/menu/_alert.html.haml index e3eb53fe74..077505ad84 100644 --- a/app/views/shared/menu/_alert.html.haml +++ b/app/views/shared/menu/_alert.html.haml @@ -1,4 +1,4 @@ .text-center.page-alert.fixed{ "ofn-page-alert" => true } .alert-box = render 'shared/page_alert' - %a.close{ ng: { click: "close()" } } × + %a.close{ "ng-click" => "close()" } × diff --git a/app/views/shared/menu/_cart_sidebar.html.haml b/app/views/shared/menu/_cart_sidebar.html.haml index 423d4585cd..ca68af1e30 100644 --- a/app/views/shared/menu/_cart_sidebar.html.haml +++ b/app/views/shared/menu/_cart_sidebar.html.haml @@ -1,5 +1,5 @@ -.expanding-sidebar.cart-sidebar{ng: {controller: 'CartCtrl', class: "{'shown': showCartSidebar}"}} - .background{ng: {click: 'toggleCartSidebar()'}} +.expanding-sidebar.cart-sidebar{ "ng-controller" => 'CartCtrl', "ng-class" => "{'shown': showCartSidebar}" } + .background{ "ng-click" => 'toggleCartSidebar()' } .sidebar = cache_with_locale "cart-header" do .cart-header @@ -7,7 +7,7 @@ = t('.items_in_cart_singular', num: "{{ Cart.total_item_count() }}") %span.title{"ng-show" => "Cart.line_items.length > 1"} = t('.items_in_cart_plural', num: "{{ Cart.total_item_count() }}") - %a.close{ng: {click: 'toggleCartSidebar()'}} + %a.close{ "ng-click" => 'toggleCartSidebar()' } = t('.close') %i.ofn-i_009-close @@ -40,7 +40,7 @@ %p = t('.cart_empty') - %a.go-shopping.button.large.bright{ng: {show: "#{show_shopping_cta?}", href: "{{ CurrentHub.hub.id ? '#{main_app.shop_path}' : '#{main_app.shops_path}' }}"}} + %a.go-shopping.button.large.bright{ "ng-show" => "#{show_shopping_cta?}", "ng-href" => "{{ CurrentHub.hub.id ? '#{main_app.shop_path}' : '#{main_app.shops_path}' }}" } = t('.take_me_shopping') .sidebar-footer{"ng-show" => "Cart.line_items.length > 0"} @@ -52,8 +52,8 @@ %div.fullwidth %a.edit-cart.button.large.dark.left{href: main_app.cart_path, "ng-disabled" => "Cart.dirty || Cart.empty()", "ng-class" => "{ dirty: Cart.dirty }"} - %div{ ng: { if: "Cart.dirty" } }= t(:cart_updating) - %div{ ng: { if: "!Cart.dirty && Cart.empty()" } }= t(:cart_empty) - %div{ ng: { if: "!Cart.dirty && !Cart.empty()" } }= t('.edit_cart') + %div{ "ng-if" => "Cart.dirty" }= t(:cart_updating) + %div{ "ng-if" => "!Cart.dirty && Cart.empty()" }= t(:cart_empty) + %div{ "ng-if" => "!Cart.dirty && !Cart.empty()" }= t('.edit_cart') %a.checkout.button.large.bright.right{href: main_app.checkout_path, "ng-disabled" => "Cart.dirty || Cart.empty()"} = t '.checkout' diff --git a/app/views/shared/menu/_mobile_menu.html.haml b/app/views/shared/menu/_mobile_menu.html.haml index 0e25ee57b0..6b178a40cf 100644 --- a/app/views/shared/menu/_mobile_menu.html.haml +++ b/app/views/shared/menu/_mobile_menu.html.haml @@ -14,7 +14,7 @@ %section.right{"ng-cloak" => true} %span.cart-span{"ng-class" => "{ dirty: Cart.dirty || Cart.empty(), 'pure-dirty': Cart.dirty }"} - %a.icon{ng: {click: 'toggleCartSidebar()'}} + %a.icon{ "ng-click" => 'toggleCartSidebar()' } %span = t '.cart' %span.count diff --git a/app/views/shared/menu/_offcanvas_menu.html.haml b/app/views/shared/menu/_offcanvas_menu.html.haml index 8c6456c647..d29f4d59b5 100644 --- a/app/views/shared/menu/_offcanvas_menu.html.haml +++ b/app/views/shared/menu/_offcanvas_menu.html.haml @@ -1,4 +1,4 @@ -%aside.left-off-canvas-menu.show-for-medium-down{ ng: { controller: "OffcanvasCtrl" } } +%aside.left-off-canvas-menu.show-for-medium-down{ "ng-controller" => "OffcanvasCtrl" } %ul.off-canvas-list = cache_with_locale [ContentConfig.cache_key, @white_label_logo] do %li.ofn-logo diff --git a/app/views/shop/products/_filters.html.haml b/app/views/shop/products/_filters.html.haml index 869b215c60..1fa168ac58 100644 --- a/app/views/shop/products/_filters.html.haml +++ b/app/views/shop/products/_filters.html.haml @@ -1,6 +1,6 @@ = cache_with_locale do - .filter-shopfront.taxon-selectors{ng: {show: 'supplied_taxons != null'}} + .filter-shopfront.taxon-selectors{ "ng-show" => 'supplied_taxons != null' } %filter-selector{ 'selector-set' => "taxonSelectors", objects: "supplied_taxons", "active-selectors" => "activeTaxons"} - .filter-shopfront.property-selectors{ng: {show: 'supplied_properties != null'}} + .filter-shopfront.property-selectors{ "ng-show" => 'supplied_properties != null' } %filter-selector{ 'selector-set' => "propertySelectors", objects: "supplied_properties", "active-selectors" => "activeProperties"} diff --git a/app/views/shop/products/_form.html.haml b/app/views/shop/products/_form.html.haml index e5a51a50cc..f82909ed36 100644 --- a/app/views/shop/products/_form.html.haml +++ b/app/views/shop/products/_form.html.haml @@ -31,22 +31,22 @@ .sticky-shop-filters-container.thin-scroll-bar.hide-for-medium-down.large-2.columns %h5.filter-header = t(:products_filter_by) - %span{ng: {show: 'filtersCount()' }} + %span{ "ng-show" => 'filtersCount()' } = "({{ filtersCount() }} #{t(:products_filter_selected)})" = render partial: "shop/products/filters" - .expanding-sidebar.shop-filters-sidebar.hide-for-large-up{ng: {show: 'showFilterSidebar', class: "{'shown': showFilterSidebar}"}} - .background{ng: {click: 'toggleFilterSidebar()'}} + .expanding-sidebar.shop-filters-sidebar.hide-for-large-up{ "ng-show" => 'showFilterSidebar', "ng-class" => "{'shown': showFilterSidebar}" } + .background{ "ng-click" => 'toggleFilterSidebar()' } .sidebar %h5 = t(:products_filter_by) - %span{ng: {show: 'filtersCount()' }} + %span{ "ng-show" => 'filtersCount()' } = "({{ filtersCount() }} #{t(:products_filter_selected)})" = render partial: "shop/products/filters" .sidebar-footer - %button.large.dark.left{type: 'button', ng: {click: 'clearFilters()'}} + %button.large.dark.left{ "type" => 'button', "ng-click" => 'clearFilters()' } = t(:products_filter_clear) - %button.large.bright.right{type: 'button', ng: {click: 'toggleFilterSidebar()'}} + %button.large.bright.right{ "type" => 'button', "ng-click" => 'toggleFilterSidebar()' } = t(:products_filter_done) diff --git a/app/views/shop/products/_search_feedback.haml b/app/views/shop/products/_search_feedback.haml index 3245c6bb50..6b605476a6 100644 --- a/app/views/shop/products/_search_feedback.haml +++ b/app/views/shop/products/_search_feedback.haml @@ -10,7 +10,7 @@ %span.filter-label = t :products_results_for - %span{ ng: { hide: "!query"} } + %span{ "ng-hide" => "!query" } %span.applied-search {{ query }} = render partial: 'shop/products/applied_filters_feedback' @@ -21,5 +21,5 @@ %p.no-results = t :products_no_results_html, query: "{{query}}".html_safe = render partial: 'shop/products/applied_filters_feedback' - %button.clear-search{type: 'button', ng: {click: 'clearAll()'}} + %button.clear-search{ "type" => 'button', "ng-click" => 'clearAll()' } = t :products_clear_search diff --git a/app/views/shop/products/_searchbar.haml b/app/views/shop/products/_searchbar.haml index b7e6f98d57..9f133a7dc6 100644 --- a/app/views/shop/products/_searchbar.haml +++ b/app/views/shop/products/_searchbar.haml @@ -8,11 +8,11 @@ placeholder: t(:products_search), "ng-debounce" => "200", "disable-enter-with-blur" => true} - %a.clear{type: 'button', ng: {show: 'query', click: 'clearQuery()'}, 'focus-search' => true} + %a.clear{ "type" => 'button', "focus-search" => true, "ng-show" => 'query', "ng-click" => 'clearQuery()' } = image_pack_tag "icn-close.png" .hide-for-large-up - %button{type: 'button', ng: {click: 'toggleFilterSidebar()'}} + %button{ "type" => 'button', "ng-click" => 'toggleFilterSidebar()' } = t(:products_filter_heading) - %span{ng: {show: 'filtersCount()' }} + %span{ "ng-show" => 'filtersCount()' } ({{ filtersCount() }}) diff --git a/app/views/shop/products/_shop_variant_no_group_buy.html.haml b/app/views/shop/products/_shop_variant_no_group_buy.html.haml index c2f3e4131c..2b5c47494d 100644 --- a/app/views/shop/products/_shop_variant_no_group_buy.html.haml +++ b/app/views/shop/products/_shop_variant_no_group_buy.html.haml @@ -1,23 +1,20 @@ = cache_with_locale do .small-5.medium-3.large-3.columns.variant-quantity-column.text-right{"ng-if" => "::!variant.product.group_buy"} - .variant-quantity-inputs{ng: {if: "variant.line_item.quantity == 0"}} - %button.add-variant{type: "button", ng: {click: "add(1)", disabled: "!canAdd(1)"}} + .variant-quantity-inputs{ "ng-if" => "variant.line_item.quantity == 0" } + %button.add-variant{ "type" => "button", "ng-click" => "add(1)", "ng-disabled" => "!canAdd(1)" } {{ "js.shopfront.variant.add_to_cart" | t }} - .variant-quantity-inputs{ng: {if: "variant.line_item.quantity != 0"}} - %button.variant-quantity{type: "button", ng: {click: "add(-1)", disabled: "!canAdd(-1)"}}> + .variant-quantity-inputs{ "ng-if" => "variant.line_item.quantity != 0" } + %button.variant-quantity{ "type" => "button", "ng-click" => "add(-1)", "ng-disabled" => "!canAdd(-1)" }> -# U+FF0D Fullwidth Hyphen-Minus - - %input.variant-quantity{ type: "number", min: "0", max: "{{ available() }}", - ng: {model: "variant.line_item.quantity", max: "Infinity"}}> - %button.variant-quantity{type: "button", ng: {click: "add(1)", disabled: "!canAdd(1)"}} + %input.variant-quantity{ "type" => "number", "min" => "0", "max" => "{{ available() }}", "ng-model" => "variant.line_item.quantity", "ng-max" => "Infinity" }> + %button.variant-quantity{ "type" => "button", "ng-click" => "add(1)", "ng-disabled" => "!canAdd(1)" } -# U+FF0B Fullwidth Plus Sign + - .variant-remaining-stock{ng: {if: "displayRemainingInStock()"}} + .variant-remaining-stock{ "ng-if" => "displayRemainingInStock()" } {{ "js.shopfront.variant.remaining_in_stock" | t:{quantity: available()} }} - .variant-quantity-display{ng: {class: "{visible: variant.line_item.quantity}"}} + .variant-quantity-display{ "ng-class" => "{visible: variant.line_item.quantity}" } {{ "js.shopfront.variant.quantity_in_cart" | t:{quantity: variant.line_item.quantity || 0} }} - %input{type: :hidden, - name: "variants[{{::variant.id}}]", - ng: {model: "variant.line_item.quantity"}} + %input{ "type" => :hidden, "name" => "variants[{{::variant.id}}]", "ng-model" => "variant.line_item.quantity" } diff --git a/app/views/shop/products/_shop_variant_with_group_buy.html.haml b/app/views/shop/products/_shop_variant_with_group_buy.html.haml index fc5c6533b3..1a4cfdc796 100644 --- a/app/views/shop/products/_shop_variant_with_group_buy.html.haml +++ b/app/views/shop/products/_shop_variant_with_group_buy.html.haml @@ -1,18 +1,14 @@ = cache_with_locale do .small-5.medium-3.large-3.columns.variant-quantity-column.text-right{"ng-if" => "::variant.product.group_buy"} - %button.add-variant{type: "button", ng: {if: "!variant.line_item.quantity", click: "addBulk(1)", disabled: "!canAdd(1)"}} + %button.add-variant{ "type" => "button", "ng-if" => "!variant.line_item.quantity", "ng-click" => "addBulk(1)", "ng-disabled" => "!canAdd(1)" } {{ "js.shopfront.variant.add_to_cart" | t }} - %button.bulk-buy.variant-quantity{type: "button", ng: {if: "variant.line_item.quantity", click: "addBulk(0)"}}> + %button.bulk-buy.variant-quantity{ "type" => "button", "ng-if" => "variant.line_item.quantity", "ng-click" => "addBulk(0)" }> {{ variant.line_item.quantity }} - %button.bulk-buy.variant-quantity{type: "button", ng: {if: "variant.line_item.quantity", click: "addBulk(0)"}} + %button.bulk-buy.variant-quantity{ "type" => "button", "ng-if" => "variant.line_item.quantity", "ng-click" => "addBulk(0)" } {{ variant.line_item.max_quantity || "-" }} %br - .variant-quantity-display{ng: {class: "{visible: variant.line_item.quantity}"}} + .variant-quantity-display{ "ng-class" => "{visible: variant.line_item.quantity}" } {{ "js.shopfront.variant.in_cart" | t }} - %input{type: :hidden, - name: "variants[{{::variant.id}}]", - ng: {model: "variant.line_item.quantity"}} - %input{type: :hidden, - name: "variants[{{::variant.id}}]", - ng: {model: "variant.line_item.max_quantity"}} + %input{ "type" => :hidden, "name" => "variants[{{::variant.id}}]", "ng-model" => "variant.line_item.quantity" } + %input{ "type" => :hidden, "name" => "variants[{{::variant.id}}]", "ng-model" => "variant.line_item.max_quantity" } diff --git a/app/views/shop/products/_summary.html.haml b/app/views/shop/products/_summary.html.haml index da625de3ee..0ee5f45f81 100644 --- a/app/views/shop/products/_summary.html.haml +++ b/app/views/shop/products/_summary.html.haml @@ -10,7 +10,7 @@ %h3 %a{"ng-click" => "triggerProductModal()", href: 'javascript:void(0)'} %span{"ng-bind" => "::product.name"} - .product-description{ng: {"bind-html": "::product.description_html", click: "triggerProductModal()", show: "product.description_html.length"}, "data-controller": "add-blank-to-link"} + .product-description{ "data-controller" => "add-blank-to-link", "ng-bind-html" => "::product.description_html", "ng-click" => "triggerProductModal()", "ng-show" => "product.description_html.length" } %div{ "ng-switch" => "enterprise.visible" } .product-producer = t :products_from diff --git a/app/views/shopping_shared/_tabs.html.haml b/app/views/shopping_shared/_tabs.html.haml index 92d288a9f9..998fb72069 100644 --- a/app/views/shopping_shared/_tabs.html.haml +++ b/app/views/shopping_shared/_tabs.html.haml @@ -6,7 +6,7 @@ .columns.small-12.large-8 - shop_tabs.each do |tab| .page - %a{ href: "##{tab[:name]}_panel", data: { action: "tabs-and-panels#activate", "tabs-and-panels-target": "tab" }, class: ("selected" if tab[:default]) }=tab[:title] + %a{ "href" => "##{tab[:name]}_panel", "class" => ("selected" if tab[:default]), "data-action" => "tabs-and-panels#activate", "data-tabs-and-panels-target" => "tab" }=tab[:title] .columns.large-4.show-for-large-up = render partial: "shopping_shared/order_cycles" - shop_tabs.each do |tab| diff --git a/app/views/shops/_hubs.html.haml b/app/views/shops/_hubs.html.haml index 23410b2505..e31265d5b5 100644 --- a/app/views/shops/_hubs.html.haml +++ b/app/views/shops/_hubs.html.haml @@ -27,12 +27,12 @@ %a{href: "", "ng-click" => "showDistanceMatches()"} = t :hubs_distance_filter, location: "{{ nameMatchesFiltered[0].name }}" .more-controls - %span{ng: {show: "closed_shops_loading", cloak: true}} + %span{ "ng-show" => "closed_shops_loading", "ng-cloak" => true } = render partial: "components/spinner" - %span{ng: {if: "!show_closed", cloak: true}} - %a.button{href: "", ng: {click: "showClosedShops()"}} + %span{ "ng-if" => "!show_closed", "ng-cloak" => true } + %a.button{ "href" => "", "ng-click" => "showClosedShops()" } = t '.show_closed_shops' - %span{ng: {if: "show_closed", cloak: true}} - %a.button{href: "", ng: {click: "hideClosedShops()"}} + %span{ "ng-if" => "show_closed", "ng-cloak" => true } + %a.button{ "href" => "", "ng-click" => "hideClosedShops()" } = t '.hide_closed_shops' %a.button{href: main_app.map_path}= t '.show_on_map' diff --git a/app/views/shops/_skinny.html.haml b/app/views/shops/_skinny.html.haml index 33a2106fd5..8eae040429 100644 --- a/app/views/shops/_skinny.html.haml +++ b/app/views/shops/_skinny.html.haml @@ -2,7 +2,7 @@ .row.active_table_row{"ng-if" => "hub.is_distributor", "ng-click" => "toggle($event)", "ng-class" => "{'closed' : !open(), 'is_distributor' : producer.is_distributor}"} .columns.small-12.medium-5.large-5.skinny-head %a.hub{"ng-href" => "{{::hub.path}}", "ng-attr-target" => "{{ embedded_layout ? '_blank' : undefined}}", "ng-class" => "{primary: hub.active, secondary: !hub.active}", "ofn-change-hub" => "hub", "data-is-link" => "true"} - %i{ng: {class: "::hub.icon_font"}} + %i{ "ng-class" => "::hub.icon_font" } %span.margin-top.hub-name-listing{"ng-bind" => "::hub.name | truncate:40"} .columns.small-4.medium-2.large-2 @@ -13,9 +13,9 @@ .columns.small-5.medium-3.large-3.text-right.no-wrap.flex.flex-align-center.flex-justify-end{"ng-if" => "::hub.active"} %a.hub.open_closed.flex.flex-align-center{"ng-href" => "{{::hub.path}}", "ng-attr-target" => "{{ embedded_layout ? '_blank' : undefined}}", "ng-class" => "{primary: hub.active, secondary: !hub.active}", "ofn-change-hub" => "hub"} - %span{ ng: { if: "::current()" } } + %span{ "ng-if" => "::current()" } %em= t :hubs_shopping_here - %span{ ng: { if: "::!current()" } } + %span{ "ng-if" => "::!current()" } %span{"ng-bind" => "::hub.orders_close_at | sensible_timeframe"} %i.ofn-i_068-shop-reversed.show-for-medium-up %span{style: "margin-left: 0.5rem;"} @@ -23,9 +23,9 @@ .columns.small-5.medium-3.large-3.text-right.no-wrap.flex.flex-align-center.flex-justify-end{"ng-if" => "::!hub.active"} %a.hub.open_closed.flex{"ng-href" => "{{::hub.path}}", "ng-attr-target" => "{{ embedded_layout ? '_blank' : undefined}}", "ng-class" => "{primary: hub.active, secondary: !hub.active}", "ofn-change-hub" => "hub"} - %span{ ng: { if: "::current()" } } + %span{ "ng-if" => "::current()" } %em= t :hubs_shopping_here - %span{ ng: { if: "::!current()" } } + %span{ "ng-if" => "::!current()" } = t :hubs_orders_closed %i.ofn-i_068-shop-reversed.show-for-medium-up %span{style: "margin-left: 0.5rem;"} @@ -34,7 +34,7 @@ .row.active_table_row{"ng-if" => "!hub.is_distributor", "ng-class" => "closed"} .columns.small-12.medium-6.large-5.skinny-head %a.hub{"ng-click" => "openModal(hub)", "ng-class" => "{primary: hub.active, secondary: !hub.active}"} - %i{ng: {class: "hub.icon_font"}} + %i{ "ng-class" => "hub.icon_font" } %span.hub-name-listing{"ng-bind" => "::hub.name | truncate:40"} .columns.small-4.medium-2.large-2 @@ -43,5 +43,5 @@ %span.ellipsed{"ng-bind" => "::hub.address.state_name"} .columns.small-6.medium-3.large-4.text-right.no-wrap.flex.flex-align-center.flex-justify-end - %span{ ng: { if: "::!current()" } } + %span{ "ng-if" => "::!current()" } %em= t :hubs_profile_only diff --git a/app/views/spree/admin/orders/_filters.html.haml b/app/views/spree/admin/orders/_filters.html.haml index fcf14a4441..53dae3f8ae 100644 --- a/app/views/spree/admin/orders/_filters.html.haml +++ b/app/views/spree/admin/orders/_filters.html.haml @@ -7,7 +7,7 @@ .field-block.alpha.four.columns .date-range-filter.field = label_tag nil, t(:date_range) - .date-range-fields{ data: { controller: "flatpickr", "flatpickr-mode-value": "range" } } + .date-range-fields{ "data-controller" => "flatpickr", "data-flatpickr-mode-value" => "range" } = text_field_tag nil, nil, class: "datepicker", data: { "flatpickr-target": "instance", action: "flatpickr_clear@window->flatpickr#clear" } = text_field_tag "q[completed_at_gteq]", nil, "ng-model": "q.completed_at_gteq", data: { "flatpickr-target": "start" }, style: "display: none" = text_field_tag "q[completed_at_lteq]", nil, "ng-model": "q.completed_at_lteq", data: { "flatpickr-target": "end" }, style: "display: none" diff --git a/app/views/spree/admin/orders/_note.html.haml b/app/views/spree/admin/orders/_note.html.haml index fb46907191..fafc0a6821 100644 --- a/app/views/spree/admin/orders/_note.html.haml +++ b/app/views/spree/admin/orders/_note.html.haml @@ -1,10 +1,10 @@ %table.index.edit-note-table %tr.edit-note.hidden.total - %td{ colspan: "5", data: { controller: "input-char-count" }, style: "position: relative;" } + %td{ "colspan" => "5", "style" => "position: relative;", "data-controller" => "input-char-count" } %label = t(".note_label") = text_field_tag :note, @order.note, { maxLength: 280, data: { "input-char-count-target": "input" } } - %span.edit-note-count{ data: { "input-char-count-target": "count" }, style: "position: absolute; right: 7px; top: 7px; font-size: 11px;" } + %span.edit-note-count{ "style" => "position: absolute; right: 7px; top: 7px; font-size: 11px;", "data-input-char-count-target" => "count" } %td.actions = link_to '', '', class: 'save-note icon_link icon-ok no-text with-tip', data: { action: 'save' }, title: I18n.t('actions.save') diff --git a/app/views/spree/admin/orders/_table.html.haml b/app/views/spree/admin/orders/_table.html.haml index 237e309106..5a35ab7c59 100644 --- a/app/views/spree/admin/orders/_table.html.haml +++ b/app/views/spree/admin/orders/_table.html.haml @@ -10,7 +10,7 @@ %thead %tr %th - %input#selectAll{ type: 'checkbox', data: { "checked-target": "all", action: "change->checked#toggleAll" } } + %input#selectAll{ "type" => 'checkbox', "data-checked-target" => "all", "data-action" => "change->checked#toggleAll" } %th = t(:products_distributor) diff --git a/app/views/spree/admin/orders/bulk_management.html.haml b/app/views/spree/admin/orders/bulk_management.html.haml index 4216df3732..67ce532a65 100644 --- a/app/views/spree/admin/orders/bulk_management.html.haml +++ b/app/views/spree/admin/orders/bulk_management.html.haml @@ -12,41 +12,41 @@ = admin_inject_column_preferences module: 'admin.lineItems' = admin_inject_available_units -%div{ ng: { controller: 'LineItemsCtrl' }, id: "table-filter" } +%div{ "id" => "table-filter", "ng-controller" => 'LineItemsCtrl' } %fieldset %save-bar{ dirty: "bulk_order_form.$dirty", persist: "false" } - %input.red{ type: "button", value: "Save Changes", ng: { click: "submit()", disabled: "!bulk_order_form.$dirty" } } + %input.red{ "type" => "button", "value" => "Save Changes", "ng-click" => "submit()", "ng-disabled" => "!bulk_order_form.$dirty" } %legend{ align: 'center'}= t(:search) %div{ :class => "sixteen columns alpha" } .quick_search.three.columns.alpha %label{ for: 'quick_filter' } %br - %input.quick-search.fullwidth{ ng: {model: 'query'}, name: "quick_filter", type: 'text', placeholder: t('admin.quick_search'), "ng-keypress" => "$event.keyCode === 13 && fetchResults()" } + %input.quick-search.fullwidth{ "name" => "quick_filter", "type" => 'text', "placeholder" => t('admin.quick_search'), "ng-keypress" => "$event.keyCode === 13 && fetchResults()", "ng-model" => 'query' } .one.columns   .filter_select{ :class => "three columns" } %label{ :for => 'supplier_filter' } = t("admin.producer") %br - %input#supplier_filter.ofn-select2.fullwidth{ type: 'number', 'min-search' => 5, data: 'suppliers', placeholder: "#{t(:all)}", blank: "{ id: '', name: '#{t(:all)}' }", on: { selecting: "confirmRefresh" }, ng: { model: 'supplierFilter' } } + %input#supplier_filter.ofn-select2.fullwidth{ "type" => 'number', "min-search" => 5, "data" => 'suppliers', "placeholder" => "#{t(:all)}", "blank" => "{ id: '', name: '#{t(:all)}' }", "on-selecting" => "confirmRefresh", "ng-model" => 'supplierFilter' } .filter_select{ :class => "three columns" } %label{ :for => 'distributor_filter' } = t("admin.shop") %br - %input#distributor_filter.ofn-select2.fullwidth{ type: 'number', 'min-search' => 5, data: 'distributors', placeholder: "#{t(:all)}", blank: "{ id: '', name: '#{t(:all)}' }", on: { selecting: "confirmRefresh" }, ng: { model: 'distributorFilter' } } + %input#distributor_filter.ofn-select2.fullwidth{ "type" => 'number', "min-search" => 5, "data" => 'distributors', "placeholder" => "#{t(:all)}", "blank" => "{ id: '', name: '#{t(:all)}' }", "on-selecting" => "confirmRefresh", "ng-model" => 'distributorFilter' } .filter_select{ :class => "three columns" } %label{ :for => 'order_cycle_filter' } = t("admin.order_cycle") %br - %input#order_cycle_filter.ofn-select2.fullwidth{ type: 'number', 'min-search' => 5, data: 'orderCycles', placeholder: "#{t(:all)}", blank: "{ id: '', name: '#{t(:all)}' }", on: { selecting: "confirmRefresh" }, ng: { model: 'orderCycleFilter' } } + %input#order_cycle_filter.ofn-select2.fullwidth{ "type" => 'number', "min-search" => 5, "data" => 'orderCycles', "placeholder" => "#{t(:all)}", "blank" => "{ id: '', name: '#{t(:all)}' }", "on-selecting" => "confirmRefresh", "ng-model" => 'orderCycleFilter' } .date_filter{class: "three columns"} %label = t("date_range") %br - %div{ data: { controller: "flatpickr", "flatpickr-mode-value": "range", "flatpickr-default-date": "{{ [startDate, endDate] }}" } } - %input.datepicker.fullwidth{ class: "datepicker", data: { "flatpickr-target": "instance" } } - %input{ type: "text", id: 'start_date_filter', 'ng-model': "startDate", data: { "flatpickr-target": "start" }, style: "display: none;" } - %input{ type: "text", id: 'end_date_filter', 'ng-model': "endDate", data: { "flatpickr-target": "end" }, style: "display: none;" } + %div{ "data-controller" => "flatpickr", "data-flatpickr-mode-value" => "range", "data-flatpickr-default-date" => "{{ [startDate, endDate] }}" } + %input.datepicker.fullwidth{ "class" => "datepicker", "data-flatpickr-target" => "instance" } + %input{ "type" => "text", "id" => 'start_date_filter', "ng-model" => "startDate", "style" => "display: none;", "data-flatpickr-target" => "start" } + %input{ "type" => "text", "id" => 'end_date_filter', "ng-model" => "endDate", "style" => "display: none;", "data-flatpickr-target" => "end" } .clearfix .actions.filter-actions @@ -55,9 +55,9 @@ %a.button{'ng-click' => 'resetSelectFilters()', "id": "clear_filters_button" } = t(:clear_filters) - %hr.divider.sixteen.columns.alpha.omega{ ng: { show: 'unitsVariantSelected()' } } + %hr.divider.sixteen.columns.alpha.omega{ "ng-show" => 'unitsVariantSelected()' } - %div.sixteen.columns.alpha.omega#group_buy_calculation{ ng: { show: 'unitsVariantSelected()', cloak: true } } + %div.sixteen.columns.alpha.omega#group_buy_calculation{ "ng-show" => 'unitsVariantSelected()', "ng-cloak" => true } .one.columns.alpha .shared_resource.four.columns.alpha %input{ type: 'checkbox', :id => 'shared_resource', 'ng-model' => 'sharedResource'} @@ -102,7 +102,7 @@ %hr.divider.sixteen.columns.alpha.omega .clear - %div{ ng: { hide: 'RequestMonitor.loading || line_items.length == 0' }, style: "display: flex; justify-content: flex-start; column-gap: 10px; margin-bottom: 15px" } + %div{ "style" => "display: flex; justify-content: flex-start; column-gap: 10px; margin-bottom: 15px", "ng-hide" => 'RequestMonitor.loading || line_items.length == 0' } -# This -20px is a hack to make the dropdowns align properly %div{ style: "margin-right: -20px;" } = render 'admin/shared/bulk_actions_dropdown' @@ -118,15 +118,15 @@ %h1 = t("admin.orders.bulk_management.loading") - %div{ class: "sixteen columns alpha", ng: { show: '!RequestMonitor.loading && filteredLineItems.length == 0', cloak: true } } + %div{ "class" => "sixteen columns alpha", "ng-show" => '!RequestMonitor.loading && filteredLineItems.length == 0', "ng-cloak" => true } %h1#no_results = t("admin.orders.bulk_management.no_results") - .margin-bottom-50{ ng: { hide: 'RequestMonitor.loading || filteredLineItems.length == 0', cloak: true } } + .margin-bottom-50{ "ng-hide" => 'RequestMonitor.loading || filteredLineItems.length == 0', "ng-cloak" => true } %form{ name: 'bulk_order_form' } - %table.index#listing_orders.bulk{ :class => "sixteen columns alpha", ng: { show: "initialized" } } + %table.index#listing_orders.bulk{ "class" => "sixteen columns alpha", "ng-show" => "initialized" } %thead - %tr{ ng: { controller: "ColumnsCtrl" } } + %tr{ "ng-controller" => "ColumnsCtrl" } %th.bulk %input{ :type => "checkbox", :name => 'toggle_bulk', 'ng-click' => 'toggleAllCheckboxes()', 'ng-checked' => "allBoxesChecked()" } %th.order_no{ 'ng-show' => 'columns.order_no.visible' } @@ -166,7 +166,7 @@ = "#{t('admin.price')} (#{Spree::Money.currency_symbol})" %th.actions - %tr.line_item{ ng: { repeat: "line_item in filteredLineItems = ( line_items | orderBy:sorting.predicate:sorting.reverse )", 'class-even' => "'even'", 'class-odd' => "'odd'", attr: { id: "li_{{line_item.id}}" } } } + %tr.line_item{ "ng-repeat" => "line_item in filteredLineItems = ( line_items | orderBy:sorting.predicate:sorting.reverse )", "ng-class-even" => "'even'", "ng-class-odd" => "'odd'", "ng-attr-id" => "li_{{line_item.id}}" } %td.bulk %input{ :type => "checkbox", :name => 'bulk', 'ng-model' => 'line_item.checked', 'ignore-dirty' => true } %td.order_no{ 'ng-show' => 'columns.order_no.visible' } {{ line_item.order.number }} @@ -180,17 +180,17 @@ %td.variant{ 'ng-show' => 'columns.variant.visible' } %a{ :href => '#', 'ng-click' => "setSelectedUnitsVariant(line_item.units_product,line_item.units_variant)" } {{ line_item.units_variant.full_name }} %td.quantity{ 'ng-show' => 'columns.quantity.visible' } - %input.show-dirty{ :type => 'number', :name => 'quantity', :id => 'quantity', ng: { model: "line_item.quantity", change: "updateOnQuantity(line_item)", required: "true", class: '{"update-error": line_item.errors.quantity}' }, min: 1, step: 1 } - %span.error{ ng: { bind: 'line_item.errors.quantity' } } + %input.show-dirty{ "type" => 'number', "name" => 'quantity', "id" => 'quantity', "min" => 1, "step" => 1, "ng-model" => "line_item.quantity", "ng-change" => "updateOnQuantity(line_item)", "ng-required" => "true", "ng-class" => '{"update-error": line_item.errors.quantity}' } + %span.error{ "ng-bind" => 'line_item.errors.quantity' } %td.max{ 'ng-show' => 'columns.max.visible' } {{ line_item.max_quantity }} %td.final_weight_volume{ 'ng-show' => 'columns.final_weight_volume.visible' } - %input.show-dirty{ type: 'number', step: 'any', :name => 'final_weight_volume', :id => 'final_weight_volume', ng: { model: "line_item.final_weight_volume", readonly: "unitValueLessThanZero(line_item)", change: "weightAdjustedPrice(line_item)", required: "true", class: '{"update-error": line_item.errors.final_weight_volume}' }, min: 0, 'ng-pattern' => '/[0-9]*[.]?[0-9]+/' } - %span.error{ ng: { bind: 'line_item.errors.final_weight_volume' } } + %input.show-dirty{ "type" => 'number', "step" => 'any', "name" => 'final_weight_volume', "id" => 'final_weight_volume', "min" => 0, "ng-pattern" => '/[0-9]*[.]?[0-9]+/', "ng-model" => "line_item.final_weight_volume", "ng-readonly" => "unitValueLessThanZero(line_item)", "ng-change" => "weightAdjustedPrice(line_item)", "ng-required" => "true", "ng-class" => '{"update-error": line_item.errors.final_weight_volume}' } + %span.error{ "ng-bind" => 'line_item.errors.final_weight_volume' } %td.price{ 'ng-show' => 'columns.price.visible' } - %input.show-dirty{ :type => 'text', :name => 'price', :id => 'price', :ng => { value: 'line_item.price * line_item.quantity | currency:""', readonly: "true", class: '{"update-error": line_item.errors.price}' } } - %span.error{ ng: { bind: 'line_item.errors.price' } } + %input.show-dirty{ "type" => 'text', "name" => 'price', "id" => 'price', "ng-value" => 'line_item.price * line_item.quantity | currency:""', "ng-readonly" => "true", "ng-class" => '{"update-error": line_item.errors.price}' } + %span.error{ "ng-bind" => 'line_item.errors.price' } %td.actions - %a{ ng: { href: "/admin/orders/{{line_item.order.number}}/edit" }, :class => "edit-order icon-edit no-text", 'confirm-link-click' => 'confirmRefresh()' } + %a{ "class" => "edit-order icon-edit no-text", "confirm-link-click" => 'confirmRefresh()', "ng-href" => "/admin/orders/{{line_item.order.number}}/edit" } %td.actions %a{ 'ng-click' => "deleteLineItem(line_item)", :class => "delete-line-item icon-trash no-text" } diff --git a/app/views/spree/admin/payment_methods/_providers.html.haml b/app/views/spree/admin/payment_methods/_providers.html.haml index b25a7b09c5..7080f6c739 100644 --- a/app/views/spree/admin/payment_methods/_providers.html.haml +++ b/app/views/spree/admin/payment_methods/_providers.html.haml @@ -1,4 +1,4 @@ -#provider-settings{ ng: { controller: "ProvidersCtrl" } } +#provider-settings{ "ng-controller" => "ProvidersCtrl" } .row .alpha.four.columns = label :payment_method, :type, t('.provider') diff --git a/app/views/spree/admin/payment_methods/_stripe_connect.html.haml b/app/views/spree/admin/payment_methods/_stripe_connect.html.haml index bc3ba014b4..77dbfa0b79 100644 --- a/app/views/spree/admin/payment_methods/_stripe_connect.html.haml +++ b/app/views/spree/admin/payment_methods/_stripe_connect.html.haml @@ -1,40 +1,37 @@ %fieldset.no-border-bottom#gateway_fields %legend{ align: "center"} = t(:provider_settings) - .preference-settings{ ng: { controller: "StripeController" } } + .preference-settings{ "ng-controller" => "StripeController" } = fields_for :payment_method, @payment_method do |payment_method_form| .row .alpha.four.columns = payment_method_form.label :stripe_account_owner .omega.twelve.columns - if @stripe_account_holder.nil? || spree_current_user.enterprises.include?(@stripe_account_holder) - %input.ofn-select2.fullwidth#payment_method_preferred_enterprise_id{ type: 'number', - name: 'payment_method[preferred_enterprise_id]', - placeholder: t(".enterprise_select_placeholder"), - data: 'shops', ng: { model: 'paymentMethod.preferred_enterprise_id' } } + %input.ofn-select2.fullwidth#payment_method_preferred_enterprise_id{ "type" => 'number', "name" => 'payment_method[preferred_enterprise_id]', "placeholder" => t(".enterprise_select_placeholder"), "data" => 'shops', "ng-model" => 'paymentMethod.preferred_enterprise_id' } - else %strong= Enterprise.find_by(id: @payment_method)&.name - #stripe-account-status{ ng: { show: "paymentMethod.preferred_enterprise_id" } } - .alert-box.warning{ ng: { hide: "stripe_account.status" } } + #stripe-account-status{ "ng-show" => "paymentMethod.preferred_enterprise_id" } + .alert-box.warning{ "ng-hide" => "stripe_account.status" } = t(".loading_account_information_msg") - .alert-box.error{ ng: { show: "stripe_account.status == 'stripe_disabled'" } } + .alert-box.error{ "ng-show" => "stripe_account.status == 'stripe_disabled'" } = t(".stripe_disabled_msg") - .alert-box.error{ ng: { show: "stripe_account.status == 'request_failed'" } } + .alert-box.error{ "ng-show" => "stripe_account.status == 'request_failed'" } = t(".request_failed_msg") - .alert-box.error{ ng: { show: "stripe_account.status == 'account_missing'" } } + .alert-box.error{ "ng-show" => "stripe_account.status == 'account_missing'" } = t(".account_missing_msg") - %a.button{ ng: { href: "{{current_enterprise_stripe_path()}}" }, target: 'blank' } + %a.button{ "target" => 'blank', "ng-href" => "{{current_enterprise_stripe_path()}}" } = t(".connect_one") %i.icon-chevron-right - .alert-box.error{ ng: { show: "stripe_account.status == 'access_revoked'" } } + .alert-box.error{ "ng-show" => "stripe_account.status == 'access_revoked'" } = t(".access_revoked_msg") - .alert-box.ok{ ng: { show: "stripe_account.status == 'connected'" } } + .alert-box.ok{ "ng-show" => "stripe_account.status == 'connected'" } .status %strong= t(".status") + ":" = t(".connected") diff --git a/app/views/spree/admin/products/index.html.haml b/app/views/spree/admin/products/index.html.haml index b7c4a3853a..c237419b00 100644 --- a/app/views/spree/admin/products/index.html.haml +++ b/app/views/spree/admin/products/index.html.haml @@ -2,7 +2,7 @@ = render 'spree/admin/products/index/data' = admin_inject_available_units -%div{ ng: { app: 'ofn.admin', controller: 'AdminProductEditCtrl', init: 'initialise()' } } +%div{ "ng-app" => 'ofn.admin', "ng-controller" => 'AdminProductEditCtrl', "ng-init" => 'initialise()' } = render 'spree/admin/products/index/filters' %div{ 'ng-cloak' => true } diff --git a/app/views/spree/admin/products/index/_filters.html.haml b/app/views/spree/admin/products/index/_filters.html.haml index 98e186c7f1..042e12827e 100644 --- a/app/views/spree/admin/products/index/_filters.html.haml +++ b/app/views/spree/admin/products/index/_filters.html.haml @@ -5,20 +5,20 @@ .quick_search.three.columns.alpha %label{ for: 'quick_filter' } %br - %input.quick-search.fullwidth{ ng: {model: 'q.query'}, name: "quick_filter", type: 'text', placeholder: t('admin.quick_search'), "ng-keypress" => "$event.keyCode === 13 && fetchProducts()" } + %input.quick-search.fullwidth{ "name" => "quick_filter", "type" => 'text', "placeholder" => t('admin.quick_search'), "ng-keypress" => "$event.keyCode === 13 && fetchProducts()", "ng-model" => 'q.query' } .one.columns   .filter_select.three.columns %label{ for: 'producer_filter' }= t 'producer' %br - %select.fullwidth{ id: 'producer_filter', 'ofn-select2-min-search' => 5, ng: {model: 'q.producerFilter', options: 'producer.id as producer.name for producer in producers'} } + %select.fullwidth{ "id" => 'producer_filter', "ofn-select2-min-search" => 5, "ng-model" => 'q.producerFilter', "ng-options" => 'producer.id as producer.name for producer in producers' } .filter_select.three.columns %label{ for: 'category_filter' }= t 'category' %br - %select.fullwidth{ id: 'category_filter', 'ofn-select2-min-search' => 5, ng: {model: 'q.categoryFilter', options: 'taxon.id as taxon.name for taxon in taxons'} } + %select.fullwidth{ "id" => 'category_filter', "ofn-select2-min-search" => 5, "ng-model" => 'q.categoryFilter', "ng-options" => 'taxon.id as taxon.name for taxon in taxons' } .filter_select.three.columns %label{ for: 'import_filter' }= t 'import_date' %br - %select.fullwidth{ id: 'import_date_filter', 'ofn-select2-min-search' => 5, ng: {model: 'q.importDateFilter', init: "importDates = #{@import_dates}; showLatestImport = #{@show_latest_import}", options: 'date.id as date.name for date in importDates'} } + %select.fullwidth{ "id" => 'import_date_filter', "ofn-select2-min-search" => 5, "ng-model" => 'q.importDateFilter', "ng-init" => "importDates = #{@import_dates}; showLatestImport = #{@show_latest_import}", "ng-options" => 'date.id as date.name for date in importDates' } .filter_clear.three.columns.omega %label{ for: 'clear_all_filters' } diff --git a/app/views/spree/admin/products/index/_products.html.haml b/app/views/spree/admin/products/index/_products.html.haml index e0c6d76a2b..0acc890b82 100644 --- a/app/views/spree/admin/products/index/_products.html.haml +++ b/app/views/spree/admin/products/index/_products.html.haml @@ -1,7 +1,7 @@ %div.sixteen.columns.alpha{ 'ng-hide' => 'RequestMonitor.loading || products.length == 0' } %form{ name: 'bulk_product_form', autocomplete: "off" } %save-bar{ dirty: "bulk_product_form.$dirty", persist: "false" } - %input.red{ type: "button", value: t(:save_changes), ng: { click: "submitProducts()", disabled: "!bulk_product_form.$dirty" } } + %input.red{ "type" => "button", "value" => t(:save_changes), "ng-click" => "submitProducts()", "ng-disabled" => "!bulk_product_form.$dirty" } %input{ type: "button", value: t(:close), 'ng-click' => "cancel('#{admin_products_path}')" } %table.index#listing_products.bulk diff --git a/app/views/spree/admin/products/index/_products_head.html.haml b/app/views/spree/admin/products/index/_products_head.html.haml index 09de5a1114..fafb59859b 100644 --- a/app/views/spree/admin/products/index/_products_head.html.haml +++ b/app/views/spree/admin/products/index/_products_head.html.haml @@ -1,24 +1,24 @@ %colgroup %col.actions - %col.image{ ng: { show: 'columns.image.visible' } } - %col.producer{ ng: { show: 'columns.producer.visible' } } - %col.sku{ ng: { show: 'columns.sku.visible' } } - %col.name{ ng: { show: 'columns.name.visible' } } - %col.unit{ ng: { show: 'columns.unit.visible' } } - %col.display_as{ ng: { show: 'columns.unit.visible' } } - %col.price{ ng: { show: 'columns.price.visible'} } - %col.on_hand{ ng: { show: 'columns.on_hand.visible' } } - %col.on_demand{ ng: { show: 'columns.on_demand.visible' } } - %col.category{ ng: { show: 'columns.category.visible' } } - %col.tax_category{ ng: { show: 'columns.tax_category.visible' } } - %col.inherits_properties{ ng: { show: 'columns.inherits_properties.visible' } } - %col.import_date{ ng: { show: 'columns.import_date.visible' } } + %col.image{ "ng-show" => 'columns.image.visible' } + %col.producer{ "ng-show" => 'columns.producer.visible' } + %col.sku{ "ng-show" => 'columns.sku.visible' } + %col.name{ "ng-show" => 'columns.name.visible' } + %col.unit{ "ng-show" => 'columns.unit.visible' } + %col.display_as{ "ng-show" => 'columns.unit.visible' } + %col.price{ "ng-show" => 'columns.price.visible' } + %col.on_hand{ "ng-show" => 'columns.on_hand.visible' } + %col.on_demand{ "ng-show" => 'columns.on_demand.visible' } + %col.category{ "ng-show" => 'columns.category.visible' } + %col.tax_category{ "ng-show" => 'columns.tax_category.visible' } + %col.inherits_properties{ "ng-show" => 'columns.inherits_properties.visible' } + %col.import_date{ "ng-show" => 'columns.import_date.visible' } %col.actions %col.actions %col.actions %thead - %tr{ ng: { controller: "ColumnsCtrl" } } + %tr{ "ng-controller" => "ColumnsCtrl" } %th.left-actions %a{ 'ng-click' => 'toggleShowAllVariants()', :style => 'color: red; cursor: pointer' } = t(:expand_all) diff --git a/app/views/spree/admin/products/index/_products_variant.html.haml b/app/views/spree/admin/products/index/_products_variant.html.haml index 45a7ea24c6..fcb6a4030b 100644 --- a/app/views/spree/admin/products/index/_products_variant.html.haml +++ b/app/views/spree/admin/products/index/_products_variant.html.haml @@ -22,7 +22,7 @@ %input.field{ 'ng-model' => 'variant.on_demand', :name => 'variant_on_demand', 'ofn-track-variant' => 'on_demand', :type => 'checkbox' } %td{ 'ng-show' => 'columns.category.visible' } %td{ 'ng-show' => 'columns.tax_category.visible' } - %select.select2{ name: 'variant_tax_category_id', 'ofn-track-variant': 'tax_category_id', ng: { model: 'variant.tax_category_id', options: 'tax_category.id as tax_category.name for tax_category in tax_categories' } } + %select.select2{ "name" => 'variant_tax_category_id', "ofn-track-variant" => 'tax_category_id', "ng-model" => 'variant.tax_category_id', "ng-options" => 'tax_category.id as tax_category.name for tax_category in tax_categories' } %option{ value: '' }= t(:none) %td{ 'ng-show' => 'columns.inherits_properties.visible' } %td{ 'ng-show' => 'columns.import_date.visible' } diff --git a/app/views/spree/admin/products/new.html.haml b/app/views/spree/admin/products/new.html.haml index 71710c1258..3a64d197bf 100644 --- a/app/views/spree/admin/products/new.html.haml +++ b/app/views/spree/admin/products/new.html.haml @@ -54,7 +54,7 @@ %br/ = f.text_field :price, { "class": "fullwidth", "ng-model": "product.price", "ng-value": "'#{@product.price}'" } = f.error_message_on :price - .four.columns{ ng: { app: 'ofn.admin'}} + .four.columns{ "ng-app" => 'ofn.admin' } = f.field_container :unit_price do %div{style: "display: flex"} = f.label :unit_price, t(".unit_price") diff --git a/app/views/spree/admin/shared/_order_links.html.haml b/app/views/spree/admin/shared/_order_links.html.haml index 41508a2ad2..d955650d12 100644 --- a/app/views/spree/admin/shared/_order_links.html.haml +++ b/app/views/spree/admin/shared/_order_links.html.haml @@ -7,12 +7,12 @@ %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" } } + %a.menu_item{ "href" => link[:url], "target" => link[:target] || "_self", "data-modal-link-target-value" => dom_id(@order, :ship), "data-action" => "click->modal-link#open", "data-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] } } + %a.menu_item{ "href" => link[:url], "target" => link[:target] || "_self", "data-method" => link[:method], "data-ujs-navigate" => link[:method] ? "false" : "undefined", "data-confirm" => link[:confirm] } %span %i{ class: link[:icon] } %span=link[:name] diff --git a/app/views/spree/admin/shared/_status_message.html.haml b/app/views/spree/admin/shared/_status_message.html.haml index f9de868721..01f236fd3f 100644 --- a/app/views/spree/admin/shared/_status_message.html.haml +++ b/app/views/spree/admin/shared/_status_message.html.haml @@ -1,2 +1,2 @@ -%h6{ id: "status-message", ng: { style: 'StatusMessage.statusMessage.style' } } +%h6{ "id" => "status-message", "ng-style" => 'StatusMessage.statusMessage.style' } {{ StatusMessage.statusMessage.text || " " }} diff --git a/app/views/spree/orders/_bought.html.haml b/app/views/spree/orders/_bought.html.haml index f00a8b2dbe..67a6665658 100644 --- a/app/views/spree/orders/_bought.html.haml +++ b/app/views/spree/orders/_bought.html.haml @@ -1,18 +1,18 @@ -%tbody{ ng: { controller: 'EditBoughtOrderController' } } +%tbody{ "ng-controller" => 'EditBoughtOrderController' } %tr - %td.toggle-bought{ colspan: 2, ng: { click: 'showBought=!showBought' } } + %td.toggle-bought{ "colspan" => 2, "ng-click" => 'showBought=!showBought' } %h5.brick - %i{ ng: { class: "{ 'ofn-i_007-caret-right': !showBought, 'ofn-i_005-caret-down': showBought}"} } + %i{ "ng-class" => "{ 'ofn-i_007-caret-right': !showBought, 'ofn-i_005-caret-down': showBought}" } = t(:orders_bought_items_notice, count: @order.finalised_line_items.to_a.sum(&:quantity)) %td.text-right{ colspan: 3 } - %a.edit-finalised.button.radius.expand.small{ href: changeable_orders_link_path, ng: { class: "{secondary: !showBought, primary: showBought}" } } + %a.edit-finalised.button.radius.expand.small{ "href" => changeable_orders_link_path, "ng-class" => "{secondary: !showBought, primary: showBought}" } = t(:orders_bought_edit_button) %i.ofn-i_007-caret-right - @order.finalised_line_items.each do |line_item| - variant = line_item.variant - %tr.bought.line-item{class: "line-item-#{line_item.id} variant-#{variant.id}", ng: { show: 'showBought'} } + %tr.bought.line-item{ "class" => "line-item-#{line_item.id} variant-#{variant.id}", "ng-show" => 'showBought' } %td.cart-item-description %div.item-thumb-image @@ -31,5 +31,5 @@ = line_item.display_amount_with_adjustments.to_html unless line_item.quantity.nil? %td.bought-item-delete.text-center - %a{ng: {click: "removeEnabled && deleteLineItem(#{line_item.id})"}} + %a{ "ng-click" => "removeEnabled && deleteLineItem(#{line_item.id})" } %i.ofn-i_026-trash diff --git a/app/views/spree/orders/form/_update_buttons.html.haml b/app/views/spree/orders/form/_update_buttons.html.haml index 50e256e540..633ecf5b1d 100644 --- a/app/views/spree/orders/form/_update_buttons.html.haml +++ b/app/views/spree/orders/form/_update_buttons.html.haml @@ -23,5 +23,5 @@ .columns.small-12.medium-3 = button_tag :class => 'button primary expand', :id => 'update-button', "ng-disabled" => 'update_order_form.$pristine' do %i.ofn-i_051-check-big - %span{ ng: { show: 'update_order_form.$dirty' } }= t(:save_changes) - %span{ ng: { hide: 'update_order_form.$dirty' } }= t(:order_saved) + %span{ "ng-show" => 'update_order_form.$dirty' }= t(:save_changes) + %span{ "ng-hide" => 'update_order_form.$dirty' }= t(:order_saved) diff --git a/app/views/spree/users/_authorised_shops.html.haml b/app/views/spree/users/_authorised_shops.html.haml index 51fdacf3ef..c965c9e50e 100644 --- a/app/views/spree/users/_authorised_shops.html.haml +++ b/app/views/spree/users/_authorised_shops.html.haml @@ -5,13 +5,7 @@ %tr %th= t(".shop_name") %th= t(".allow_charges?") - %tr.customer{ id: "customer{{ customer.id }}", ng: { repeat: "customer in customers" } } - %td.shop{ ng: { bind: 'shopsByID[customer.enterprise_id].name' } } + %tr.customer{ "id" => "customer{{ customer.id }}", "ng-repeat" => "customer in customers" } + %td.shop{ "ng-bind" => 'shopsByID[customer.enterprise_id].name' } %td.allow_charges{ tooltip: "{{ hasOneDefaultSavedCards() ? null : \'" + t('.no_default_saved_cards_tooltip') + "\' }}" } - %input{ type: 'checkbox', - name: 'allow_charges', - ng: { model: 'customer.allow_charges', - change: 'customer.update()', - disabled: "!hasOneDefaultSavedCards()", - "true-value" => "true", - "false-value" => "false" } } + %input{ "type" => 'checkbox', "name" => 'allow_charges', "ng-model" => 'customer.allow_charges', "ng-change" => 'customer.update()', "ng-disabled" => "!hasOneDefaultSavedCards()", "ng-true-value" => "true", "ng-false-value" => "false" } diff --git a/app/views/spree/users/_cards.html.haml b/app/views/spree/users/_cards.html.haml index 869b59242a..4a61c8f7ec 100644 --- a/app/views/spree/users/_cards.html.haml +++ b/app/views/spree/users/_cards.html.haml @@ -7,18 +7,18 @@ %button.button.secondary.tiny.help-btn{ "data-controller": "help-modal-link", "data-action": "click->help-modal-link#open", "data-help-modal-link-target-value": "saved_cards_modal" } %i.ofn-i_013-help - .saved_cards{ ng: { show: 'savedCreditCards.length > 0' } } + .saved_cards{ "ng-show" => 'savedCreditCards.length > 0' } = render 'saved_cards' - .no_cards{ ng: { hide: 'savedCreditCards.length > 0' } } + .no_cards{ "ng-hide" => 'savedCreditCards.length > 0' } = t(:you_have_no_saved_cards) - %button.button.primary{ ng: { click: 'showForm()', hide: 'CreditCard.visible' } } + %button.button.primary{ "ng-click" => 'showForm()', "ng-hide" => 'CreditCard.visible' } = t(:add_a_card) .small-12.medium-6.columns - .new_card{ ng: { show: 'CreditCard.visible', class: '{visible: CreditCard.visible}' } } + .new_card{ "ng-show" => 'CreditCard.visible', "ng-class" => '{visible: CreditCard.visible}' } %h3= t(:add_new_credit_card) = render 'new_card_form' - .authorised_shops{ ng: { controller: 'AuthorisedShopsCtrl', hide: 'CreditCard.visible || savedCreditCards.length == 0' } } + .authorised_shops{ "ng-controller" => 'AuthorisedShopsCtrl', "ng-hide" => 'CreditCard.visible || savedCreditCards.length == 0' } %h3 = t('.authorised_shops') = render 'authorised_shops' diff --git a/app/views/spree/users/_new_card_form.html.haml b/app/views/spree/users/_new_card_form.html.haml index 3d17afbf6a..3b9e1f8903 100644 --- a/app/views/spree/users/_new_card_form.html.haml +++ b/app/views/spree/users/_new_card_form.html.haml @@ -4,24 +4,14 @@ %label = t(:first_name) -# Changing name not permitted by default (in checkout) - can be enabled by setting an allow_name_change variable in $scope - %input#first_name{ type: :text, - name: 'first_name', - required: true, - ng: { model: "secrets.first_name", - disabled: "!allow_name_change", - value: "order.bill_address.firstname"} } - %small.error{ ng: { show: 'new_card_form.$submitted && new_card_form.first_name.$error.required' } }= t(:error_required) + %input#first_name{ "type" => :text, "name" => 'first_name', "required" => true, "ng-model" => "secrets.first_name", "ng-disabled" => "!allow_name_change", "ng-value" => "order.bill_address.firstname" } + %small.error{ "ng-show" => 'new_card_form.$submitted && new_card_form.first_name.$error.required' }= t(:error_required) .small-6.columns %label = t(:last_name) - %input#last_name{type: :text, - name: "last_name", - required: true, - ng: { model: "secrets.last_name", - disabled: "!allow_name_change", - value: "order.bill_address.lastname" } } - %small.error{ ng: { show: 'new_card_form.$submitted && new_card_form.last_name.$error.required' } }= t(:error_required) + %input#last_name{ "type" => :text, "name" => "last_name", "required" => true, "ng-model" => "secrets.last_name", "ng-disabled" => "!allow_name_change", "ng-value" => "order.bill_address.lastname" } + %small.error{ "ng-show" => 'new_card_form.$submitted && new_card_form.last_name.$error.required' }= t(:error_required) .row .small-12.columns diff --git a/app/views/spree/users/_orders.html.haml b/app/views/spree/users/_orders.html.haml index a8c34b22f1..ef750fe04c 100644 --- a/app/views/spree/users/_orders.html.haml +++ b/app/views/spree/users/_orders.html.haml @@ -1,10 +1,10 @@ %script{ type: "text/ng-template", id: "account/orders.html" } .orders{"ng-controller" => "OrdersCtrl", "ng-cloak" => true} - .my-open-orders{ ng: { show: 'Orders.changeable.length > 0' } } + .my-open-orders{ "ng-show" => 'Orders.changeable.length > 0' } %h3= t('.open_orders') = render 'open_orders' - .past-orders{ ng: { show: 'pastOrders.length > 0' } } + .past-orders{ "ng-show" => 'pastOrders.length > 0' } %h3= t('.past_orders') = render 'past_orders' .message{"ng-if" => "Orders.all.length == 0", "ng-bind" => "::'you_have_no_orders_yet' | t"} diff --git a/app/views/spree/users/_saved_cards.html.haml b/app/views/spree/users/_saved_cards.html.haml index 853642762b..ea1c2472e6 100644 --- a/app/views/spree/users/_saved_cards.html.haml +++ b/app/views/spree/users/_saved_cards.html.haml @@ -5,12 +5,12 @@ %th= t(:card_expiry_date) %th= t('.default?') %th= t('.delete?') - %tr.card{ id: "card{{ card.id }}", ng: { repeat: "card in savedCreditCards" } } - %td.brand{ ng: { bind: '::card.brand' } } - %td.number{ ng: { bind: '::card.number' } } - %td.expiry{ ng: { bind: '::card.expiry' } } + %tr.card{ "id" => "card{{ card.id }}", "ng-repeat" => "card in savedCreditCards" } + %td.brand{ "ng-bind" => '::card.brand' } + %td.number{ "ng-bind" => '::card.number' } + %td.expiry{ "ng-bind" => '::card.expiry' } %td.is-default - %input{ type: 'radio', name: 'default_card', ng: { model: 'card.is_default', click: 'confirmSetDefault(card, $event)', value: "true"} } + %input{ "type" => 'radio', "name" => 'default_card', "ng-model" => 'card.is_default', "ng-click" => 'confirmSetDefault(card, $event)', "ng-value" => "true" } %td.actions %button.tiny.alert.no-margin{ "ng-click": "deleteCard(card.id)" } = t(:delete) diff --git a/engines/web/app/views/web/angular_templates/cookies_banner.html.haml b/engines/web/app/views/web/angular_templates/cookies_banner.html.haml index 2343051cd7..90cfe16b09 100644 --- a/engines/web/app/views/web/angular_templates/cookies_banner.html.haml +++ b/engines/web/app/views/web/angular_templates/cookies_banner.html.haml @@ -11,5 +11,5 @@ {{ 'legal.cookies_banner.cookies_policy_link' | t}} .large-3.columns - %button{ng: { controller:"CookiesBannerCtrl", click: "acceptCookies()" }} + %button{ "ng-controller" => "CookiesBannerCtrl", "ng-click" => "acceptCookies()" } {{ 'legal.cookies_banner.cookies_accept_button' | t}} diff --git a/engines/web/app/views/web/angular_templates/cookies_policy.html.haml b/engines/web/app/views/web/angular_templates/cookies_policy.html.haml index c53fa93bed..56b62ab23b 100644 --- a/engines/web/app/views/web/angular_templates/cookies_policy.html.haml +++ b/engines/web/app/views/web/angular_templates/cookies_policy.html.haml @@ -12,7 +12,7 @@ %p {{ 'legal.cookies_policy.essential_cookies_desc' | t }} -%table{ng: { controller:"CookiesPolicyModalCtrl"}} +%table{ "ng-controller" => "CookiesPolicyModalCtrl" } = render_cookie_entry( "_ofn_session_id", "legal.cookies_policy.cookie_session_desc" ) = render_cookie_entry( "cookies_consent", "legal.cookies_policy.cookie_consent_desc" ) = render_cookie_entry( "remember_spree_user_token", "legal.cookies_policy.cookie_remember_me_desc" ) @@ -52,7 +52,7 @@ %p {{ 'legal.cookies_policy.statistics_cookies_matomo_desc_html' | t }} - %table{ng: { controller:"CookiesPolicyModalCtrl"}} + %table{ "ng-controller" => "CookiesPolicyModalCtrl" } = render_cookie_entry( "_pk_ref, _pk_cvar, _pk_id and _pk_ses", "legal.cookies_policy.cookie_matomo_basics_desc" ) = render_cookie_entry( "_pk_hsr, _pk_cvar, _pk_id and _pk_ses", "legal.cookies_policy.cookie_matomo_heatmap_desc" ) = render_cookie_entry( "piwik_ignore, _pk_cvar, _pk_id and _pk_ses", "legal.cookies_policy.cookie_matomo_ignore_desc" )