Replace with-tip with ofn-with-tip: enterprise forms

This commit is contained in:
Rohan Mitchell
2016-02-12 07:28:17 +11:00
parent e2722710de
commit b4976a5445
8 changed files with 20 additions and 20 deletions

View File

@@ -1 +1 @@
angular.module("admin.users", [])
angular.module("admin.users", ['admin.utils'])

View File

@@ -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"}

View File

@@ -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%;"}/

View File

@@ -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.<br />Own - Enterprise sells own products to customers.<br />Any - Enterprise can sell own or other enterprises products.<br />"}
%div{'ofn-with-tip' => "None - enterprise does not sell to customers directly.<br />Own - Enterprise sells own products to customers.<br />Any - Enterprise can sell own or other enterprises products.<br />"}
%a What's this?
.two.columns
= f.radio_button :sells, "none", 'ng-model' => 'Enterprise.sells'

View File

@@ -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
= f.file_field :promo_image

View File

@@ -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.<br />Own - Enterprise sells own products to customers.<br />Any - Enterprise can sell own or other enterprises products.<br />"}
%div{'ofn-with-tip' => "None - enterprise does not sell to customers directly.<br />Own - Enterprise sells own products to customers.<br />Any - Enterprise can sell own or other enterprises products.<br />"}
%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

View File

@@ -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

View File

@@ -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