mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-26 20:56:48 +00:00
We're passing the `id` key twice, and with different value, resulting in
warnings like:
> /path/to/app/views/producers/index.html.haml:27: warning: key :id is duplicated and overwritten on line 31
Use only the latest value passed to remove the warning.
##### Before
```
$ bundle exec rspec -e "displays in an iframe" -e "logging in with a redirect set"
(...)
Run options: include {:full_description=>/(?-mix:displays\ in\ an\ iframe)|(?-mix:logging\ in\ with\ a\ redirect\ set)/}
Capybara starting Puma...
* Version 6.5.0, codename: Sky's Version
* Min threads: 0, max threads: 4
* Listening on http://127.0.0.1:50292
/path/to/app/views/producers/index.html.haml:27: warning: key :id is duplicated and overwritten on line 31
./path/to/app/views/groups/show.html.haml:68: warning: key :id is duplicated and overwritten on line 72
Modal window with text `Unable to load map. Please check your browser settings and allow 3rd party cookies for this website.` has been opened, but you didn't wrap your code into (`accept_prompt` | `dismiss_prompt` | `accept_confirm` | `dismiss_confirm` | `accept_alert`), accepting by default
.
Finished in 4.54 seconds (files took 4.04 seconds to load)
2 examples, 0 failures
```
##### After
```
$ bundle exec rspec -e "displays in an iframe" -e "logging in with a redirect set"
(...)
Run options: include {:full_description=>/(?-mix:displays\ in\ an\ iframe)|(?-mix:logging\ in\ with\ a\ redirect\ set)/}
Capybara starting Puma...
* Version 6.5.0, codename: Sky's Version
* Min threads: 0, max threads: 4
* Listening on http://127.0.0.1:50256
.Modal window with text `Unable to load map. Please check your browser settings and allow 3rd party cookies for this website.` has been opened, but you didn't wrap your code into (`accept_prompt` | `dismiss_prompt` | `accept_confirm` | `dismiss_confirm` | `accept_alert`), accepting by default
.
Finished in 4.17 seconds (files took 4.1 seconds to load)
2 examples, 0 failures
```
129 lines
5.3 KiB
Plaintext
129 lines
5.3 KiB
Plaintext
- content_for(:title) do
|
|
= @group.name
|
|
- content_for(:description) do
|
|
= @group.description
|
|
- content_for(:image) do
|
|
= url_for(@group.logo) if @group.logo.attached?
|
|
|
|
- content_for :scripts do
|
|
= render partial: "shared/google_maps_js"
|
|
|
|
- content_for :injection_data do
|
|
= inject_available_countries
|
|
= inject_group_enterprises(@group)
|
|
= inject_open_street_map_config
|
|
- cache(*CacheService::FragmentCaching.ams_all_taxons) do
|
|
= inject_taxons
|
|
- cache(*CacheService::FragmentCaching.ams_all_properties) do
|
|
= inject_properties
|
|
|
|
#group-page.row.pad-top.footer-pad{"ng-controller" => "GroupPageCtrl"}
|
|
.small-12.columns.pad-top
|
|
%header
|
|
.row
|
|
.small-12.columns
|
|
= image_tag @group.promo_image.variant(resize_to_limit: [1200, 260]) if @group.promo_image.variable?
|
|
.row
|
|
.small-12.columns.group-header.pad-top
|
|
- if @group.logo.variable?
|
|
= image_tag @group.logo.variant(resize_to_limit: [100, 100]), class: "group-logo"
|
|
- else
|
|
= image_tag "/noimage/group.png", class: "group-logo"
|
|
%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\')"}
|
|
%div{"ng-if" => "(isActive(\'/map\') && (mapShowed = true)) || mapShowed"}
|
|
= render partial: "shared/map"
|
|
|
|
%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{
|
|
"ng-repeat" => "producer in filteredEnterprises = (Enterprises.producers | searchEnterprises:query | taxons:activeTaxons | properties:activeProperties:'supplied_properties')",
|
|
"ng-controller" => "ProducerNodeCtrl",
|
|
"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: "Enterprises.hubs", property_filters: "| searchEnterprises:query | taxons:activeTaxons | shipping:shippingTypes"
|
|
|
|
.row
|
|
.small-12.columns
|
|
.active_table
|
|
%hub.active_table_node.row.animate-repeat{id: "{{hub.hash}}",
|
|
"ng-repeat" => "hub in filteredEnterprises = (Enterprises.hubs | searchEnterprises:query | taxons:activeTaxons | shipping:shippingTypes | properties:activeProperties:'distributed_properties' | orderBy:['+orders_close_at'])",
|
|
"ng-class" => "{'is_profile' : hub.category == 'hub_profile', 'closed' : !open(), 'open' : open(), 'inactive' : !hub.active, 'current' : current()}",
|
|
"ng-controller" => "HubNodeCtrl"}
|
|
.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"
|