mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Merge branch 'ent_types_frontend' of github.com:openfoodfoundation/openfoodnetwork into ent_types_frontend
Conflicts: app/views/home/_skinny.html.haml
This commit is contained in:
@@ -30,11 +30,12 @@ class Api::CachedEnterpriseSerializer < ActiveModel::Serializer
|
||||
cached
|
||||
delegate :cache_key, to: :object
|
||||
|
||||
attributes :name, :id, :description, :latitude, :longitude,
|
||||
:long_description, :website, :instagram, :linkedin, :twitter,
|
||||
attributes :name, :id, :description, :latitude, :longitude,
|
||||
:long_description, :website, :instagram, :linkedin, :twitter,
|
||||
:facebook, :is_primary_producer, :is_distributor, :phone, :visible,
|
||||
:email, :hash, :logo, :promo_image, :icon, :path,
|
||||
:pickup, :delivery
|
||||
attributes :has_shopfront, :can_aggregate
|
||||
|
||||
has_many :distributed_taxons, key: :taxons, serializer: Api::IdSerializer
|
||||
has_many :supplied_taxons, serializer: Api::IdSerializer
|
||||
@@ -77,6 +78,16 @@ class Api::CachedEnterpriseSerializer < ActiveModel::Serializer
|
||||
end
|
||||
end
|
||||
|
||||
# TODO: Remove this when flags on enterprises are switched over
|
||||
def has_shopfront
|
||||
object.type != 'profile'
|
||||
end
|
||||
|
||||
# TODO: Remove this when flags on enterprises are switched over
|
||||
def can_aggregate
|
||||
object.is_distributor && !object.is_primary_producer
|
||||
end
|
||||
|
||||
# TODO when ActiveSerializers supports URL helpers
|
||||
# Then refactor. See readme https://github.com/rails-api/active_model_serializers
|
||||
def path
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
.row.active_table_row{"ng-click" => "toggle()", "ng-class" => "{'closed' : !open()}", bindonce: true}
|
||||
.columns.small-12.medium-6.large-5.skinny-head
|
||||
%a.hub{"bo-href" => "hub.path", "ng-class" => "{primary: hub.active, secondary: !hub.active}", "ofn-empties-cart" => "hub"}
|
||||
%i.ofn-i_063-hub
|
||||
%i{ ng: { class: "{'ofn-i_063-hub': hub.can_aggregate, 'ofn-i_059-producer': !hub.can_aggregate}" } }
|
||||
/ %i.ofn-i_063-hub
|
||||
%span.hub-name-listing {{ hub.name | truncate:40}}
|
||||
.columns.small-4.medium-2.large-2
|
||||
{{ hub.address.city }}
|
||||
|
||||
Reference in New Issue
Block a user