From b4976a5445d2dba0c89ccfba615ec88514e470f3 Mon Sep 17 00:00:00 2001 From: Rohan Mitchell Date: Fri, 12 Feb 2016 07:28:17 +1100 Subject: [PATCH] Replace with-tip with ofn-with-tip: enterprise forms --- app/assets/javascripts/admin/users/users.js.coffee | 2 +- app/views/admin/enterprises/_actions.html.haml | 6 +++--- app/views/admin/enterprises/_admin_index.html.haml | 2 +- app/views/admin/enterprises/_new_form.html.haml | 8 ++++---- app/views/admin/enterprises/form/_images.html.haml | 4 ++-- .../enterprises/form/_primary_details.html.haml | 12 ++++++------ app/views/admin/enterprises/form/_users.html.haml | 4 ++-- app/views/admin/enterprises/new.html.haml | 2 +- 8 files changed, 20 insertions(+), 20 deletions(-) diff --git a/app/assets/javascripts/admin/users/users.js.coffee b/app/assets/javascripts/admin/users/users.js.coffee index 6bfd47a894..a86a90a56c 100644 --- a/app/assets/javascripts/admin/users/users.js.coffee +++ b/app/assets/javascripts/admin/users/users.js.coffee @@ -1 +1 @@ -angular.module("admin.users", []) \ No newline at end of file +angular.module("admin.users", ['admin.utils']) \ No newline at end of file diff --git a/app/views/admin/enterprises/_actions.html.haml b/app/views/admin/enterprises/_actions.html.haml index ec29607747..5bcfc7a512 100644 --- a/app/views/admin/enterprises/_actions.html.haml +++ b/app/views/admin/enterprises/_actions.html.haml @@ -15,18 +15,18 @@ = link_to_with_icon 'icon-chevron-right', 'Payment Methods', spree.admin_payment_methods_path(enterprise_id: enterprise.id) (#{enterprise.payment_methods.count}) - if enterprise.payment_methods.count == 0 - %span.icon-exclamation-sign.with-tip{"data-powertip" => "This enterprise has no payment methods", style: "font-size: 16px;color: #DA5354"} + %span.icon-exclamation-sign{"ofn-with-tip" => "This enterprise has no payment methods", style: "font-size: 16px;color: #DA5354"} %br/ - if can?(:admin, Spree::ShippingMethod) && can?(:manage_shipping_methods, enterprise) = link_to_with_icon 'icon-plane', 'Shipping Methods', spree.admin_shipping_methods_path(enterprise_id: enterprise.id) (#{enterprise.shipping_methods.count}) - if enterprise.shipping_methods.count == 0 - %span.icon-exclamation-sign.with-tip{"data-powertip" => "This enterprise has shipping methods", style: "font-size: 16px;color: #DA5354"} + %span.icon-exclamation-sign{"ofn-with-tip" => "This enterprise has shipping methods", style: "font-size: 16px;color: #DA5354"} %br/ - if can?(:admin, EnterpriseFee) && can?(:manage_enterprise_fees, enterprise) = link_to_with_icon 'icon-money', 'Enterprise Fees', main_app.admin_enterprise_fees_path(enterprise_id: enterprise.id) (#{enterprise.enterprise_fees.count}) - if enterprise.enterprise_fees.count == 0 - %span.icon-warning-sign.with-tip{"data-powertip" => "This enterprise has no fees", style: "font-size: 16px;color: orange"} + %span.icon-warning-sign{"ofn-with-tip" => "This enterprise has no fees", style: "font-size: 16px;color: orange"} diff --git a/app/views/admin/enterprises/_admin_index.html.haml b/app/views/admin/enterprises/_admin_index.html.haml index 68c74a783c..2359f45f78 100644 --- a/app/views/admin/enterprises/_admin_index.html.haml +++ b/app/views/admin/enterprises/_admin_index.html.haml @@ -2,7 +2,7 @@ - if flash[:action] %p= flash[:action] -= form_for @enterprise_set, url: main_app.bulk_update_admin_enterprises_path do |f| += form_for @enterprise_set, url: main_app.bulk_update_admin_enterprises_path, html: {"ng-app" => "admin.enterprises"} do |f| %table#listing_enterprises.index %colgroup %col{style: "width: 25%;"}/ diff --git a/app/views/admin/enterprises/_new_form.html.haml b/app/views/admin/enterprises/_new_form.html.haml index a76c8ec31c..3ab9392712 100644 --- a/app/views/admin/enterprises/_new_form.html.haml +++ b/app/views/admin/enterprises/_new_form.html.haml @@ -5,10 +5,10 @@ = f.text_field :name, { placeholder: "eg. Professor Plum's Biodynamic Truffles", class: "fullwidth" } - if spree_current_user.admin? - .row{ ng: { app: "admin.users" } } + .row .three.columns.alpha =f.label :owner_id, 'Owner' - .with-tip{'data-powertip' => "The primary user responsible for this enterprise."} + %div{'ofn-with-tip' => "The primary user responsible for this enterprise."} %a What's this? .nine.columns.omega - owner_email = @enterprise.andand.owner.andand.email || "" @@ -16,7 +16,7 @@ .row .three.columns.alpha %label Primary Producer? - .with-tip{'data-powertip' => "Select 'Producer' if you are a primary producer of food."} + %div{'ofn-with-tip' => "Select 'Producer' if you are a primary producer of food."} %a What's this? .five.columns.omega = f.check_box :is_primary_producer, 'ng-model' => 'Enterprise.is_primary_producer' @@ -27,7 +27,7 @@ .alpha.eleven.columns .three.columns.alpha = f.label :sells, 'Sells' - .with-tip{'data-powertip' => "None - enterprise does not sell to customers directly.
Own - Enterprise sells own products to customers.
Any - Enterprise can sell own or other enterprises products.
"} + %div{'ofn-with-tip' => "None - enterprise does not sell to customers directly.
Own - Enterprise sells own products to customers.
Any - Enterprise can sell own or other enterprises products.
"} %a What's this? .two.columns = f.radio_button :sells, "none", 'ng-model' => 'Enterprise.sells' diff --git a/app/views/admin/enterprises/form/_images.html.haml b/app/views/admin/enterprises/form/_images.html.haml index ac960ccc1e..c03be2caa3 100644 --- a/app/views/admin/enterprises/form/_images.html.haml +++ b/app/views/admin/enterprises/form/_images.html.haml @@ -8,7 +8,7 @@ = f.file_field :logo .row .alpha.three.columns - = f.label :promo_image, class: 'with-tip', 'data-powertip' => 'This image is displayed in "About Us"' + = f.label :promo_image, 'ofn-with-tip' => 'This image is displayed in "About Us"' %br/ %span{ style: 'font-weight:bold' } PLEASE NOTE: Any promo image uploaded here will be cropped to 1200 x 260. @@ -16,4 +16,4 @@ .omega.eight.columns = image_tag @object.promo_image(:large) if @object.promo_image.present? - = f.file_field :promo_image \ No newline at end of file + = f.file_field :promo_image diff --git a/app/views/admin/enterprises/form/_primary_details.html.haml b/app/views/admin/enterprises/form/_primary_details.html.haml index 96f4674912..437a61e866 100644 --- a/app/views/admin/enterprises/form/_primary_details.html.haml +++ b/app/views/admin/enterprises/form/_primary_details.html.haml @@ -10,7 +10,7 @@ .alpha.eleven.columns .three.columns.alpha = f.label :group_ids, 'Groups' - .with-tip{'data-powertip' => "Select any groups or regions that you are a member of. This will help customers find your enterprise."} + %div{'ofn-with-tip' => "Select any groups or regions that you are a member of. This will help customers find your enterprise."} %a What's this? .eight.columns.omega = f.collection_select :group_ids, @groups, :id, :name, {}, class: "select2 fullwidth", multiple: true, placeholder: "Start typing to search available groups..." @@ -18,7 +18,7 @@ .row .three.columns.alpha %label Primary Producer - .with-tip{'data-powertip' => "Select 'Producer' if you are a primary producer of food."} + %div{'ofn-with-tip' => "Select 'Producer' if you are a primary producer of food."} %a What's this? .five.columns.omega = f.check_box :is_primary_producer, 'ng-model' => 'Enterprise.is_primary_producer' @@ -29,7 +29,7 @@ .alpha.eleven.columns .three.columns.alpha = f.label :sells, 'Sells' - .with-tip{'data-powertip' => "None - enterprise does not sell to customers directly.
Own - Enterprise sells own products to customers.
Any - Enterprise can sell own or other enterprises products.
"} + %div{'ofn-with-tip' => "None - enterprise does not sell to customers directly.
Own - Enterprise sells own products to customers.
Any - Enterprise can sell own or other enterprises products.
"} %a What's this? .two.columns = f.radio_button :sells, "none", 'ng-model' => 'Enterprise.sells' @@ -46,7 +46,7 @@ .row .three.columns.alpha %label Visible in search? - .with-tip{'data-powertip' => "Determines whether this enterprise will be visible to customers when searching the site."} + %div{'ofn-with-tip' => "Determines whether this enterprise will be visible to customers when searching the site."} %a What's this? .two.columns = f.radio_button :visible, true @@ -60,7 +60,7 @@ .row{ ng: { show: "Enterprise.sells == 'own' || Enterprise.sells == 'any'" } } .three.columns.alpha = f.label :permalink, 'Permalink (no spaces)' - .with-tip{'data-powertip' => "This permalink is used to create the url to your shop: #{spree.root_url}your-shop-name/shop"} + %div{'ofn-with-tip' => "This permalink is used to create the url to your shop: #{spree.root_url}your-shop-name/shop"} %a What's this? .six.columns = f.text_field :permalink, { 'ng-model' => "Enterprise.permalink", placeholder: "eg. your-shop-name", 'ng-model-options' => "{ updateOn: 'default blur', debounce: {'default': 300, 'blur': 0} }" } @@ -72,7 +72,7 @@ .row{ ng: { show: "Enterprise.sells == 'own' || Enterprise.sells == 'any'" } } .three.columns.alpha %label Link to shop front - .with-tip{'data-powertip' => "A direct link to your shopfront on the Open Food Network."} + %div{'ofn-with-tip' => "A direct link to your shopfront on the Open Food Network."} %a What's this? .eight.columns.omega = surround spree.root_url, "/shop" do diff --git a/app/views/admin/enterprises/form/_users.html.haml b/app/views/admin/enterprises/form/_users.html.haml index d13723795d..289a85d7a1 100644 --- a/app/views/admin/enterprises/form/_users.html.haml +++ b/app/views/admin/enterprises/form/_users.html.haml @@ -6,7 +6,7 @@ =f.label :owner_id, 'Owner' - if full_permissions %span.required * - .with-tip{'data-powertip' => "The primary user responsible for this enterprise."} + %div{'ofn-with-tip' => "The primary user responsible for this enterprise."} %a What's this? .eight.columns.omega - if full_permissions @@ -19,7 +19,7 @@ =f.label :user_ids, 'Managers' - if full_permissions %span.required * - .with-tip{'data-powertip' => "The other users with permission to manage this enterprise."} + %div{'ofn-with-tip' => "The other users with permission to manage this enterprise."} %a What's this? .eight.columns.omega - if full_permissions diff --git a/app/views/admin/enterprises/new.html.haml b/app/views/admin/enterprises/new.html.haml index 8f21067941..4413acfc2c 100644 --- a/app/views/admin/enterprises/new.html.haml +++ b/app/views/admin/enterprises/new.html.haml @@ -11,5 +11,5 @@ = form_for [main_app, :admin, @enterprise], html: { "nav-check" => '', "nav-callback" => '' } do |f| .row - .twelve.columns.fullwidth_inputs + .twelve.columns.fullwidth_inputs{ ng: { app: "admin.users" } } = render 'new_form', f: f