mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Replacing bindonce with native Angularjs syntax in admin
This commit is contained in:
@@ -45,7 +45,6 @@
|
||||
//= require ./variant_overrides/variant_overrides
|
||||
//= require textAngular.min.js
|
||||
//= require textAngular-sanitize.min.js
|
||||
//= require ../shared/bindonce.min.js
|
||||
//= require darkswarm/i18n.js
|
||||
//= require darkswarm/i18n.translate.js
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
angular.module("admin.enterprises", [
|
||||
angular.module("admin.enterprises", [
|
||||
@@ -1 +1 @@
|
||||
angular.module("admin.variantOverrides", ["pasvaz.bindonce", "admin.indexUtils", "admin.utils", "admin.dropdown", "admin.inventoryItems"])
|
||||
angular.module("admin.variantOverrides", ["admin.indexUtils", "admin.utils", "admin.dropdown", "admin.inventoryItems"])
|
||||
|
||||
@@ -17,13 +17,13 @@
|
||||
%td.severity
|
||||
%i.icon-warning-sign.issue
|
||||
%td.description
|
||||
%span{ bo: { bind: "issue.description" } }
|
||||
%span{ ng: { bind: "::issue.description" } }
|
||||
%td.resolve
|
||||
%div{ ng: { bind: { html: "issue.link" } } }
|
||||
%tr{ ng: { repeat: "warning in warnings"} }
|
||||
%td.severity
|
||||
%i.icon-warning-sign.warning
|
||||
%td.description
|
||||
%span{ bo: { bind: "warning.description" } }
|
||||
%span{ ng: { bind: "::warning.description" } }
|
||||
%td.resolve
|
||||
%div{ ng: { bind: { html: "warning.link" } } }
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
%h1#no_results No enterprises found.
|
||||
|
||||
|
||||
.row{ ng: { show: "loaded && filteredEnterprises.length > 0" }, bindonce: true }
|
||||
.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' }}
|
||||
@@ -33,15 +33,15 @@
|
||||
%tbody{ :id => "e_{{enterprise.id}}", ng: { repeat: "enterprise in filteredEnterprises = ( allEnterprises | filter:{ name: quickSearch } )", controller: 'EnterpriseIndexRowCtrl' } }
|
||||
%tr.enterprise.panel-toggle-row{ object: "enterprise", ng: { class: { even: "'even'", odd: "'odd'"} } }
|
||||
%td.name{ ng: { show: 'columns.name.visible' } }
|
||||
%span{ bo: { bind: "enterprise.name" } }
|
||||
%span{ ng: { bind: "::enterprise.name" } }
|
||||
%td.producer.panel-toggle.text-center{ ng: { show: 'columns.producer.visible', class: "{error: producerError}" }, name: "producer" }
|
||||
%h5{ ng: { bind: "producer" } }
|
||||
%td.package.panel-toggle.text-center{ ng: { show: 'columns.package.visible', class: "{error: packageError}" }, name: "package" }
|
||||
%h5{ ng: { bind: "package" } }
|
||||
%td.status.panel-toggle.text-center{ ng: { show: 'columns.status.visible' }, name: "status" }
|
||||
%i.icon-status{ bo: { class: "status" } }
|
||||
%i.icon-status{ ng: { class: "::status()" } }
|
||||
%td.manage{ ng: { show: 'columns.manage.visible' } }
|
||||
%a.button.fullwidth{ bo: { href: 'enterprise.edit_path' } }
|
||||
%a.button.fullwidth{ ng: { href: '{{::enterprise.edit_path}}' } }
|
||||
Manage
|
||||
%i.icon-arrow-right
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
.eleven.columns.alpha.omega
|
||||
.no_tags{ ng: { show: "tagGroups.length == 0" } }
|
||||
No tags apply to this enterprise yet
|
||||
.customer_tag{ ng: { repeat: "tagGroup in tagGroups" }, bindonce: true }
|
||||
.customer_tag{ ng: { repeat: "tagGroup in tagGroups" } }
|
||||
.header
|
||||
%table
|
||||
%colgroup
|
||||
@@ -23,8 +23,8 @@
|
||||
%table
|
||||
%tr.tag_rule{ id: "tr_{{rule.id}}", ng: { repeat: "rule in tagGroup.rules" } }
|
||||
%td
|
||||
%discount-order{ bo: { if: "rule.type == 'TagRule::DiscountOrder'" } }
|
||||
%filter-shipping-methods{ bo: { if: "rule.type == 'TagRule::FilterShippingMethods'" } }
|
||||
%discount-order{ ng: { if: "::rule.type == 'TagRule::DiscountOrder'" } }
|
||||
%filter-shipping-methods{ ng: { if: "::rule.type == 'TagRule::FilterShippingMethods'" } }
|
||||
%td.actions
|
||||
%a{ ng: { click: "deleteTagRule(tagGroup, rule)" }, :class => "delete-tag-rule icon-trash no-text" }
|
||||
.add_rule.text-center
|
||||
|
||||
@@ -10,13 +10,13 @@
|
||||
%th.product=t('admin.product')
|
||||
%th.variant=t('(admin.variant')
|
||||
%th.add=t('admin.inventory.add')
|
||||
%tbody{ bindonce: true, ng: { repeat: 'product in filteredProducts | limitTo:productLimit' } }
|
||||
%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{ bo: { bind: 'producersByID[product.producer_id].name'} }
|
||||
%td.product{ bo: { bind: 'product.name'} }
|
||||
%td.producer{ ng: { bind: '::producersByID[product.producer_id].name'} }
|
||||
%td.product{ ng: { bind: '::product.name'} }
|
||||
%td.variant
|
||||
%span{ bo: { bind: 'variant.display_name || ""'} }
|
||||
.variant-override-unit{ bo: { 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)" } }
|
||||
= t('admin.inventory.add')
|
||||
|
||||
@@ -11,13 +11,13 @@
|
||||
%th.variant=t('(admin.variant')
|
||||
%th.add=t('admin.inventory.add')
|
||||
%th.hide=t('admin.inventory.hide')
|
||||
%tbody{ bindonce: true, ng: { repeat: 'product in filteredProducts | limitTo:productLimit' } }
|
||||
%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{ bo: { bind: 'producersByID[product.producer_id].name'} }
|
||||
%td.product{ bo: { bind: 'product.name'} }
|
||||
%td.producer{ ng: { bind: '::producersByID[product.producer_id].name'} }
|
||||
%td.product{ ng: { bind: '::product.name'} }
|
||||
%td.variant
|
||||
%span{ bo: { bind: 'variant.display_name || ""'} }
|
||||
.variant-override-unit{ bo: { 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)" } }
|
||||
= t('admin.inventory.add')
|
||||
|
||||
@@ -22,6 +22,6 @@
|
||||
%th.reset{ colspan: 2, ng: { show: 'columns.reset.visible' } }=t('admin.inventory.enable_reset')
|
||||
%th.inheritance{ ng: { show: 'columns.inheritance.visible' } }=t('admin.inventory.inherit')
|
||||
%th.visibility{ ng: { show: 'columns.visibility.visible' } }=t('admin.inventory.hide')
|
||||
%tbody{bindonce: true, ng: {repeat: 'product in filteredProducts = (products | hubPermissions:hubPermissions:hub_id | inventoryProducts:hub_id:views | attrFilter:{producer_id:producerFilter} | filter:query) | limitTo:productLimit' } }
|
||||
%tbody{ ng: {repeat: 'product in filteredProducts = (products | hubPermissions:hubPermissions:hub_id | inventoryProducts:hub_id:views | attrFilter:{producer_id:producerFilter} | filter:query) | limitTo:productLimit' } }
|
||||
= render 'admin/variant_overrides/products_product'
|
||||
= render 'admin/variant_overrides/products_variants'
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
%tr.product.even
|
||||
%td.producer{ ng: { show: 'columns.producer.visible' }, bo: { bind: 'producersByID[product.producer_id].name'} }
|
||||
%td.product{ ng: { show: 'columns.product.visible' }, bo: { bind: 'product.name'} }
|
||||
%td.producer{ ng: { show: 'columns.producer.visible' }, ng: { bind: '::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' } }
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
%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{ bo: { bind: 'variant.display_name || ""'} }
|
||||
.variant-override-unit{ bo: { bind: 'variant.unit_to_display'} }
|
||||
%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' } }
|
||||
|
||||
Reference in New Issue
Block a user