129 Commits

Author SHA1 Message Date
David Rodríguez
e2b6199f26 Fix duplicate keys warnings in some views
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
```
2025-10-14 07:58:32 +02:00
David Cook
5a1190cdda Remove superfluous %div from haml elements with class
Div is the default element in HAML, so we don't need to specify it. https://haml.info/docs/yardoc/file.REFERENCE.html#implicit-div-elements
2025-03-03 14:46:24 +01:00
Neal Chambers
b1e40ed605 Fix Rails/HelperInstanceVariable 2023-09-06 22:36:46 +09:00
Maikel Linke
4facab0335 Guard against invariable file types
Australian production had one JPG image which was not recognised as
such. The `content_type` was missing and trying to generate a URL for a
variant raised an error and crashed the page.

Testing for `variable?` includes testing for `attached?` and is more
defensive.
2022-06-01 17:16:55 +10:00
Maikel Linke
45995ac984 Replace Paperclip on EnterpriseGroup 2022-06-01 17:16:55 +10:00
Yasuhiro Yoshida
ace8c8768f Remove ng-if to filter out invisible enterprises from group 2021-10-01 15:21:13 +03:00
Yasuhiro Yoshida
8090945c34 Change visibilities of hubs on group page
Issue:
https://github.com/openfoodfoundation/openfoodnetwork/issues/5106

Hubs on group page for consumers are displayed unconditionally.
But they should only appear under the following conditions: Visible.

In addition, those that are active should only be filled with red color
when they have open order cycles.

This commit apply these rules and changes the visibility of each hub on
"Our Hubs" tab of group page for consumers accordingly.
2021-09-17 17:12:08 +03:00
Matt-Yorkley
744bd9d1be Only load Google Maps JS where it's actually needed 2021-08-16 15:31:00 +01:00
Matt-Yorkley
a98e4417c0 Only inject taxons and properties AMS data in pages where it's actually needed 2021-08-16 13:22:06 +01:00
Matt-Yorkley
b441ac2644 Update paths to "noimage" images 2020-06-29 20:07:08 +02:00
Matt-Yorkley
add38bf550 Use #image_path helper correctly
Paths should be relative. For example an image under `/app/assets/images/home/banner.jpg` should be: `image_path("home/banner.jpg")`
2020-06-16 18:25:13 +02:00
Cillian O'Ruanaidh
deafe32354 Add support for using Open Street Map on the Map and Group pages.
The map is displayed using https://leafletjs.com/

To enable Open Street Map go to the Admin -> Configuration -> Content section and click 'Open Street Map Enabled'.

The 'Open Street Map Provider Name' setting can be used to configure different tile providers thanks to the Leaflet-providers extension (https://github.com/leaflet-extras/leaflet-providers)

Some tile providers require an API key, this can provided in JSON format e.g. '{ apiKey: 123 }' in the 'Open Street Map Provider Options' setting.

Each tile provider has their own usage policy so this should be checked before enabling Open Street Map.

The search field for the Open Street Map works differently than searching on Google Maps. It matches producers by their name or address because it was easier to implement instead of matching place names all over the world.
2020-05-31 18:42:55 +02:00
Matt-Yorkley
a3660dfe37 Extract repeated map code to new partial 2020-05-25 14:04:11 +02:00
Matt-Yorkley
e03005ed56 Fix maps and tidy up groups map code 2020-05-25 13:52:56 +02:00
Matt-Yorkley
3df2d4721b Fix search bar in /shops and /groups 2020-05-19 14:00:20 +02:00
Robin Klaus
438c0ecde9 delete extra lines 2020-05-16 20:12:54 +10:00
Robin Klaus
ba8ecf19ac Added input code to two additional pages to cover shop tab search boxes 2020-05-16 12:56:06 +10:00
Matt-Yorkley
40f8cf660c Update vendor/assets/angular-google-maps.min.js
Fixes an issue where if the js library from maps.googleapis.com failed to load in the <head>, all of our subsequent Angular would completely break.
See: https://github.com/angular-ui/angular-google-maps
Note: `bluebird.js` is a new dependency of `angular-google-maps.js`.
2020-04-02 13:32:55 +02:00
Matt-Yorkley
6219b3f0c3 Revert "Revert "Fix JS render-blocking in Darkswarm""
This reverts commit ffeca41e
2019-07-10 17:14:08 +01:00
Maikel
ffeca41ef4 Revert "Fix JS render-blocking in Darkswarm" 2019-07-10 10:24:25 +10:00
Matt-Yorkley
fbb97c3db8 Fix JS render-blocking in Darkswarm 2019-07-02 13:43:20 +01:00
Matt-Yorkley
874fb884b8 Refactor Angular controllers further 2019-06-12 09:47:01 +01:00
Matt-Yorkley
11e83af0b6 Remove duplication of enterprise angular controllers
We can re-use the enterprise and producers controllers here in their respective groups tabs, no need for a third controller
2019-06-12 09:47:01 +01:00
Matt-Yorkley
d5bd058754 Fix groups show page
It can definitely be cleaned up more in the future, but this should get us around a 90% reduction in page load times.
2019-06-12 09:47:01 +01:00
Matt-Yorkley
4ec46c2db6 Fix groups index page 2019-06-12 09:47:01 +01:00
Matt-Yorkley
ae8f1a92e8 Remove "profiles" from /shops 2019-06-12 09:47:01 +01:00
Keir Osborn
bd7e072938 embedded groups layout changes 2018-06-22 14:03:00 +10:00
Rohan Mitchell
f4f38b4183 Re-apply shop property filters - including performance regression
This reverts commit 7d149ed198.
2016-11-25 14:14:42 +11:00
Rohan Mitchell
d9d3a4a645 Set up producer filters on group producers page 2016-07-29 11:01:52 +10:00
Rohan Mitchell
f586dbc3e1 Extract OSM tile setup to own directive 2016-07-06 10:44:19 +10:00
Rob Harrington
93a4f19b40 Hash Navigation works on with Group and Shopping page tabs 2016-05-25 08:10:20 +10:00
Rob Harrington
e5ca494db8 Replacing bindonce with native Angularjs syntax in Darkswarm
Involved changing bo-text -> ng-bind, bo-href-i -> ng-href, bo-src-i -> ng-src and ng-html -> ng-bind-html
2016-05-25 08:10:20 +10:00
Bing Xie
ba2d5548ff Fix groups map view 2016-05-13 15:44:34 +10:00
Maikel Linke
eef62d4128 fix hub filter style 2016-02-04 16:34:03 +11:00
Maikel Linke
f5ff5bd5b0 Merge remote-tracking branch 'origin/master' into groups 2016-02-04 16:12:57 +11:00
Maikel Linke
bd19bf5f3c Refactoring filter selectors
The FilterSelectorsService is now able to create multiple independent
lists of selectors. These lists are explicitly given to the
filter-selector directive.

For example a group's page has one set for the group's producers and one
set for the group's shops.
2016-02-04 16:08:19 +11:00
Maikel Linke
d562f6537e Cleaner opengraph meta tags 2016-01-20 15:42:01 +11:00
Maikel Linke
8c1a16b371 groups blurb text 2016-01-20 14:00:46 +11:00
Maikel Linke
ea796d4f94 Taxon filter for group hubs 2016-01-20 13:32:08 +11:00
Maikel Linke
d5aea1b00d Taxon filter for group producers 2016-01-20 13:32:08 +11:00
ludivinecp
a611e73bed Opengraph facebook: images and description for shops and groups and home => ok 2016-01-15 14:03:33 +11:00
Maikel Linke
cd7721a127 Using date and time of current timezone
Using Time.zone.now and Date.current instead of Time.now and Date.today.
This should make all specs timezone independent.
2015-12-10 11:38:41 +11:00
Maikel Linke
6c1619ba60 i18n more content 2015-10-22 11:03:35 +11:00
Maikel Linke
85c99102dd i18n: Replacing all language strings in app/view/
Languages strings were moved to config/locale/en.yml. All views contain
according calls to t() now.
2015-08-28 16:59:23 +10:00
Rohan Mitchell
bd83dde89d Content manage group signup page 2015-07-17 16:06:49 +10:00
Rohan Mitchell
918889a572 Make subject more friendly for groups enquiry email 2015-06-26 15:54:26 +10:00
Rohan Mitchell
ce46cb0956 Add subject to group enquiries 2015-06-26 15:54:25 +10:00
Rohan Mitchell
02d68c662b Add titles to all darkswarm pages 2015-06-16 15:31:35 +10:00
Rohan Mitchell
610a4c03fe Merge branch 'master' into redesign
Conflicts:
	app/controllers/home_controller.rb
	app/views/producers/index.html.haml
	app/views/shared/menu/_mobile_menu.html.haml
	app/views/shop/products/_form.html.haml
	config/routes.rb
	spec/controllers/shops_controller_spec.rb
2015-06-10 18:27:50 +10:00
Rohan Mitchell
22230294ab Merge branch 'master' into optimise-shopfront 2015-06-03 10:07:42 +10:00