mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
producer icons and inital link logic
This commit is contained in:
@@ -34,7 +34,7 @@ class Api::UncachedEnterpriseSerializer < ActiveModel::Serializer
|
||||
|
||||
# TODO: Remove this when flags on enterprises are switched over
|
||||
def has_shopfront
|
||||
object.type != 'profile'
|
||||
object.is_distributor && object.type != 'profile'
|
||||
end
|
||||
|
||||
# Map svg icons.
|
||||
@@ -63,7 +63,7 @@ class Api::UncachedEnterpriseSerializer < ActiveModel::Serializer
|
||||
icon_fonts[object.enterprise_category]
|
||||
end
|
||||
|
||||
# Choose producser page icon font - yes, sadly its got to be different.
|
||||
# Choose producer page icon font - yes, sadly its got to be different.
|
||||
# This duplicates some code but covers the producer page edge case where
|
||||
# producer-hub has a producer icon without needing to duplicate the category logic in angular.
|
||||
def producer_icon_font
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
.row.active_table_row{"ng-click" => "toggle()", "ng-class" => "{'closed' : !open()}", bindonce: true}
|
||||
.row.active_table_row{"ng-click" => "toggle()", "ng-class" => "{'closed' : !open(), 'has_shopfront' : producer.has_shopfront}", 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{'ng-class'=> "hub.icon_font" }
|
||||
/ %i.ofn-i_063-hub
|
||||
%i{ng: {class: "hub.icon_font" }}
|
||||
%span.margin-top.hub-name-listing {{ hub.name | truncate:40}}
|
||||
.columns.small-4.medium-2.large-2
|
||||
%span.margin-top {{ hub.address.city }}
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
.row.active_table_row{"ng-click" => "toggle()", "ng-class" => "{'closed' : !open()}"}
|
||||
.row.active_table_row{"ng-click" => "toggle()", "ng-class" => "{'closed' : !open(), 'has_shopfront' : producer.has_shopfront}"}
|
||||
.columns.small-12.medium-4.large-4.skinny-head
|
||||
/ This needs logic to show profile only icon when available %i.ofn-i_060-producer-reversed
|
||||
%i.ofn-i_059-producer
|
||||
%i{ng: {class: "producer.producer_icon_font"}}
|
||||
%span.margin-top
|
||||
%strong {{ producer.name }}
|
||||
%strong
|
||||
%a{"bo-if" => "producer.has_shopfront" } {{ producer.path }}
|
||||
|
||||
.columns.small-6.medium-3.large-3
|
||||
%span.margin-top {{ producer.address.city }}
|
||||
.columns.small-4.medium-3.large-4
|
||||
|
||||
Reference in New Issue
Block a user