From 258e84fc0a76a85c4670db4db320b13e75a41b00 Mon Sep 17 00:00:00 2001 From: Rohan Mitchell Date: Fri, 12 Feb 2016 08:33:37 +1100 Subject: [PATCH] Replace with-tip with ofn-with-tip: misc --- app/assets/javascripts/admin/enterprise_fees.js | 2 +- app/helpers/spree/admin/base_helper_decorator.rb | 2 +- .../image_settings/edit/add_image_format.html.haml.deface | 2 +- .../orders/index/add_special_instructions.html.haml.deface | 2 +- app/overrides/spree/admin/orders/index/set_ng_app.deface | 2 ++ app/views/admin/order_cycles/_row.html.haml | 4 ++-- app/views/admin/order_cycles/index.html.haml | 2 +- app/views/spree/admin/orders/bulk_management.html.haml | 7 +++++-- .../admin/products/bulk_edit/_products_variant.html.haml | 2 +- 9 files changed, 15 insertions(+), 10 deletions(-) create mode 100644 app/overrides/spree/admin/orders/index/set_ng_app.deface diff --git a/app/assets/javascripts/admin/enterprise_fees.js b/app/assets/javascripts/admin/enterprise_fees.js index b815cd4266..79b1876263 100644 --- a/app/assets/javascripts/admin/enterprise_fees.js +++ b/app/assets/javascripts/admin/enterprise_fees.js @@ -34,7 +34,7 @@ angular.module('enterprise_fees', []) return function(scope, element, attrs) { if(scope.enterprise_fee.id) { var url = "/admin/enterprise_fees/" + scope.enterprise_fee.id - var html = ''; + var html = ''; //var html = 'Delete Delete'; element.append(html); } diff --git a/app/helpers/spree/admin/base_helper_decorator.rb b/app/helpers/spree/admin/base_helper_decorator.rb index 82bf794073..86e77431ba 100644 --- a/app/helpers/spree/admin/base_helper_decorator.rb +++ b/app/helpers/spree/admin/base_helper_decorator.rb @@ -5,7 +5,7 @@ module Spree def link_to_remove_fields(name, f, options = {}) name = '' if options[:no_text] options[:class] = '' unless options[:class] - options[:class] += 'no-text with-tip' if options[:no_text] + options[:class] += 'no-text' if options[:no_text] url = if f.object.persisted? options[:url] || [:admin, f.object] diff --git a/app/overrides/spree/admin/image_settings/edit/add_image_format.html.haml.deface b/app/overrides/spree/admin/image_settings/edit/add_image_format.html.haml.deface index deb79b5bbf..fe050c6c7c 100644 --- a/app/overrides/spree/admin/image_settings/edit/add_image_format.html.haml.deface +++ b/app/overrides/spree/admin/image_settings/edit/add_image_format.html.haml.deface @@ -3,7 +3,7 @@ - @styles.each_with_index do |(style_name, style_value), index| .field.three.columns = label_tag "attachment_styles[#{style_name}]", style_name - %a.destroy_style.with-tip{:alt => t(:destroy), :href => "#", :title => t(:destroy)} + %a.destroy_style{:alt => t(:destroy), :href => "#", :title => t(:destroy)} %i.icon-trash = text_field_tag "attachment_styles[#{style_name}][]", admin_image_settings_geometry_from_style(style_value), :class => 'fullwidth' %br/ diff --git a/app/overrides/spree/admin/orders/index/add_special_instructions.html.haml.deface b/app/overrides/spree/admin/orders/index/add_special_instructions.html.haml.deface index 75a2bc4689..1711343f3c 100644 --- a/app/overrides/spree/admin/orders/index/add_special_instructions.html.haml.deface +++ b/app/overrides/spree/admin/orders/index/add_special_instructions.html.haml.deface @@ -2,5 +2,5 @@ - if order.special_instructions.present? %br - %span{class: "icon-warning-sign with-tip", title: order.special_instructions} + %span{class: "icon-warning-sign", "ofn-with-tip" => order.special_instructions} notes diff --git a/app/overrides/spree/admin/orders/index/set_ng_app.deface b/app/overrides/spree/admin/orders/index/set_ng_app.deface new file mode 100644 index 0000000000..9ca071be11 --- /dev/null +++ b/app/overrides/spree/admin/orders/index/set_ng_app.deface @@ -0,0 +1,2 @@ +add_to_attributes "table#listing_orders" +attributes "ng-app" => "ofn.admin" diff --git a/app/views/admin/order_cycles/_row.html.haml b/app/views/admin/order_cycles/_row.html.haml index 2594d5c9f3..d75a97bbb5 100644 --- a/app/views/admin/order_cycles/_row.html.haml +++ b/app/views/admin/order_cycles/_row.html.haml @@ -11,7 +11,7 @@ - suppliers = order_cycle.suppliers.merge(OpenFoodNetwork::OrderCyclePermissions.new(spree_current_user, order_cycle).visible_enterprises) - supplier_list = suppliers.map(&:name).sort.join ', ' - if suppliers.count > 3 - %span.with-tip{'data-powertip' => supplier_list} + %span{'ofn-with-tip' => supplier_list} = suppliers.count suppliers - else @@ -21,7 +21,7 @@ - distributors = order_cycle.distributors.merge(OpenFoodNetwork::OrderCyclePermissions.new(spree_current_user, order_cycle).visible_enterprises) - distributor_list = distributors.map(&:name).sort.join ', ' - if distributors.count > 3 - %span.with-tip{'data-powertip' => distributor_list} + %span{'ofn-with-tip' => distributor_list} = distributors.count distributors - else diff --git a/app/views/admin/order_cycles/index.html.haml b/app/views/admin/order_cycles/index.html.haml index e39fdde12a..8f062ff7db 100644 --- a/app/views/admin/order_cycles/index.html.haml +++ b/app/views/admin/order_cycles/index.html.haml @@ -11,7 +11,7 @@ %li = button_link_to "Show more", main_app.admin_order_cycles_path(params: { show_more: true }) -= form_for @order_cycle_set, :url => main_app.bulk_update_admin_order_cycles_path do |f| += form_for @order_cycle_set, url: main_app.bulk_update_admin_order_cycles_path, html: {"ng-app" => "admin.orderCycles"} do |f| %table.index#listing_order_cycles %colgroup %col diff --git a/app/views/spree/admin/orders/bulk_management.html.haml b/app/views/spree/admin/orders/bulk_management.html.haml index 0ab782023d..46e5caf191 100644 --- a/app/views/spree/admin/orders/bulk_management.html.haml +++ b/app/views/spree/admin/orders/bulk_management.html.haml @@ -1,10 +1,13 @@ +- content_for :app_wrapper_attrs do + = "ng-app='admin.lineItems'" + - content_for :page_title do %h1.page-title Bulk Order Management - %a.with-tip{ 'data-powertip' => "Use this page to alter product quantities across multiple orders. Products may also be removed from orders entirely, if required." } What's this? + %a{ 'ofn-with-tip' => "Use this page to alter product quantities across multiple orders. Products may also be removed from orders entirely, if required." } What's this? = render :partial => 'spree/admin/shared/order_sub_menu' -%div{ ng: { app: 'admin.lineItems', controller: 'LineItemsCtrl' } } +%div{ ng: { controller: 'LineItemsCtrl' } } %save-bar{ save: "submit()", form: "bulk_order_form" } .filters{ :class => "sixteen columns alpha" } .date_filter{ :class => "two columns alpha" } diff --git a/app/views/spree/admin/products/bulk_edit/_products_variant.html.haml b/app/views/spree/admin/products/bulk_edit/_products_variant.html.haml index ff345cb259..fb68704b79 100644 --- a/app/views/spree/admin/products/bulk_edit/_products_variant.html.haml +++ b/app/views/spree/admin/products/bulk_edit/_products_variant.html.haml @@ -25,6 +25,6 @@ %td.actions %a{ 'ng-click' => 'editWarn(product,variant)', :class => "edit-variant icon-edit no-text", 'ng-show' => "variantSaved(variant)" } %td.actions - %span.icon-warning-sign.with-tip{ 'ng-if' => 'variant.variant_overrides', title: "This variant has {{variant.variant_overrides.length}} override(s)" } + %span.icon-warning-sign{ 'ng-if' => 'variant.variant_overrides', 'ofn-with-tip' => "This variant has {{variant.variant_overrides.length}} override(s)" } %td.actions %a{ 'ng-click' => 'deleteVariant(product,variant)', "ng-class" => '{disabled: product.variants.length < 2}', :class => "delete-variant icon-trash no-text" }