Files
openfoodnetwork/app/views/groups/show.html.haml
2018-06-22 14:03:00 +10:00

130 lines
5.5 KiB
Plaintext

- content_for(:title) do
= @group.name
- content_for(:description) do
= @group.description
- content_for(:image) do
= @group.logo.url
-# inject all enterprises as "enterprises"
-# it could be more efficient to inject only the enterprises that are related to the group
= inject_enterprises
-# inject enterprises in this group
-# further hubs and producers of these enterprises can't be resolved within this small subset
= inject_group_enterprises
#group-page.row.pad-top.footer-pad{"ng-controller" => "GroupPageCtrl"}
.small-12.columns.pad-top
%header
.row
.small-12.columns
- if @group.promo_image.present?
%img{"src" => @group.promo_image}
.row
.small-12.columns.group-header.pad-top
- if @group.logo.present?
%img.group-logo{"src" => @group.logo}
- else
%img.group-logo{"src" => '/assets/noimage/group.png'}
%h2.group-name= @group.name
%p= @group.description
.small-12.columns.pad-top
.row
.small-12.medium-12.large-9.embedded-fullwidth.columns
%div{"ng-controller" => "GroupTabsCtrl"}
%tabset
%tab{heading: t(:label_map),
active: "tabs.map.active",
select: "select(\'map\')"}
.map-container
%map{"ng-if" => "(isActive(\'/map\') && (mapShowed = true)) || mapShowed"}
%google-map{options: "map.additional_options", center: "map.center", zoom: "map.zoom", styles: "map.styles", draggable: "true"}
%map-osm-tiles
%map-search
%markers{models: "mapMarkers", fit: "true",
coords: "'self'", icon: "'icon'", click: "'reveal'"}
%tab{heading: t(:groups_about),
active: "tabs.about.active",
select: "select(\'about\')"}
.about{ "embedded_target_blank" => true }
%h1
= t :groups_about
%p!= @group.long_description
%tab{heading: t(:groups_producers),
active: "tabs.producers.active",
select: "select(\'producers\')"}
.producers{"ng-controller" => "GroupEnterprisesCtrl"}
.row
.small-12.columns
%h1
= t :groups_producers
= render "shared/components/enterprise_search"
= render "producers/filters"
.row
.small-12.columns
.active_table
%producer.active_table_node.row.animate-repeat{id: "{{producer.path}}",
"ng-repeat" => "producer in filteredEnterprises = (group_producers | searchEnterprises:query | taxons:activeTaxons | properties:activeProperties:'supplied_properties')",
"ng-controller" => "GroupEnterpriseNodeCtrl",
"ng-class" => "{'closed' : !open(), 'open' : open(), 'inactive' : !producer.active}",
id: "{{producer.hash}}"}
.small-12.columns
= render "producers/skinny"
= render "producers/fat"
= render 'shared/components/enterprise_no_results'
%tab{heading: t(:groups_hubs),
active: "tabs.hubs.active",
select: "select(\'hubs\')"}
.hubs{"ng-controller" => "GroupEnterprisesCtrl"}
.row
.small-12.columns
%h1
= t :groups_hubs
= render "shared/components/enterprise_search"
= render "shops/filters", resource: "group_hubs", property_filters: "| searchEnterprises:query | taxons:activeTaxons | shipping:shippingTypes | showHubProfiles:show_profiles"
.row
.small-12.columns
.active_table
%hub.active_table_node.row.animate-repeat{id: "{{hub.hash}}",
"ng-repeat" => "hub in filteredEnterprises = (group_hubs | searchEnterprises:query | taxons:activeTaxons | shipping:shippingTypes | showHubProfiles:show_profiles | properties:activeProperties:'distributed_properties' | orderBy:['-active', '+orders_close_at'])",
"ng-class" => "{'is_profile' : hub.category == 'hub_profile', 'closed' : !open(), 'open' : open(), 'inactive' : !hub.active, 'current' : current()}",
"ng-controller" => "GroupEnterpriseNodeCtrl"}
.small-12.columns
= render 'shops/skinny'
= render 'shops/fat'
= render 'shared/components/enterprise_no_results'
.small-12.medium-12.large-3.columns.contact
= render 'contact'
.small-12.columns.pad-top
.row.pad-top
.small-12.columns.text-center.small
%hr
%p.text-small
= "Copyright #{Date.current.year} #{@group.name}"
%h2
=link_to_service "https://www.facebook.com/", @group.facebook, title: t(:groups_contact_facebook) do
%i.ofn-i_044-facebook
=link_to_service "", @group.email.reverse, title: t(:groups_contact_email), mailto: true do
%i.ofn-i_050-mail-circle
=link_to_service "http://", @group.website, title: t(:groups_contact_website) do
%i.ofn-i_049-web
.powered-by-embedded
%img{src: '/favicon.ico'}
%span
= t 'powered_by'
%span
= t 'title'
= render "shared/footer"