mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Remove unused rabl files from views/json
This commit is contained in:
@@ -1,12 +0,0 @@
|
||||
object current_order
|
||||
attributes :id, :item_total
|
||||
|
||||
if current_order
|
||||
child line_items: :line_items do
|
||||
attributes :id, :variant_id, :quantity, :price
|
||||
end
|
||||
|
||||
node :cart_count do
|
||||
cart_count
|
||||
end
|
||||
end
|
||||
@@ -1,7 +0,0 @@
|
||||
# TODO: This should be moved into the controller
|
||||
# RABL is tricky to pass variables into: so we do this as a workaround for now
|
||||
# I noticed some vague comments on Rabl github about this, but haven't looked into
|
||||
collection Enterprise.visible
|
||||
extends 'json/partials/enterprise'
|
||||
extends 'json/partials/producer'
|
||||
extends 'json/partials/hub'
|
||||
@@ -1,18 +0,0 @@
|
||||
collection @groups
|
||||
attributes :id, :permalink, :name, :position, :description, :long_description, :email, :website, :facebook, :instagram, :linkedin, :twitter
|
||||
|
||||
child enterprises: :enterprises do
|
||||
attributes :id
|
||||
end
|
||||
|
||||
node :logo do |group|
|
||||
group.logo(:medium) if group.logo?
|
||||
end
|
||||
|
||||
node :promo_image do |group|
|
||||
group.promo_image(:large) if group.promo_image?
|
||||
end
|
||||
|
||||
node :state do |group|
|
||||
group.state.andand.abbr
|
||||
end
|
||||
@@ -1,3 +0,0 @@
|
||||
collection Enterprise.is_distributor.visible
|
||||
extends 'json/partials/enterprise'
|
||||
extends 'json/partials/hub'
|
||||
@@ -1,14 +0,0 @@
|
||||
attributes :id, :name, :description, :long_description, :website, :instagram, :facebook, :linkedin, :twitter
|
||||
|
||||
node :promo_image do |producer|
|
||||
producer.promo_image(:large)
|
||||
end
|
||||
node :logo do |producer|
|
||||
producer.logo(:medium)
|
||||
end
|
||||
|
||||
node :path do |producer|
|
||||
main_app.producer_path(producer)
|
||||
end
|
||||
|
||||
node :hash, &:to_param
|
||||
@@ -1,3 +0,0 @@
|
||||
collection Enterprise.is_primary_producer.visible
|
||||
extends 'json/partials/enterprise'
|
||||
extends 'json/partials/producer'
|
||||
@@ -1,4 +0,0 @@
|
||||
attributes :city, :zipcode, :phone
|
||||
node :state_name do |address|
|
||||
address.state.abbr
|
||||
end
|
||||
@@ -1,29 +0,0 @@
|
||||
attributes :name, :id, :description, :latitude, :longitude, :long_description, :website, :instagram, :linkedin, :twitter, :facebook, :is_primary_producer, :is_distributor, :phone
|
||||
|
||||
node :email_address do |enterprise|
|
||||
enterprise.email_address.to_s.reverse
|
||||
end
|
||||
|
||||
child :address do
|
||||
extends "json/partials/address"
|
||||
end
|
||||
|
||||
node :hash, &:to_param
|
||||
|
||||
node :logo do |enterprise|
|
||||
enterprise.logo(:medium) if enterprise.logo?
|
||||
end
|
||||
|
||||
node :promo_image do |enterprise|
|
||||
enterprise.promo_image(:large) if enterprise.promo_image?
|
||||
end
|
||||
|
||||
node :icon do |e|
|
||||
if e.is_primary_producer && e.is_distributor
|
||||
image_path "map_003-producer-shop.svg"
|
||||
elsif e.is_primary_producer
|
||||
image_path "map_001-producer-only.svg"
|
||||
else
|
||||
image_path "map_005-hub.svg"
|
||||
end
|
||||
end
|
||||
@@ -1,23 +0,0 @@
|
||||
child distributed_taxons: :taxons do
|
||||
extends "json/taxon"
|
||||
end
|
||||
child suppliers: :producers do
|
||||
attributes :id
|
||||
end
|
||||
node :path do |enterprise|
|
||||
main_app.enterprise_shop_path(enterprise)
|
||||
end
|
||||
node :pickup do |hub|
|
||||
hub.shipping_methods.where(require_ship_address: false).present?
|
||||
end
|
||||
node :delivery do |hub|
|
||||
hub.shipping_methods.where(require_ship_address: true).present?
|
||||
end
|
||||
if @active_distributors
|
||||
node :active do |hub|
|
||||
@active_distributors.include?(hub)
|
||||
end
|
||||
end
|
||||
node :orders_close_at do |hub|
|
||||
OrderCycle.first_closing_for(hub).andand.orders_close_at
|
||||
end
|
||||
@@ -1,10 +0,0 @@
|
||||
child distributors: :hubs do
|
||||
attributes :id
|
||||
end
|
||||
node :path do |producer|
|
||||
main_app.producer_path(producer)
|
||||
end
|
||||
|
||||
child supplied_taxons: :supplied_taxons do
|
||||
extends 'json/taxon'
|
||||
end
|
||||
Reference in New Issue
Block a user