Compare commits

...

131 Commits

Author SHA1 Message Date
Daniel O'Connor
f5a03b8991 Merge pull request #4161 from Growstuff/dependabot/bundler/rubocop-1.80.1
Bump rubocop from 1.80.0 to 1.80.1
2025-08-29 19:57:29 +09:30
Daniel O'Connor
d1d718df9e Add One click ask AI prompts for companion planting and growing guides (#4159)
* One click ask AI prompts

* One click ask AI prompts

* Update app/views/crops/show.html.haml
2025-08-29 19:54:38 +09:30
dependabot[bot]
da4bb17df8 Bump rubocop from 1.80.0 to 1.80.1
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.80.0 to 1.80.1.
- [Release notes](https://github.com/rubocop/rubocop/releases)
- [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop/compare/v1.80.0...v1.80.1)

---
updated-dependencies:
- dependency-name: rubocop
  dependency-version: 1.80.1
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-28 08:59:30 +00:00
dependabot[bot]
0320cbe5ad Bump chartkick from 5.1.5 to 5.2.0 (#4072)
Bumps [chartkick](https://github.com/ankane/chartkick) from 5.1.5 to 5.2.0.
- [Changelog](https://github.com/ankane/chartkick/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ankane/chartkick/compare/v5.1.5...v5.2.0)

---
updated-dependencies:
- dependency-name: chartkick
  dependency-version: 5.2.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Daniel O'Connor <daniel.oconnor@gmail.com>
2025-08-28 00:16:34 +09:30
google-labs-jules[bot]
4d3c4ca10d Merge pull request #4154 from Growstuff/finish-expired-seeds-task
Add maintenance task to finish expired seeds
2025-08-28 00:16:16 +09:30
Daniel O'Connor
749134a7de Remove Openfarm data fetching (#4157) 2025-08-28 00:15:03 +09:30
Daniel O'Connor
1657a527e9 Remove Openfarm data fetching 2025-08-27 14:20:22 +00:00
google-labs-jules[bot]
ba6ec689c5 Merge pull request #4150 from Growstuff/feature/failed-plantings
Add failed status to plantings
2025-08-27 23:42:53 +09:30
Daniel O'Connor
df2853edd3 Merge pull request #4153 from Growstuff/age_in_days
Fix age in days, percentage grown calculations for future dates
2025-08-27 23:31:48 +09:30
Daniel O'Connor
948bb78656 Fix percentage grown 2025-08-27 13:44:44 +00:00
Daniel O'Connor
9c8ae50188 Fix https://github.com/Growstuff/growstuff/issues/3844 by avoiding future finished dates being considered past dates 2025-08-27 13:36:12 +00:00
dependabot[bot]
0ee6260272 Merge pull request #4152 from Growstuff/dependabot/bundler/scout_apm-5.7.1 2025-08-26 23:30:40 +00:00
dependabot[bot]
bf528220ab Bump scout_apm from 5.7.0 to 5.7.1
Bumps [scout_apm](https://github.com/scoutapp/scout_apm_ruby) from 5.7.0 to 5.7.1.
- [Changelog](https://github.com/scoutapp/scout_apm_ruby/blob/master/CHANGELOG.markdown)
- [Commits](https://github.com/scoutapp/scout_apm_ruby/compare/v5.7.0...v5.7.1)

---
updated-dependencies:
- dependency-name: scout_apm
  dependency-version: 5.7.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-26 23:22:37 +00:00
dependabot[bot]
fd89cc6bce Merge pull request #4151 from Growstuff/dependabot/bundler/rubocop-1.80.0 2025-08-26 23:21:29 +00:00
dependabot[bot]
08a3890ba2 Bump rubocop from 1.79.2 to 1.80.0
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.79.2 to 1.80.0.
- [Release notes](https://github.com/rubocop/rubocop/releases)
- [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop/compare/v1.79.2...v1.80.0)

---
updated-dependencies:
- dependency-name: rubocop
  dependency-version: 1.80.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-25 14:33:48 +00:00
Daniel O'Connor
956c73cd1e This rake task iterates through all photos and removes any that have a 404 status on their fullsize_url. This will help to keep the database clean of broken photo references. (#4149)
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
2025-08-25 10:26:57 +09:30
google-labs-jules[bot]
8e74d1796a This rake task iterates through all photos and removes any that have a 404 status on their fullsize_url. This will help to keep the database clean of broken photo references. 2025-08-24 23:17:26 +00:00
google-labs-jules[bot]
a98990ccd2 Add transplant feature for plantings (#4133)
* Add ability to transplant a planting

* Fix view tests

* Transplantable gardens

* Add spec

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: Daniel O'Connor <daniel.oconnor@gmail.com>
2025-08-24 22:31:14 +09:30
google-labs-jules[bot]
ac1463e2cf Add international alternate names for crops (#4132)
* I will add the international alternate names for the crops.

* Mark required

* Update factory

* Add placeholder

* Fix seeds

* Add language, though hardcoded to EN in most places

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: Daniel O'Connor <daniel.oconnor@gmail.com>
2025-08-24 21:44:41 +09:30
google-labs-jules[bot]
8564ec7a7c Add comments to photos (#4130)
* Add comments to photos

Extend the photo show page to support comments by logged in users.

- Make the Comment model polymorphic.
- Update the Photo and Post models to have comments.
- Update the comments controller to handle the polymorphic association.
- Update the photo show page to display comments and a comment form.
- Create a reusable comments partial.

* Add migration

* Fix tests

* Fix tests

* Slightly fix tests

* Fix variables

* Add field

* Refactor slightly

* Refactor slightly

* Refactor slightly

* Refactor

* Photos respond to this as well

* Refactor to polymorphic_url

* Rename

* Wrong relationship

* Refactor and fix tests

* Fix relationships

* Fix rendering

* Fix tests

* Fix model tests

* Fix test

* Fix test

* Fix test

* Fix test

* Fix controller spec

* Fix view tests

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: Daniel O'Connor <daniel.oconnor@gmail.com>
2025-08-24 21:10:16 +09:30
Daniel O'Connor
79a54351e3 Delete spec/tasks/openfarm_rake_spec.rb 2025-08-24 21:02:13 +09:30
dependabot[bot]
48aa2aafd3 Merge pull request #4066 from Growstuff/dependabot/bundler/oj-3.16.11 2025-08-24 08:15:56 +00:00
Daniel O'Connor
3b648925dd Merge branch 'dev' into dependabot/bundler/oj-3.16.11 2025-08-24 17:36:31 +09:30
Daniel O'Connor
d04ffbeddd Merge pull request #4146 from Growstuff/remove-twitter-auth
Remove twitter authentication
2025-08-24 17:35:56 +09:30
Daniel O'Connor
e1367613e6 Merge branch 'dev' into remove-twitter-auth 2025-08-24 17:08:19 +09:30
Daniel O'Connor
70f78f1175 Merge pull request #4148 from Growstuff/CloCkWeRX-patch-2
Delete lib/tasks/openfarm.rake
2025-08-24 17:07:19 +09:30
Daniel O'Connor
6131fdf141 Delete lib/tasks/openfarm.rake 2025-08-24 17:07:02 +09:30
Daniel O'Connor
44101e07fb Merge branch 'mainline' into dev 2025-08-24 16:40:08 +09:30
Daniel O'Connor
b4c1104af0 Merge branch 'dev' into remove-twitter-auth 2025-08-24 16:36:42 +09:30
Daniel O'Connor
3d4ba954e7 Remove defunct detail 2025-08-24 07:05:28 +00:00
Daniel O'Connor
b8f7f95f32 Merge pull request #4144 from Growstuff/grid-layout
Improve profile page display slightly
2025-08-24 16:33:33 +09:30
google-labs-jules[bot]
0b639d5940 Remove twitter authentication
This change removes the twitter authentication feature from the application.

It removes the `omniauth-twitter` gem and all related code from controllers, views, and tests. It also removes the twitter icon and environment variable settings.
2025-08-24 07:03:20 +00:00
Daniel O'Connor
f216ddc368 Merge pull request #4145 from Growstuff/CloCkWeRX-patch-2
Update CONTRIBUTORS.md
2025-08-24 16:32:55 +09:30
Daniel O'Connor
967c0f4638 Update CONTRIBUTORS.md 2025-08-24 16:32:40 +09:30
Daniel O'Connor
cac0e3cb12 Update CONTRIBUTORS.md 2025-08-24 16:32:03 +09:30
Daniel O'Connor
65406b9e56 Update CONTRIBUTORS.md 2025-08-24 16:31:24 +09:30
Daniel O'Connor
224109aaf8 Merge pull request #4143 from Growstuff/feature/amend-delete-pictures-task
Amend delete_pictures rake task to remove legacy S3 photos
2025-08-24 16:30:23 +09:30
Daniel O'Connor
bec1ec1879 Merge pull request #4136 from Growstuff/dependabot/github_actions/actions/checkout-5
Bump actions/checkout from 4 to 5
2025-08-24 16:29:06 +09:30
Daniel O'Connor
e88e54b0c1 Image redundant now 2025-08-24 06:52:37 +00:00
google-labs-jules[bot]
76a6c1d849 Merge pull request #4131 from Growstuff/feature/add-social-media-links
feat: Add social media links to user profiles
2025-08-24 16:21:05 +09:30
Daniel O'Connor
b7f4de782d Styling 2025-08-24 06:50:53 +00:00
Daniel O'Connor
112a626941 Adjust Bio layout 2025-08-24 06:48:40 +00:00
google-labs-jules[bot]
b72aeab136 Amend delete_pictures rake task to remove legacy S3 photos
The `delete_pictures` rake task in `openfarm.rake` is amended to
also remove Photos where the `fullsize_url` starts with
`https://s3.amazonaws.com/openfarm-project/`.

This change helps in cleaning up legacy photos that are no longer
needed. The task description has also been updated to reflect this
change.
2025-08-24 06:21:19 +00:00
dependabot[bot]
a7d100fe7e Merge pull request #4137 from Growstuff/dependabot/bundler/selenium-webdriver-4.35.0 2025-08-14 14:15:43 +00:00
dependabot[bot]
810a9e39e3 Bump selenium-webdriver from 4.34.0 to 4.35.0
Bumps [selenium-webdriver](https://github.com/SeleniumHQ/selenium) from 4.34.0 to 4.35.0.
- [Release notes](https://github.com/SeleniumHQ/selenium/releases)
- [Changelog](https://github.com/SeleniumHQ/selenium/blob/trunk/rb/CHANGES)
- [Commits](https://github.com/SeleniumHQ/selenium/compare/selenium-4.34.0...selenium-4.35.0)

---
updated-dependencies:
- dependency-name: selenium-webdriver
  dependency-version: 4.35.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-14 14:09:03 +00:00
dependabot[bot]
b320435ddf Merge pull request #4141 from Growstuff/dependabot/bundler/rubocop-rails-2.33.3 2025-08-14 14:07:43 +00:00
dependabot[bot]
2f7ce2721f Bump rubocop-rails from 2.32.0 to 2.33.3
Bumps [rubocop-rails](https://github.com/rubocop/rubocop-rails) from 2.32.0 to 2.33.3.
- [Release notes](https://github.com/rubocop/rubocop-rails/releases)
- [Changelog](https://github.com/rubocop/rubocop-rails/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop-rails/compare/v2.32.0...v2.33.3)

---
updated-dependencies:
- dependency-name: rubocop-rails
  dependency-version: 2.33.3
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-14 13:53:23 +00:00
dependabot[bot]
c9e19203a9 Merge pull request #4142 from Growstuff/dependabot/bundler/rails-7.2.2.2 2025-08-14 13:52:01 +00:00
dependabot[bot]
005efab3be Bump rails from 7.2.2.1 to 7.2.2.2
Bumps [rails](https://github.com/rails/rails) from 7.2.2.1 to 7.2.2.2.
- [Release notes](https://github.com/rails/rails/releases)
- [Commits](https://github.com/rails/rails/compare/v7.2.2.1...v7.2.2.2)

---
updated-dependencies:
- dependency-name: rails
  dependency-version: 7.2.2.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-14 07:08:38 +00:00
dependabot[bot]
46599937d9 Merge pull request #4138 from Growstuff/dependabot/bundler/rspec-rails-8.0.2 2025-08-13 09:47:01 +00:00
dependabot[bot]
496a6ac2b6 Bump rspec-rails from 8.0.1 to 8.0.2
Bumps [rspec-rails](https://github.com/rspec/rspec-rails) from 8.0.1 to 8.0.2.
- [Changelog](https://github.com/rspec/rspec-rails/blob/main/Changelog.md)
- [Commits](https://github.com/rspec/rspec-rails/compare/v8.0.1...v8.0.2)

---
updated-dependencies:
- dependency-name: rspec-rails
  dependency-version: 8.0.2
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-13 07:17:23 +00:00
dependabot[bot]
9efb1f8486 Bump actions/checkout from 4 to 5
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-12 15:37:57 +00:00
Daniel O'Connor
59bd6f3450 Merge pull request #4065 from Growstuff/dependabot/bundler/rake-13.3.0
Bump rake from 13.2.1 to 13.3.0
2025-08-10 22:47:04 +09:30
dependabot[bot]
3e9bf73297 Merge pull request #4067 from Growstuff/dependabot/bundler/bullet-8.0.8 2025-08-10 08:50:09 +00:00
Daniel O'Connor
dcff643637 Merge branch 'dev' into dependabot/bundler/bullet-8.0.8 2025-08-10 17:53:48 +09:30
dependabot[bot]
a83966aa92 Merge pull request #4108 from Growstuff/dependabot/bundler/scout_apm-5.7.0 2025-08-10 07:40:46 +00:00
dependabot[bot]
1c47e421b9 Bump scout_apm from 5.6.4 to 5.7.0
Bumps [scout_apm](https://github.com/scoutapp/scout_apm_ruby) from 5.6.4 to 5.7.0.
- [Changelog](https://github.com/scoutapp/scout_apm_ruby/blob/master/CHANGELOG.markdown)
- [Commits](https://github.com/scoutapp/scout_apm_ruby/compare/v5.6.4...v5.7.0)

---
updated-dependencies:
- dependency-name: scout_apm
  dependency-version: 5.7.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-10 07:19:44 +00:00
Daniel O'Connor
6289ab0951 Bump faker from 3.5.1 to 3.5.2 (#4082)
Bumps [faker](https://github.com/faker-ruby/faker) from 3.5.1 to 3.5.2.
- [Release notes](https://github.com/faker-ruby/faker/releases)
- [Changelog](https://github.com/faker-ruby/faker/blob/main/CHANGELOG.md)
- [Commits](https://github.com/faker-ruby/faker/compare/v3.5.1...v3.5.2)

---
updated-dependencies:
- dependency-name: faker
  dependency-version: 3.5.2
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-10 16:48:30 +09:30
dependabot[bot]
d127647eeb Merge pull request #4105 from Growstuff/dependabot/bundler/puma-6.6.1 2025-08-10 07:05:39 +00:00
dependabot[bot]
9eda4bb2f2 Bump puma from 6.6.0 to 6.6.1
Bumps [puma](https://github.com/puma/puma) from 6.6.0 to 6.6.1.
- [Release notes](https://github.com/puma/puma/releases)
- [Changelog](https://github.com/puma/puma/blob/master/History.md)
- [Commits](https://github.com/puma/puma/compare/v6.6.0...v6.6.1)

---
updated-dependencies:
- dependency-name: puma
  dependency-version: 6.6.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-10 06:44:35 +00:00
dependabot[bot]
f1d524130b Merge pull request #4110 from Growstuff/dependabot/bundler/rspec-activemodel-mocks-1.3.0 2025-08-10 06:43:20 +00:00
dependabot[bot]
e4de08f47f Bump rspec-activemodel-mocks from 1.2.1 to 1.3.0
Bumps [rspec-activemodel-mocks](https://github.com/rspec/rspec-activemodel-mocks) from 1.2.1 to 1.3.0.
- [Changelog](https://github.com/rspec/rspec-activemodel-mocks/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rspec/rspec-activemodel-mocks/compare/v1.2.1...v1.3.0)

---
updated-dependencies:
- dependency-name: rspec-activemodel-mocks
  dependency-version: 1.3.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-10 06:29:48 +00:00
Daniel O'Connor
0b4820e5df Add rspec-retry (#4129)
* Add rspec-retry

* Add config

* Swap to rspec-rebound, which is a fork

* Swap to rspec-rebound, which is a fork
2025-08-10 15:55:52 +09:30
dependabot[bot]
d264905aa9 Bump faraday from 2.13.2 to 2.13.4 (#4101)
Bumps [faraday](https://github.com/lostisland/faraday) from 2.13.2 to 2.13.4.
- [Release notes](https://github.com/lostisland/faraday/releases)
- [Changelog](https://github.com/lostisland/faraday/blob/main/CHANGELOG.md)
- [Commits](https://github.com/lostisland/faraday/compare/v2.13.2...v2.13.4)

---
updated-dependencies:
- dependency-name: faraday
  dependency-version: 2.13.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-10 15:54:37 +09:30
Daniel O'Connor
25d2c5f854 Merge branch 'dev' into dependabot/bundler/bullet-8.0.8 2025-08-10 15:46:09 +09:30
google-labs-jules[bot]
d383c8e2e4 Add filtering for tradeable seeds (#4111)
* feat: Add filtering for tradeable seeds

This change introduces a new feature to filter seeds based on their tradeability.

- Adds a link on the homepage to view all tradeable seeds.
- Modifies the seeds controller to support filtering by `tradeable_to`, allowing multiple values to be selected.
- Adds links to the seeds index page to filter by the various `tradeable_to` values.

* Update index.html.haml

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: Daniel O'Connor <daniel.oconnor@gmail.com>
2025-08-10 15:44:01 +09:30
dependabot[bot]
ed89163311 Bump faker from 3.5.1 to 3.5.2
Bumps [faker](https://github.com/faker-ruby/faker) from 3.5.1 to 3.5.2.
- [Release notes](https://github.com/faker-ruby/faker/releases)
- [Changelog](https://github.com/faker-ruby/faker/blob/main/CHANGELOG.md)
- [Commits](https://github.com/faker-ruby/faker/compare/v3.5.1...v3.5.2)

---
updated-dependencies:
- dependency-name: faker
  dependency-version: 3.5.2
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-10 05:43:20 +00:00
dependabot[bot]
26de3e7c5e Bump oj from 3.16.10 to 3.16.11
Bumps [oj](https://github.com/ohler55/oj) from 3.16.10 to 3.16.11.
- [Release notes](https://github.com/ohler55/oj/releases)
- [Changelog](https://github.com/ohler55/oj/blob/develop/CHANGELOG.md)
- [Commits](https://github.com/ohler55/oj/compare/v3.16.10...v3.16.11)

---
updated-dependencies:
- dependency-name: oj
  dependency-version: 3.16.11
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-10 05:37:12 +00:00
Daniel O'Connor
6ae2de7e47 Merge pull request #4086 from Growstuff/mailboxer-translations
Mailboxer translations
2025-08-10 14:57:39 +09:30
Daniel O'Connor
da74c19c2a Merge pull request #4094 from Growstuff/dependabot/bundler/recaptcha-5.20.1
Bump recaptcha from 5.19.0 to 5.20.1
2025-08-10 14:57:23 +09:30
Daniel O'Connor
d767a011a4 Merge pull request #4126 from Growstuff/split-up-ci
Split up ci
2025-08-10 13:53:47 +09:30
Daniel O'Connor
bbe6a3fd36 Merge pull request #4123 from Growstuff/view-transitions
Opt into view transitions
2025-08-10 13:52:34 +09:30
dependabot[bot]
3eb2fe7637 Bump recaptcha from 5.19.0 to 5.20.1
Bumps [recaptcha](https://github.com/ambethia/recaptcha) from 5.19.0 to 5.20.1.
- [Changelog](https://github.com/ambethia/recaptcha/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ambethia/recaptcha/compare/v5.19.0...v5.20.1)

---
updated-dependencies:
- dependency-name: recaptcha
  dependency-version: 5.20.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-10 04:16:17 +00:00
dependabot[bot]
7f0af10637 Merge pull request #4109 from Growstuff/dependabot/bundler/rubocop-1.79.2 2025-08-10 04:15:01 +00:00
dependabot[bot]
75d93bb3c3 Bump rake from 13.2.1 to 13.3.0
Bumps [rake](https://github.com/ruby/rake) from 13.2.1 to 13.3.0.
- [Release notes](https://github.com/ruby/rake/releases)
- [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc)
- [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0)

---
updated-dependencies:
- dependency-name: rake
  dependency-version: 13.3.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-10 04:04:03 +00:00
Daniel O'Connor
c49f2bab19 Merge branch 'dev' into view-transitions 2025-08-10 13:24:41 +09:30
dependabot[bot]
ed71023306 Bump rubocop from 1.79.1 to 1.79.2
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.79.1 to 1.79.2.
- [Release notes](https://github.com/rubocop/rubocop/releases)
- [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop/compare/v1.79.1...v1.79.2)

---
updated-dependencies:
- dependency-name: rubocop
  dependency-version: 1.79.2
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-10 03:47:36 +00:00
Daniel O'Connor
59d95dfd77 Split up 2025-08-10 03:22:32 +00:00
Daniel O'Connor
e999c5870f Merge branch 'dev' into split-up-ci 2025-08-10 12:51:39 +09:30
Daniel O'Connor
072ec1dd82 Merge pull request #4125 from Growstuff/set-window-size
Specs: Target a desktop, fixing tests in codespaces at least.
2025-08-10 12:51:06 +09:30
Daniel O'Connor
8ecae23d61 Split up posts 2025-08-10 03:20:57 +00:00
Daniel O'Connor
d20ceb54b5 Avoid double running plantings features 2025-08-10 03:19:24 +00:00
Daniel O'Connor
7e3be99aac Comment out and explain why 2025-08-10 03:12:58 +00:00
Daniel O'Connor
d99d4a1bbe Disable dev shm usage on some environments 2025-08-10 03:08:57 +00:00
Daniel O'Connor
ea530754aa Disable dev shm usage on some environments 2025-08-10 03:06:38 +00:00
Daniel O'Connor
4bd322d8ca Target a desktop 2025-08-10 02:55:34 +00:00
Daniel O'Connor
5fc41ca50f Opt into view transitions 2025-08-10 02:47:44 +00:00
Daniel O'Connor
5da8f815d3 Fix stupid mistake 2025-08-10 02:27:36 +00:00
Daniel O'Connor
d71370c0bc Merge pull request #4122 from Growstuff/dev
Release 65.2
2025-08-10 11:54:12 +09:30
Daniel O'Connor
d0d31edd5e Merge pull request #4121 from Growstuff/delete-openfarm-pictures-rake-task
Swap to iteration for now, so callbacks are happy
2025-08-10 11:52:14 +09:30
Daniel O'Connor
67a2005f1e Swap to iteration for now, so callbacks are happy 2025-08-10 02:21:39 +00:00
Daniel O'Connor
c58ca74b53 Merge pull request #4120 from Growstuff/dev
Release 65.1
2025-08-10 11:39:11 +09:30
Daniel O'Connor
b528b40052 Merge pull request #4119 from Growstuff/delete-openfarm-pictures-rake-task
Swap to iteration for now, so callbacks are happy
2025-08-10 11:36:10 +09:30
Daniel O'Connor
3b17265a92 Swap to iteration for now, so callbacks are happy 2025-08-10 02:05:29 +00:00
Daniel O'Connor
0d22706d42 Merge pull request #4118 from Growstuff/dev
August 2025 Release
2025-08-10 11:17:05 +09:30
Daniel O'Connor
f8c93f16db Merge pull request #4113 from Growstuff/delete-openfarm-pictures-rake-task
Add rake task to delete pictures with source OpenFarm
2025-08-10 11:16:05 +09:30
Daniel O'Connor
8006d26c6e Fix source 2025-08-10 01:45:29 +00:00
Daniel O'Connor
2766082696 Merge branch 'dev' of https://github.com/Growstuff/growstuff into delete-openfarm-pictures-rake-task 2025-08-10 01:43:11 +00:00
Daniel O'Connor
d887d5c788 Merge pull request #4116 from Growstuff/dev-fixed
Add crowdin tools
2025-08-10 11:09:32 +09:30
Daniel O'Connor
0634719afc Add crowdin tools 2025-08-10 01:38:53 +00:00
Daniel O'Connor
a13cf93aeb Merge pull request #4115 from Growstuff/3.3.8
Bump to Ruby 3.3.8
2025-08-10 11:07:34 +09:30
Daniel O'Connor
04376f15a2 Merge pull request #4114 from Growstuff/add-crowdin-support
Add CrowdIn translations support
2025-08-10 10:59:16 +09:30
Daniel O'Connor
82d3f84e0c Ruby 3.3.8 2025-08-10 01:09:08 +00:00
Daniel O'Connor
af6cee2f16 Merge branch 'dev' into dependabot/bundler/bullet-8.0.8 2025-08-10 10:36:54 +09:30
google-labs-jules[bot]
4f705ff37b Add CrowdIn translations support
This change adds support for CrowdIn to manage translations.

- Adds the `crowdin-cli` gem to the `Gemfile`.
- Adds a `crowdin.yml` configuration file to the project root.
2025-08-10 01:02:39 +00:00
google-labs-jules[bot]
4829d5513c This commit adds a rake task to delete all pictures that have 'OpenFarm' as their source. This is useful for cleaning up data imported from OpenFarm. 2025-08-10 00:58:03 +00:00
Daniel O'Connor
d1419aaca4 Merge pull request #4104 from Growstuff/dependabot/bundler/rubocop-1.79.1
Bump rubocop from 1.78.0 to 1.79.1
2025-08-05 18:29:49 +09:30
dependabot[bot]
2458afc451 Bump rubocop from 1.78.0 to 1.79.1
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.78.0 to 1.79.1.
- [Release notes](https://github.com/rubocop/rubocop/releases)
- [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop/compare/v1.78.0...v1.79.1)

---
updated-dependencies:
- dependency-name: rubocop
  dependency-version: 1.79.1
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-04 23:21:45 +00:00
Daniel O'Connor
278be7067f Merge pull request #4107 from Growstuff/dependabot/bundler/haml_lint-0.66.0
Bump haml_lint from 0.62.0 to 0.66.0
2025-08-05 08:50:22 +09:30
dependabot[bot]
bc71c4a706 Bump haml_lint from 0.62.0 to 0.66.0
Bumps [haml_lint](https://github.com/sds/haml-lint) from 0.62.0 to 0.66.0.
- [Release notes](https://github.com/sds/haml-lint/releases)
- [Changelog](https://github.com/sds/haml-lint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sds/haml-lint/compare/v0.62.0...v0.66.0)

---
updated-dependencies:
- dependency-name: haml_lint
  dependency-version: 0.66.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-04 23:06:28 +00:00
Daniel O'Connor
b1a42a2ed6 Merge pull request #4106 from Growstuff/dependabot/bundler/pg-1.6.1
Bump pg from 1.5.9 to 1.6.1
2025-08-05 08:35:03 +09:30
dependabot[bot]
fe22c92a63 Bump pg from 1.5.9 to 1.6.1
Bumps [pg](https://github.com/ged/ruby-pg) from 1.5.9 to 1.6.1.
- [Changelog](https://github.com/ged/ruby-pg/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ged/ruby-pg/compare/v1.5.9...v1.6.1)

---
updated-dependencies:
- dependency-name: pg
  dependency-version: 1.6.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-04 09:49:20 +00:00
Daniel O'Connor
f00b31cf46 Merge pull request #4093 from Growstuff/dependabot/bundler/nokogiri-1.18.9
Bump nokogiri from 1.18.8 to 1.18.9
2025-07-25 20:32:04 +09:30
dependabot[bot]
7cfee1d89c Bump nokogiri from 1.18.8 to 1.18.9
---
updated-dependencies:
- dependency-name: nokogiri
  dependency-version: 1.18.9
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-07-22 03:24:14 +00:00
Daniel O'Connor
6c89cef5bc Merge pull request #4078 from Growstuff/dependabot/bundler/icalendar-2.11.2
Bump icalendar from 2.11.0 to 2.11.2
2025-07-17 08:56:42 +09:30
dependabot[bot]
5d79aa3e60 Bump icalendar from 2.11.0 to 2.11.2
Bumps [icalendar](https://github.com/icalendar/icalendar) from 2.11.0 to 2.11.2.
- [Changelog](https://github.com/icalendar/icalendar/blob/main/CHANGELOG.md)
- [Commits](https://github.com/icalendar/icalendar/compare/v2.11.0...v2.11.2)

---
updated-dependencies:
- dependency-name: icalendar
  dependency-version: 2.11.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-07-16 23:17:21 +00:00
Daniel O'Connor
29c8d87703 Merge pull request #4071 from Growstuff/dependabot/bundler/factory_bot_rails-6.5.0
Bump factory_bot_rails from 6.4.4 to 6.5.0
2025-07-17 08:46:41 +09:30
Daniel O'Connor
83ef779c11 Merge pull request #4076 from Growstuff/dependabot/bundler/rspec-rails-8.0.1
Bump rspec-rails from 8.0.0 to 8.0.1
2025-07-17 08:46:20 +09:30
Daniel O'Connor
4ada3e1585 Merge pull request #4080 from Growstuff/dependabot/bundler/selenium-webdriver-4.34.0
Bump selenium-webdriver from 4.32.0 to 4.34.0
2025-07-17 08:46:00 +09:30
Daniel O'Connor
88f5622d0c Merge branch 'dev' into dependabot/bundler/bullet-8.0.8 2025-07-15 09:11:20 +09:30
dependabot[bot]
fa6752c668 Bump selenium-webdriver from 4.32.0 to 4.34.0
Bumps [selenium-webdriver](https://github.com/SeleniumHQ/selenium) from 4.32.0 to 4.34.0.
- [Release notes](https://github.com/SeleniumHQ/selenium/releases)
- [Changelog](https://github.com/SeleniumHQ/selenium/blob/trunk/rb/CHANGES)
- [Commits](https://github.com/SeleniumHQ/selenium/compare/selenium-4.32.0...selenium-4.34.0)

---
updated-dependencies:
- dependency-name: selenium-webdriver
  dependency-version: 4.34.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-07-13 10:53:23 +00:00
dependabot[bot]
f9186c1a8a Bump rspec-rails from 8.0.0 to 8.0.1
Bumps [rspec-rails](https://github.com/rspec/rspec-rails) from 8.0.0 to 8.0.1.
- [Changelog](https://github.com/rspec/rspec-rails/blob/main/Changelog.md)
- [Commits](https://github.com/rspec/rspec-rails/compare/v8.0.0...v8.0.1)

---
updated-dependencies:
- dependency-name: rspec-rails
  dependency-version: 8.0.1
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-07-13 10:53:10 +00:00
dependabot[bot]
82dcd1d86c Bump factory_bot_rails from 6.4.4 to 6.5.0
Bumps [factory_bot_rails](https://github.com/thoughtbot/factory_bot_rails) from 6.4.4 to 6.5.0.
- [Release notes](https://github.com/thoughtbot/factory_bot_rails/releases)
- [Changelog](https://github.com/thoughtbot/factory_bot_rails/blob/main/NEWS.md)
- [Commits](https://github.com/thoughtbot/factory_bot_rails/compare/v6.4.4...v6.5.0)

---
updated-dependencies:
- dependency-name: factory_bot_rails
  dependency-version: 6.5.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-07-13 10:52:57 +00:00
Daniel O'Connor
b2146e791f Merge pull request #4083 from Growstuff/dependabot/bundler/faraday-2.13.2
Bump faraday from 2.13.1 to 2.13.2
2025-07-13 20:01:54 +09:30
dependabot[bot]
a9c33a30d2 Bump faraday from 2.13.1 to 2.13.2
Bumps [faraday](https://github.com/lostisland/faraday) from 2.13.1 to 2.13.2.
- [Release notes](https://github.com/lostisland/faraday/releases)
- [Changelog](https://github.com/lostisland/faraday/blob/main/CHANGELOG.md)
- [Commits](https://github.com/lostisland/faraday/compare/v2.13.1...v2.13.2)

---
updated-dependencies:
- dependency-name: faraday
  dependency-version: 2.13.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-07-13 10:30:42 +00:00
Daniel O'Connor
497cb6627d Merge pull request #4085 from Growstuff/dependabot/bundler/rubocop-1.78.0
Bump rubocop from 1.76.0 to 1.78.0
2025-07-13 19:59:21 +09:30
dependabot[bot]
a8a96ae125 Bump rubocop from 1.76.0 to 1.78.0
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.76.0 to 1.78.0.
- [Release notes](https://github.com/rubocop/rubocop/releases)
- [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop/compare/v1.76.0...v1.78.0)

---
updated-dependencies:
- dependency-name: rubocop
  dependency-version: 1.78.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-07-13 07:37:05 +00:00
Daniel O'Connor
4dcafdb117 Merge pull request #4092 from Growstuff/fix-ci3
Drop simplecov for now
2025-07-13 16:44:29 +09:30
Daniel O'Connor
bd132c32fa Drop simplecov for now 2025-07-13 07:04:02 +00:00
dependabot[bot]
534d493693 Bump bullet from 8.0.7 to 8.0.8
Bumps [bullet](https://github.com/flyerhzm/bullet) from 8.0.7 to 8.0.8.
- [Changelog](https://github.com/flyerhzm/bullet/blob/main/CHANGELOG.md)
- [Commits](https://github.com/flyerhzm/bullet/compare/8.0.7...8.0.8)

---
updated-dependencies:
- dependency-name: bullet
  dependency-version: 8.0.8
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-09 09:27:09 +00:00
Daniel O'Connor
1462279b60 Merge pull request #4011 from Growstuff/dev
March 2025-ish release
2025-03-29 16:43:24 +10:30
135 changed files with 1111 additions and 453 deletions

View File

@@ -38,7 +38,7 @@ jobs:
steps:
- name: Checkout this repo
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Configure sysctl limits
run: |

View File

@@ -38,7 +38,7 @@ jobs:
steps:
- name: Checkout this repo
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Configure sysctl limits
run: |

View File

@@ -38,7 +38,7 @@ jobs:
steps:
- name: Checkout this repo
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Configure sysctl limits
run: |

View File

@@ -38,7 +38,7 @@ jobs:
steps:
- name: Checkout this repo
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Configure sysctl limits
run: |

View File

@@ -38,7 +38,7 @@ jobs:
steps:
- name: Checkout this repo
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Configure sysctl limits
run: |

View File

@@ -38,7 +38,7 @@ jobs:
steps:
- name: Checkout this repo
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Configure sysctl limits
run: |

View File

@@ -38,7 +38,7 @@ jobs:
steps:
- name: Checkout this repo
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Configure sysctl limits
run: |

View File

@@ -38,7 +38,7 @@ jobs:
steps:
- name: Checkout this repo
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Configure sysctl limits
run: |

102
.github/workflows/ci-features-places.yml vendored Normal file
View File

@@ -0,0 +1,102 @@
name: CI Features - Admin
on: [pull_request]
jobs:
rspec:
runs-on: ubuntu-latest
services:
db:
image: postgres
env:
##
# The Postgres service fails its docker health check unless you
# specify these environment variables
#
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: growstuff_test
ports: ['5432:5432']
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
APP_DOMAIN_NAME: localhost:3000
APP_PROTOCOL: http
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
DATABASE_URL: postgres://postgres:postgres@localhost:5432/growstuff_test
DEVISE_SECRET_KEY: secret
ELASTIC_SEARCH_VERSION: "7.5.1-amd64"
GROWSTUFF_EMAIL: "noreply@test.growstuff.org"
GROWSTUFF_FLICKR_KEY: secretkey"
GROWSTUFF_FLICKR_SECRET: secretsecret
GROWSTUFF_SITE_NAME: "Growstuff (travis)"
RAILS_ENV: test
RAILS_SECRET_TOKEN: supersecret
steps:
- name: Checkout this repo
uses: actions/checkout@v5
- name: Configure sysctl limits
run: |
sudo swapoff -a
sudo sysctl -w vm.swappiness=1
sudo sysctl -w fs.file-max=262144
sudo sysctl -w vm.max_map_count=262144
- name: Start Elasticsearch
uses: elastic/elastic-github-actions/elasticsearch@master
with:
stack-version: 7.5.1
##
# Cache Yarn modules
#
# See https://github.com/actions/cache/blob/master/examples.md#node---yarn for details
#
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Setup yarn cache
uses: actions/cache@v4
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install required OS packages
run: |
sudo apt-get -y install libpq-dev google-chrome-stable
- name: Install NodeJS
uses: actions/setup-node@v4
with:
node-version: '12'
- name: Install Ruby (version given by .ruby-version) and Bundler
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Install required JS packages
run: yarn install
- name: install chrome
run: sudo apt-get install google-chrome-stable
- name: Prepare database for testing
run: bundle exec rails db:prepare
- name: precompile assets
run: bundle exec rails assets:precompile
- name: index into elastic search
run: bundle exec rails search:reindex
- name: Run rspec (places/)
run: bundle exec rspec spec/features/places/ -fd

View File

@@ -38,7 +38,7 @@ jobs:
steps:
- name: Checkout this repo
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Configure sysctl limits
run: |

102
.github/workflows/ci-features-posts.yml vendored Normal file
View File

@@ -0,0 +1,102 @@
name: CI Features - Admin
on: [pull_request]
jobs:
rspec:
runs-on: ubuntu-latest
services:
db:
image: postgres
env:
##
# The Postgres service fails its docker health check unless you
# specify these environment variables
#
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: growstuff_test
ports: ['5432:5432']
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
APP_DOMAIN_NAME: localhost:3000
APP_PROTOCOL: http
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
DATABASE_URL: postgres://postgres:postgres@localhost:5432/growstuff_test
DEVISE_SECRET_KEY: secret
ELASTIC_SEARCH_VERSION: "7.5.1-amd64"
GROWSTUFF_EMAIL: "noreply@test.growstuff.org"
GROWSTUFF_FLICKR_KEY: secretkey"
GROWSTUFF_FLICKR_SECRET: secretsecret
GROWSTUFF_SITE_NAME: "Growstuff (travis)"
RAILS_ENV: test
RAILS_SECRET_TOKEN: supersecret
steps:
- name: Checkout this repo
uses: actions/checkout@v5
- name: Configure sysctl limits
run: |
sudo swapoff -a
sudo sysctl -w vm.swappiness=1
sudo sysctl -w fs.file-max=262144
sudo sysctl -w vm.max_map_count=262144
- name: Start Elasticsearch
uses: elastic/elastic-github-actions/elasticsearch@master
with:
stack-version: 7.5.1
##
# Cache Yarn modules
#
# See https://github.com/actions/cache/blob/master/examples.md#node---yarn for details
#
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Setup yarn cache
uses: actions/cache@v4
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install required OS packages
run: |
sudo apt-get -y install libpq-dev google-chrome-stable
- name: Install NodeJS
uses: actions/setup-node@v4
with:
node-version: '12'
- name: Install Ruby (version given by .ruby-version) and Bundler
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Install required JS packages
run: yarn install
- name: install chrome
run: sudo apt-get install google-chrome-stable
- name: Prepare database for testing
run: bundle exec rails db:prepare
- name: precompile assets
run: bundle exec rails assets:precompile
- name: index into elastic search
run: bundle exec rails search:reindex
- name: Run rspec (posts/)
run: bundle exec rspec spec/features/posts/ -fd

View File

@@ -38,7 +38,7 @@ jobs:
steps:
- name: Checkout this repo
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Configure sysctl limits
run: |

View File

@@ -38,7 +38,7 @@ jobs:
steps:
- name: Checkout this repo
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Configure sysctl limits
run: |

View File

@@ -38,7 +38,7 @@ jobs:
steps:
- name: Checkout this repo
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Configure sysctl limits
run: |
@@ -107,14 +107,5 @@ jobs:
- name: Run rspec (photos/)
run: bundle exec rspec spec/features/photos/ -fd
- name: Run rspec (places/)
run: bundle exec rspec spec/features/places/ -fd
- name: Run rspec (plantings/)
run: bundle exec rspec spec/features/plantings/ -fd
- name: Run rspec (posts/)
run: bundle exec rspec spec/features/posts/ -fd
- name: Run rspec (rss/)
run: bundle exec rspec spec/features/rss/ -fd

View File

@@ -6,7 +6,7 @@ jobs:
contributors:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: Install ruby version specified in .ruby-version
uses: ruby/setup-ruby@v1
with:
@@ -53,7 +53,7 @@ jobs:
steps:
- name: Checkout this repo
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Configure sysctl limits
run: |

View File

@@ -1 +1 @@
3.3.7
3.3.8

View File

@@ -12,6 +12,7 @@ submit the change with your pull request.
- Miles Gould / [pozorvlak](https://github.com/pozorvlak)
- Mackenzie Morgan / [maco](https://github.com/maco)
- Brenda Wallace / [br3nda](https://github.com/br3nda)
- Daniel O'Connor / [CloCkWeRX](https://github.com/CloCkWeRX)
## Contributors
@@ -68,7 +69,6 @@ submit the change with your pull request.
- Jym Paul Carandang / [jacarandang](https://github.com/jacarandang)
- Anthony Atkinson / [sha1sum](https://github.com/sha1sum)
- Terence Conquest / [twconquest](https://github.com/twconquest)
- Daniel O'Connor / [CloCkWeRX](https://github.com/CloCkWeRX)
- DV Dasari / [dv2](https://github.com/dv2)
- Eric Tillberg / [Thrillberg](https://github.com/Thrillberg)
- Lucas Nogueira / [lucasnogueira](https://github.com/lucasnogueira)
@@ -95,10 +95,11 @@ submit the change with your pull request.
- Ítalo Pires / [italopires](https://github.com/italopires)
- Bennett Zink / [bennett-zink](https://github.com/bennett-zink)
- Dominick Thornton / [domthor](https://github.com/domthor)
## Bots
### Security and Dependency Updates
- `codefactor-io[bot]`
- DeppBot / [deppbot](https://github.com/deppbot)
- `dependabot[bot]` [dependabot](https://github.com/dependabot-bot) / [dependabot-preview](https://github.com/apps/dependabot-preview)
- [google-labs-jules[bot]](https://github.com/apps/google-labs-jules)

10
Gemfile
View File

@@ -91,10 +91,9 @@ gem 'bootstrap-datepicker-rails'
# DRY-er easier bootstrap 4 forms
gem "bootstrap_form", ">= 4.5.0"
# For connecting to other services (eg Twitter)
# For connecting to other services (eg Flickr)
gem 'omniauth', '~> 1.3'
gem 'omniauth-flickr', '>= 0.0.15'
gem 'omniauth-twitter'
# Pretty charts
gem "chartkick"
@@ -175,6 +174,7 @@ group :development, :test do
gem 'rubocop-rspec_rails'
gem 'webrat' # provides HTML matchers for view tests
gem 'crowdin-cli' # for translations
gem 'dotenv-rails'
# cli utils
@@ -192,10 +192,14 @@ group :test do
gem 'selenium-webdriver'
gem 'timecop'
gem 'vcr'
gem "rspec-rebound"
gem "percy-capybara", "~> 5.0.0"
end
group :travis do
gem 'platform-api'
end
gem "percy-capybara", "~> 5.0.0"
gem "i18n_data", "~> 1.1"

View File

@@ -33,29 +33,29 @@ GEM
GEM
remote: https://rubygems.org/
specs:
actioncable (7.2.2.1)
actionpack (= 7.2.2.1)
activesupport (= 7.2.2.1)
actioncable (7.2.2.2)
actionpack (= 7.2.2.2)
activesupport (= 7.2.2.2)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
zeitwerk (~> 2.6)
actionmailbox (7.2.2.1)
actionpack (= 7.2.2.1)
activejob (= 7.2.2.1)
activerecord (= 7.2.2.1)
activestorage (= 7.2.2.1)
activesupport (= 7.2.2.1)
actionmailbox (7.2.2.2)
actionpack (= 7.2.2.2)
activejob (= 7.2.2.2)
activerecord (= 7.2.2.2)
activestorage (= 7.2.2.2)
activesupport (= 7.2.2.2)
mail (>= 2.8.0)
actionmailer (7.2.2.1)
actionpack (= 7.2.2.1)
actionview (= 7.2.2.1)
activejob (= 7.2.2.1)
activesupport (= 7.2.2.1)
actionmailer (7.2.2.2)
actionpack (= 7.2.2.2)
actionview (= 7.2.2.2)
activejob (= 7.2.2.2)
activesupport (= 7.2.2.2)
mail (>= 2.8.0)
rails-dom-testing (~> 2.2)
actionpack (7.2.2.1)
actionview (= 7.2.2.1)
activesupport (= 7.2.2.1)
actionpack (7.2.2.2)
actionview (= 7.2.2.2)
activesupport (= 7.2.2.2)
nokogiri (>= 1.8.5)
racc
rack (>= 2.2.4, < 3.2)
@@ -64,15 +64,15 @@ GEM
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
useragent (~> 0.16)
actiontext (7.2.2.1)
actionpack (= 7.2.2.1)
activerecord (= 7.2.2.1)
activestorage (= 7.2.2.1)
activesupport (= 7.2.2.1)
actiontext (7.2.2.2)
actionpack (= 7.2.2.2)
activerecord (= 7.2.2.2)
activestorage (= 7.2.2.2)
activesupport (= 7.2.2.2)
globalid (>= 0.6.0)
nokogiri (>= 1.8.5)
actionview (7.2.2.1)
activesupport (= 7.2.2.1)
actionview (7.2.2.2)
activesupport (= 7.2.2.2)
builder (~> 3.1)
erubi (~> 1.11)
rails-dom-testing (~> 2.2)
@@ -87,22 +87,22 @@ GEM
active_utils (3.5.0)
activesupport (>= 4.2)
i18n
activejob (7.2.2.1)
activesupport (= 7.2.2.1)
activejob (7.2.2.2)
activesupport (= 7.2.2.2)
globalid (>= 0.3.6)
activemodel (7.2.2.1)
activesupport (= 7.2.2.1)
activerecord (7.2.2.1)
activemodel (= 7.2.2.1)
activesupport (= 7.2.2.1)
activemodel (7.2.2.2)
activesupport (= 7.2.2.2)
activerecord (7.2.2.2)
activemodel (= 7.2.2.2)
activesupport (= 7.2.2.2)
timeout (>= 0.4.0)
activestorage (7.2.2.1)
actionpack (= 7.2.2.1)
activejob (= 7.2.2.1)
activerecord (= 7.2.2.1)
activesupport (= 7.2.2.1)
activestorage (7.2.2.2)
actionpack (= 7.2.2.2)
activejob (= 7.2.2.2)
activerecord (= 7.2.2.2)
activesupport (= 7.2.2.2)
marcel (~> 1.0)
activesupport (7.2.2.1)
activesupport (7.2.2.2)
base64
benchmark (>= 0.3)
bigdecimal
@@ -156,7 +156,7 @@ GEM
actionpack (>= 6.1)
activemodel (>= 6.1)
builder (3.3.0)
bullet (8.0.7)
bullet (8.0.8)
activesupport (>= 3.0.0)
uniform_notifier (~> 1.11)
byebug (12.0.0)
@@ -183,7 +183,7 @@ GEM
image_processing (~> 1.1)
marcel (~> 1.0.0)
ssrf_filter (~> 1.0)
chartkick (5.1.5)
chartkick (5.2.0)
childprocess (5.0.0)
coderay (1.1.3)
coercible (1.0.0)
@@ -200,6 +200,14 @@ GEM
concurrent-ruby (1.3.5)
connection_pool (2.5.3)
crass (1.0.6)
crowdin-api (1.12.0)
open-uri (>= 0.1.0, < 0.2.0)
rest-client (>= 2.0.0, < 2.2.0)
crowdin-cli (0.2.2)
crowdin-api (>= 0.2.0)
gli (>= 2.7.0)
i18n (>= 0.6.4)
rubyzip (>= 1.0.0)
csv (3.3.1)
csv_shaper (1.4.0)
activesupport (>= 3.0.0)
@@ -220,10 +228,10 @@ GEM
railties (>= 4.1.0)
responders
warden (~> 1.2.3)
diff-lcs (1.6.1)
diff-lcs (1.6.2)
discard (1.4.0)
activerecord (>= 4.2, < 9.0)
docile (1.1.5)
domain_name (0.6.20240107)
dotenv (3.1.8)
dotenv-rails (3.1.8)
dotenv (= 3.1.8)
@@ -243,24 +251,24 @@ GEM
elasticsearch-transport (7.0.0)
faraday
multi_json
erb (5.0.1)
erb (5.0.2)
erubi (1.13.1)
erubis (2.7.0)
excon (1.2.5)
logger
execjs (2.10.0)
factory_bot (6.5.0)
activesupport (>= 5.0.0)
factory_bot_rails (6.4.4)
factory_bot (6.5.4)
activesupport (>= 6.1.0)
factory_bot_rails (6.5.0)
factory_bot (~> 6.5)
railties (>= 5.0.0)
faker (3.5.1)
railties (>= 6.1.0)
faker (3.5.2)
i18n (>= 1.8.11, < 2)
faraday (2.13.1)
faraday (2.13.4)
faraday-net_http (>= 2.0, < 3.5)
json
logger
faraday-net_http (3.4.0)
faraday-net_http (3.4.1)
net-http (>= 0.5.0)
ffi (1.16.3)
flickraw (0.9.10)
@@ -275,6 +283,8 @@ GEM
gibbon (1.2.1)
httparty
multi_json (>= 1.9.0)
gli (2.22.2)
ostruct
globalid (1.2.1)
activesupport (>= 6.1)
gravatar-ultimate (2.0.0)
@@ -295,7 +305,7 @@ GEM
activesupport (>= 5.1)
haml (>= 4.0.6)
railties (>= 5.1)
haml_lint (0.62.0)
haml_lint (0.66.0)
haml (>= 5.0)
parallel (~> 1.10)
rainbow
@@ -311,6 +321,9 @@ GEM
webrick
highline (3.1.2)
reline
http-accept (1.7.0)
http-cookie (1.0.8)
domain_name (~> 0.5)
httparty (0.22.0)
csv
mini_mime (>= 1.0.0)
@@ -328,7 +341,9 @@ GEM
rainbow (>= 2.2.2, < 4.0)
ruby-progressbar (~> 1.8, >= 1.8.1)
terminal-table (>= 1.5.1)
icalendar (2.11.0)
i18n_data (1.1.0)
simple_po_parser (~> 1.1)
icalendar (2.11.2)
base64
ice_cube (~> 0.16)
logger
@@ -338,7 +353,7 @@ GEM
image_processing (1.12.2)
mini_magick (>= 4.9.5, < 5)
ruby-vips (>= 2.0.17, < 3)
io-console (0.8.0)
io-console (0.8.1)
irb (1.15.2)
pp (>= 0.6.0)
rdoc (>= 4.0.0)
@@ -347,7 +362,7 @@ GEM
rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
json (2.12.2)
json (2.13.2)
json-schema (5.1.0)
addressable (~> 2.8)
jsonapi-resources (0.10.7)
@@ -392,6 +407,10 @@ GEM
matrix (0.4.2)
memcachier (0.0.2)
method_source (1.1.0)
mime-types (3.7.0)
logger
mime-types-data (~> 3.2025, >= 3.2025.0507)
mime-types-data (3.2025.0805)
mimemagic (0.4.3)
nokogiri (~> 1)
rake
@@ -406,23 +425,24 @@ GEM
bigdecimal (~> 3.1)
net-http (0.6.0)
uri
net-imap (0.4.20)
net-imap (0.5.9)
date
net-protocol
net-pop (0.1.2)
net-protocol
net-protocol (0.2.2)
timeout
net-smtp (0.5.0)
net-smtp (0.5.1)
net-protocol
netrc (0.11.0)
nio4r (2.7.4)
nokogiri (1.18.8)
nokogiri (1.18.9)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
nokogiri (1.18.8-x86_64-linux-gnu)
nokogiri (1.18.9-x86_64-linux-gnu)
racc (~> 1.4)
oauth (0.5.6)
oj (3.16.10)
oj (3.16.11)
bigdecimal (>= 3.0)
ostruct (>= 0.2)
omniauth (1.9.2)
@@ -434,18 +454,17 @@ GEM
omniauth-oauth (1.1.0)
oauth
omniauth (~> 1.0)
omniauth-twitter (1.4.0)
omniauth-oauth (~> 1.1)
rack
open-uri (0.1.0)
orm_adapter (0.5.0)
ostruct (0.6.1)
ostruct (0.6.3)
parallel (1.27.0)
parser (3.3.8.0)
parser (3.3.9.0)
ast (~> 2.4.1)
racc
percy-capybara (5.0.0)
capybara (>= 3)
pg (1.5.9)
pg (1.6.1)
pg (1.6.1-x86_64-linux)
platform-api (3.8.0)
heroics (~> 0.1.1)
moneta (~> 1.0.0)
@@ -462,7 +481,7 @@ GEM
date
stringio
public_suffix (6.0.1)
puma (6.6.0)
puma (6.6.1)
nio4r (~> 2.0)
query_diet (0.7.2)
racc (1.8.1)
@@ -479,20 +498,20 @@ GEM
rackup (1.0.1)
rack (< 3)
webrick
rails (7.2.2.1)
actioncable (= 7.2.2.1)
actionmailbox (= 7.2.2.1)
actionmailer (= 7.2.2.1)
actionpack (= 7.2.2.1)
actiontext (= 7.2.2.1)
actionview (= 7.2.2.1)
activejob (= 7.2.2.1)
activemodel (= 7.2.2.1)
activerecord (= 7.2.2.1)
activestorage (= 7.2.2.1)
activesupport (= 7.2.2.1)
rails (7.2.2.2)
actioncable (= 7.2.2.2)
actionmailbox (= 7.2.2.2)
actionmailer (= 7.2.2.2)
actionpack (= 7.2.2.2)
actiontext (= 7.2.2.2)
actionview (= 7.2.2.2)
activejob (= 7.2.2.2)
activemodel (= 7.2.2.2)
activerecord (= 7.2.2.2)
activestorage (= 7.2.2.2)
activesupport (= 7.2.2.2)
bundler (>= 1.15.0)
railties (= 7.2.2.1)
railties (= 7.2.2.2)
rails-controller-testing (1.0.5)
actionpack (>= 5.0.1.rc1)
actionview (>= 5.0.1.rc1)
@@ -512,9 +531,9 @@ GEM
rails_stdout_logging
rails_serve_static_assets (0.0.5)
rails_stdout_logging (0.0.5)
railties (7.2.2.1)
actionpack (= 7.2.2.1)
activesupport (= 7.2.2.1)
railties (7.2.2.2)
actionpack (= 7.2.2.2)
activesupport (= 7.2.2.2)
irb (~> 1.13)
rackup (>= 1.0.0)
rake (>= 12.2)
@@ -522,42 +541,47 @@ GEM
zeitwerk (~> 2.6)
rainbow (3.1.1)
raindrops (0.20.1)
rake (13.2.1)
rake (13.3.0)
rate_throttle_client (0.1.2)
rb-fsevent (0.11.2)
rb-inotify (0.10.1)
ffi (~> 1.0)
rdoc (6.14.0)
rdoc (6.14.2)
erb
psych (>= 4.0.0)
recaptcha (5.19.0)
recaptcha (5.20.1)
redis-client (0.23.2)
connection_pool
regexp_parser (2.10.0)
reline (0.6.1)
regexp_parser (2.11.2)
reline (0.6.2)
io-console (~> 0.5)
responders (3.1.1)
actionpack (>= 5.2)
railties (>= 5.2)
rest-client (2.1.0)
http-accept (>= 1.7.0, < 2.0)
http-cookie (>= 1.0.2, < 2.0)
mime-types (>= 1.16, < 4.0)
netrc (~> 0.8)
rexml (3.4.1)
rouge (4.1.2)
rspec (3.13.0)
rspec-core (~> 3.13.0)
rspec-expectations (~> 3.13.0)
rspec-mocks (~> 3.13.0)
rspec-activemodel-mocks (1.2.1)
rspec-activemodel-mocks (1.3.0)
activemodel (>= 3.0)
activesupport (>= 3.0)
rspec-mocks (>= 2.99, < 4.0)
rspec-core (3.13.3)
rspec-core (3.13.5)
rspec-support (~> 3.13.0)
rspec-expectations (3.13.4)
rspec-expectations (3.13.5)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-mocks (3.13.4)
rspec-mocks (3.13.5)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-rails (8.0.0)
rspec-rails (8.0.2)
actionpack (>= 7.2)
activesupport (>= 7.2)
railties (>= 7.2)
@@ -565,7 +589,9 @@ GEM
rspec-expectations (~> 3.13)
rspec-mocks (~> 3.13)
rspec-support (~> 3.13)
rspec-support (3.13.3)
rspec-rebound (0.2.1)
rspec-core (~> 3.3)
rspec-support (3.13.4)
rspectre (0.2.0)
parser (>= 3.3.7.1)
prism (~> 1.3)
@@ -581,7 +607,7 @@ GEM
rswag-ui (2.16.0)
actionpack (>= 5.2, < 8.1)
railties (>= 5.2, < 8.1)
rubocop (1.76.0)
rubocop (1.80.1)
json (~> 2.3)
language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.1.0)
@@ -589,10 +615,10 @@ GEM
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 2.9.3, < 3.0)
rubocop-ast (>= 1.45.0, < 2.0)
rubocop-ast (>= 1.46.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 4.0)
rubocop-ast (1.45.0)
rubocop-ast (1.46.0)
parser (>= 3.3.7.2)
prism (~> 1.4)
rubocop-capybara (2.22.1)
@@ -601,7 +627,7 @@ GEM
rubocop-factory_bot (2.27.1)
lint_roller (~> 1.1)
rubocop (~> 1.72, >= 1.72.1)
rubocop-rails (2.32.0)
rubocop-rails (2.33.3)
activesupport (>= 4.2.0)
lint_roller (~> 1.1)
rack (>= 1.1)
@@ -621,7 +647,7 @@ GEM
ruby-units (4.1.0)
ruby-vips (2.2.1)
ffi (~> 1.12)
rubyzip (2.4.1)
rubyzip (3.0.1)
sass (3.7.4)
sass-listen (~> 4.0.0)
sass-listen (4.0.0)
@@ -635,17 +661,17 @@ GEM
sprockets (> 3.0)
sprockets-rails
tilt
scout_apm (5.6.4)
scout_apm (5.7.1)
parser
searchkick (5.3.1)
activemodel (>= 6.1)
hashie
securerandom (0.4.1)
selenium-webdriver (4.32.0)
selenium-webdriver (4.35.0)
base64 (~> 0.2)
logger (~> 1.4)
rexml (~> 3.2, >= 3.2.5)
rubyzip (>= 1.2.2, < 3.0)
rubyzip (>= 1.2.2, < 4.0)
websocket (~> 1.0)
sidekiq (7.3.9)
base64
@@ -653,11 +679,7 @@ GEM
logger
rack (>= 2.2.4)
redis-client (>= 0.22.2)
simplecov (0.13.0)
docile (~> 1.1.0)
json (>= 1.8, < 3)
simplecov-html (~> 0.10.0)
simplecov-html (0.10.2)
simple_po_parser (1.1.6)
sprockets (3.7.5)
base64
concurrent-ruby (~> 1.0)
@@ -669,20 +691,20 @@ GEM
ssrf_filter (1.1.2)
stringio (3.1.7)
sysexits (1.2.0)
temple (0.10.3)
temple (0.10.4)
terminal-table (4.0.0)
unicode-display_width (>= 1.1.1, < 4)
terser (1.2.5)
execjs (>= 0.3.0, < 3)
thor (1.3.2)
thor (1.4.0)
thread_safe (0.3.6)
tilt (2.6.0)
tilt (2.6.1)
timecop (0.9.10)
timeout (0.4.3)
trollop (1.16.2)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (3.1.4)
unicode-display_width (3.1.5)
unicode-emoji (~> 4.0, >= 4.0.4)
unicode-emoji (4.0.4)
unicorn (6.1.0)
@@ -708,7 +730,8 @@ GEM
rack-test (>= 0.5.3)
webrick (1.9.1)
websocket (1.2.11)
websocket-driver (0.7.6)
websocket-driver (0.8.0)
base64
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
will_paginate (4.0.1)
@@ -746,6 +769,7 @@ DEPENDENCIES
chartkick
coffee-rails
comfortable_mexican_sofa!
crowdin-cli
csv_shaper
dalli
database_cleaner
@@ -769,6 +793,7 @@ DEPENDENCIES
haml_lint (>= 0.25.1)
hashie (>= 3.5.3)
i18n-tasks
i18n_data (~> 1.1)
icalendar
jquery-rails
jquery-ui-rails!
@@ -786,7 +811,6 @@ DEPENDENCIES
oj
omniauth (~> 1.3)
omniauth-flickr (>= 0.0.15)
omniauth-twitter
percy-capybara (~> 5.0.0)
pg
platform-api
@@ -804,6 +828,7 @@ DEPENDENCIES
responders
rspec-activemodel-mocks
rspec-rails
rspec-rebound
rspectre
rswag-api
rswag-specs
@@ -833,7 +858,7 @@ DEPENDENCIES
xmlrpc
RUBY VERSION
ruby 3.3.7p123
ruby 3.3.8p144
BUNDLED WITH
2.4.22

View File

@@ -62,5 +62,3 @@ For more information about this project, contact [info@growstuff.org](mailto:inf
Security Issues: If you find an authorization bypass or data breach, please contact our maintainers directly at [maintainers@growstuff.org](mailto:maintainers@growstuff.org).
You can also contact us on [Twitter](http://twitter.com/growstufforg/) or
[Facebook](https://www.facebook.com/pages/Growstuff/1531133417099494) or [Github](https://github.com/Growstuff/growstuff/issues)..

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

View File

@@ -33,13 +33,6 @@
}
}
.location-not-set {
background-image: image-url("location-not-set.en.png");
background-position: center;
background-repeat: no-repeat;
height: 250px;
width: 100%;
}
.card {
.badge-location {
background-color: darken($blue, 10%);

View File

@@ -30,3 +30,7 @@
@import "predictions";
@import "homepage";
@import "maps";
@view-transition {
navigation: auto;
}

View File

@@ -57,6 +57,6 @@ class AlternateNamesController < ApplicationController
private
def alternate_name_params
params.require(:alternate_name).permit(:crop_id, :name, :creator_id)
params.require(:alternate_name).permit(:crop_id, :name, :creator_id, :language)
end
end

View File

@@ -78,6 +78,7 @@ class ApplicationController < ActionController::Base
:tos_agreement,
# profile stuff
:bio, :location, :latitude, :longitude,
:website_url, :instagram_handle, :facebook_handle, :bluesky_handle, :other_url,
# email settings
:show_email, :newsletter, :send_notification_email, :send_planting_reminder,
# update password

View File

@@ -13,43 +13,55 @@ class CommentsController < ApplicationController
end
def new
@commentable = find_commentable
@comment = Comment.new
@post = Post.find_by(id: params[:post_id])
if @post
@comments = @post.comments
if @commentable
@comments = @commentable.comments
respond_with(@comments)
else
redirect_to(request.referer || root_url,
alert: "Can't post a comment on a non-existent post")
alert: "Can't post a comment on a non-existent commentable")
end
end
def edit
@comments = @comment.post.comments
# TODO: Why does this need a collection of comments?
@comments = @comment.commentable.comments
@commentable = @comment.commentable
end
def create
@comment = Comment.new(comment_params)
@commentable = @comment.commentable
@comment.author = current_member
@comment.save
respond_with @comment, location: @comment.post
respond_with @comment, location: @commentable
end
def update
@comment.update(body: comment_params['body'])
respond_with @comment, location: @comment.post
respond_with @comment, location: @comment.commentable
end
def destroy
@post = @comment.post
@commentable = @comment.commentable
@comment.destroy
respond_with(@post)
respond_with(@commentable)
end
private
def find_commentable
return unless params[:comment]
if params[:comment][:commentable_type] == 'Photo'
Photo.find(params[:comment][:commentable_id])
elsif params[:comment][:commentable_type] == 'Post'
Post.find(params[:comment][:commentable_id])
end
end
def comment_params
params.require(:comment).permit(:body, :post_id)
params.require(:comment).permit(:body, :commentable_id, :commentable_type)
end
end

View File

@@ -39,12 +39,6 @@ class CropsController < ApplicationController
respond_with @crops
end
def openfarm
@crop = Crop.find(params[:crop_slug])
@crop.update_openfarm_data!
respond_with @crop, location: @crop
end
def gbif
@crop = Crop.find(params[:crop_slug])
@crop.update_gbif_data!
@@ -137,7 +131,6 @@ class CropsController < ApplicationController
if @crop.approval_status_changed?(from: "pending", to: "approved")
notifier.deliver_now!
@crop.update_openfarm_data!
@crop.update_gbif_data!
end
else
@@ -166,7 +159,7 @@ class CropsController < ApplicationController
end
def save_crop_names
AlternateName.create!(names_params(:alt_name).map { |n| { name: n, creator_id: current_member.id, crop_id: @crop.id } })
AlternateName.create!(names_params(:alt_name).map { |n| { name: n, creator_id: current_member.id, crop_id: @crop.id, language: "EN" } })
ScientificName.create!(names_params(:sci_name).map { |n| { name: n, creator_id: current_member.id, crop_id: @crop.id } })
end
@@ -181,18 +174,16 @@ class CropsController < ApplicationController
def recreate_names(param_name, name_type)
return if params[param_name].blank?
destroy_names(name_type)
params[param_name].each_value do |value|
create_name!(name_type, value) unless value.empty?
end
end
def destroy_names(name_type)
@crop.send("#{name_type}_names").each(&:destroy)
end
params[param_name].each_value do |value|
next if value.empty?
def create_name!(name_type, value)
@crop.send("#{name_type}_names").create!(name: value, creator_id: current_member.id)
if name_type == 'alternate'
@crop.send("#{name_type}_names").create!(name: value, creator_id: current_member.id, language: "EN")
else
@crop.send("#{name_type}_names").create!(name: value, creator_id: current_member.id)
end
end
end
def crop_params
@@ -216,12 +207,12 @@ class CropsController < ApplicationController
def crop_json_fields
{
include: {
plantings: {
plantings: {
include: {
owner: { only: %i(id login_name location latitude longitude) }
}
},
scientific_names: { only: [:name] }, alternate_names: { only: [:name] }
scientific_names: { only: [:name] }, alternate_names: { only: %i(name language) }
}
}
end

View File

@@ -16,7 +16,6 @@ class MembersController < ApplicationController
def show
@member = Member.confirmed.kept.find_by!(slug: params[:slug])
@twitter_auth = @member.auth('twitter')
@flickr_auth = @member.auth('flickr')
@posts = @member.posts

View File

@@ -28,7 +28,7 @@ class OmniauthCallbacksController < Devise::OmniauthCallbacksController
@authentication = action.establish_authentication(auth, member)
if action.member_created?
raise "Invalid provider" unless %w(twitter flickr).index(auth['provider'].to_s)
raise "Invalid provider" unless %w(flickr).index(auth['provider'].to_s)
session["devise.#{auth['provider']}_data"] = request.env["omniauth.auth"]
sign_in member

View File

@@ -21,6 +21,7 @@ class PhotosController < ApplicationController
def show
@crops = Crop.distinct.joins(:photo_associations).where(photo_associations: { photo: @photo })
@comment = Comment.new(commentable: @photo)
respond_with(@photo)
end

View File

@@ -91,6 +91,32 @@ class PlantingsController < DataController
respond_with @planting, location: @planting.garden
end
def transplant
# The `load_and_authorize_resource` in DataController will handle finding the
# planting and authorizing the action.
# We still need to authorize the new garden
new_garden = Garden.find(params[:garden_id])
authorize! :update, new_garden
# Mark original planting as finished
@planting.update(finished: true, finished_at: Time.zone.now)
# Create a new planting
new_planting = @planting.dup
new_planting.garden = new_garden
new_planting.slug = nil # let friendly_id generate a new slug
new_planting.finished = false
new_planting.finished_at = nil
if new_planting.save
redirect_to edit_planting_path(new_planting), notice: 'Planting was successfully transplanted.'
else
# if the save fails, we should probably roll back the finishing of the original planting
@planting.update(finished: false, finished_at: nil)
redirect_to @planting, alert: "There was an error transplanting the planting: #{new_planting.errors.full_messages.to_sentence}"
end
end
private
def update_crop_medians
@@ -107,7 +133,7 @@ class PlantingsController < DataController
:crop_id, :description, :garden_id, :planted_at,
:parent_seed_id,
:quantity, :sunniness, :planted_from, :finished,
:finished_at
:finished_at, :failed
)
end

View File

@@ -6,7 +6,6 @@ class RegistrationsController < Devise::RegistrationsController
prepend_before_action :check_captcha, only: [:create] # Change this to be any actions you want to protect with recaptcha.
def edit
@twitter_auth = current_member.auth('twitter')
@flickr_auth = current_member.auth('flickr')
render "edit"
end

View File

@@ -19,6 +19,10 @@ class SeedsController < DataController
where['parent_planting'] = @planting.id
end
if params[:tradeable_to].present?
where['tradeable_to'] = params[:tradeable_to]
end
@show_all = (params[:all] == '1')
where['finished'] = false unless @show_all

View File

@@ -50,7 +50,6 @@ module ApplicationHelper
uri.query = "&width=#{size}&height=#{size}" if uri.host == 'graph.facebook.com'
# TODO: Assess twitter - https://dev.twitter.com/overview/general/user-profile-images-and-banners
# TODO: Assess flickr - https://www.flickr.com/services/api/misc.buddyicons.html
return uri.to_s

View File

@@ -2,6 +2,7 @@
module ButtonsHelper
include IconsHelper
def garden_plant_something_button(garden, classes: "btn btn-default")
return unless can? :edit, garden
@@ -97,7 +98,7 @@ module ButtonsHelper
end
def planting_finish_button(planting, classes: 'btn btn-default btn-secondary')
return unless can?(:edit, planting) || planting.finished
return unless can?(:edit, planting) || planting.finished || planting.failed
link_to planting_path(slug: planting.slug, planting: { finished: 1 }),
method: :put, class: "#{classes} append-date" do
@@ -105,6 +106,15 @@ module ButtonsHelper
end
end
def planting_failed_button(planting, classes: 'btn btn-default btn-secondary')
return unless can?(:edit, planting) || planting.finished || planting.failed
link_to planting_path(slug: planting.slug, planting: { failed: 1 }),
method: :put, class: "#{classes}" do
finished_icon + ' ' + t('buttons.mark_as_failed')
end
end
def seed_finish_button(seed, classes: 'btn btn-default')
return unless can?(:create, Planting) && seed.active
@@ -122,7 +132,7 @@ module ButtonsHelper
end
def planting_save_seeds_button(planting, classes: 'btn btn-default')
return unless can?(:edit, planting)
return unless can?(:edit, planting) && !planting.failed?
link_to new_planting_seed_path(planting_slug: planting.slug), class: classes do
seed_icon + ' ' + t('buttons.save_seeds')

View File

@@ -43,6 +43,14 @@ module PlantingsHelper
(planting.first_harvest_predicted_at - Time.zone.today).to_i
end
# Returns a list of gardens the planting can be transplanted to
# based on the planting's owner.
def transplantable_gardens_by_owner(planting)
garden_ids = planting.owner.gardens.select(:id).to_a + GardenCollaborator.where(member_id: planting.owner.id).select(:garden_id).to_a
Garden.active.where.not(id: planting.garden_id).where(id: garden_ids)
end
def days_from_now_to_last_harvest(planting)
return unless planting.planted_at.present? && planting.last_harvest_predicted_at.present?

View File

@@ -111,6 +111,10 @@ class Ability
can :update, Planting do |planting|
planting.garden.garden_collaborators.where(member_id: member.id).any?
end
can :transplant, Planting, garden: { owner_id: member.id }
can :transplant, Planting do |planting|
planting.garden.garden_collaborators.where(member_id: member.id).any?
end
can :destroy, Planting do |planting|
planting.garden.garden_collaborators.where(member_id: member.id).any?
end

View File

@@ -5,6 +5,7 @@ class AlternateName < ApplicationRecord
belongs_to :creator, class_name: 'Member', inverse_of: :created_alternate_names
validates :name, presence: true
validates :crop, presence: true
validates :language, presence: true
after_commit :reindex

View File

@@ -2,26 +2,27 @@
class Comment < ApplicationRecord
belongs_to :author, class_name: 'Member', inverse_of: :comments
belongs_to :post, counter_cache: true
belongs_to :commentable, polymorphic: true, counter_cache: true
# validates :body, presence: true
scope :post_order, -> { order(created_at: :asc) } # for display on post page
after_create do
recipient = post.author.id
recipient = commentable.author.id
sender = author.id
# don't send notifications to yourself
if recipient != sender
Notification.create(
recipient_id: recipient,
sender_id: sender,
subject: "#{author} commented on #{post.subject}",
subject: "#{author} commented on #{commentable.subject}",
body:,
post_id: post.id
notifiable: commentable
)
end
end
def to_s
"#{author.login_name} commented on #{post.subject}"
"#{author.login_name} commented on #{commentable.subject}"
end
end

View File

@@ -8,7 +8,12 @@ module Finishable
scope :current, -> { where.not(finished: true) }
def active
!finished
# Plantings can fail. At the moment, activities and seeds cannot.
if respond_to?(:failed)
!finished && !failed
else
!finished
end
end
end
end

View File

@@ -4,10 +4,6 @@ module OpenFarmData
extend ActiveSupport::Concern
included do
def update_openfarm_data!
OpenfarmService.new.update_crop(self)
end
def of_photo
fetch_attr('main_image_path')
end

View File

@@ -38,7 +38,7 @@ module PredictHarvest
# status
def harvest_time?
return false if crop.perennial || finished
return false if crop.perennial || finished || failed
# We have harvests but haven't finished
harvests.size.positive? ||

View File

@@ -8,12 +8,12 @@ module PredictPlanting
before_save :calculate_lifespan
def calculate_lifespan
self.lifespan = (planted_at.present? && finished_at.present? ? finished_at - planted_at : nil)
self.lifespan = (planted_at.present? && finished_at.present? && !failed? ? finished_at - planted_at : nil)
end
# dates
def finish_predicted_at
if planted_at.blank?
if planted_at.blank? || failed?
nil
elsif crop.median_lifespan.present?
planted_at + crop.median_lifespan.days
@@ -34,15 +34,18 @@ module PredictPlanting
end
def actual_lifespan
return unless planted_at.present? && finished_at.present?
return unless planted_at.present? && finished_at.present? && !failed?
(finished_at - planted_at).to_i
end
def age_in_days
return if planted_at.blank?
return if failed?
known_last_day ||= finished_at || Time.zone.today
known_last_day = Time.zone.today if known_last_day > Time.zone.today
(known_last_day - planted_at).to_i
end
@@ -50,9 +53,9 @@ module PredictPlanting
Rails.cache.fetch("#{cache_key_with_version}/percentage_grown", expires_in: 8.hours) do
if finished?
100
elsif !planted?
elsif !planted? || failed?
0
elsif crop.perennial || finish_predicted_at.nil?
elsif crop.perennial || (finish_predicted_at.nil? && finished_at.nil?) # This covers future dated finished_at that hasn't occurrred yet.
nil
else
calculate_percentage_grown
@@ -71,7 +74,7 @@ module PredictPlanting
end
def late?
crop.annual? && !finished &&
crop.annual? && !finished && !failed &&
planted_at.present? &&
finish_predicted_at.present? &&
finish_predicted_at <= Time.zone.today

View File

@@ -59,7 +59,7 @@ class CsvImporter
alternate_names.split(/,\s*/).each do |name|
altname = AlternateName.find_by(name:, crop: @crop)
altname ||= AlternateName.create! name:, crop: @crop, creator: cropbot
altname ||= AlternateName.create! name:, crop: @crop, language: "EN", creator: cropbot
@crop.alternate_names << altname
end
end

View File

@@ -10,7 +10,8 @@ class Follow < ApplicationRecord
recipient_id: followed_id,
sender_id: follower_id,
subject: "#{follower.login_name} is now following you",
body: "#{follower.login_name} just followed you on #{ENV.fetch('GROWSTUFF_SITE_NAME', nil)}. "
body: "#{follower.login_name} just followed you on #{ENV.fetch('GROWSTUFF_SITE_NAME', nil)}. ",
notifiable: self
)
end
end

View File

@@ -5,6 +5,7 @@ class Garden < ApplicationRecord
include Geocodable
include PhotoCapable
include Ownable
friendly_id :garden_slug, use: %i(slugged finders)
has_many :plantings, dependent: :destroy
@@ -44,6 +45,7 @@ class Garden < ApplicationRecord
.where.not(gardens: { latitude: nil })
.where.not(gardens: { longitude: nil })
}
AREA_UNITS_VALUES = {
"square metres" => "square metre",
"square feet" => "square foot",

View File

@@ -91,6 +91,9 @@ class Member < ApplicationRecord
uniqueness: {
case_sensitive: false
}
validates :website_url, format: { with: /\Ahttps?:\/\//, message: "must start with http:// or https://" }, allow_blank: true
validates :other_url, format: { with: /\Ahttps?:\/\//, message: "must start with http:// or https://" }, allow_blank: true
validates :instagram_handle, :facebook_handle, :bluesky_handle, format: { without: %r{\Ahttps?:\/\/|\/}, message: "should be a handle, not a URL" }, allow_blank: true
#
# Triggers

View File

@@ -3,7 +3,7 @@
class Notification < ApplicationRecord
belongs_to :sender, class_name: 'Member', inverse_of: :sent_notifications
belongs_to :recipient, class_name: 'Member', inverse_of: :notifications
belongs_to :post, optional: true
belongs_to :notifiable, polymorphic: true
validates :subject, length: { maximum: 255 }

View File

@@ -8,6 +8,7 @@ class Photo < ApplicationRecord
PHOTO_CAPABLE = %w(Garden Planting Harvest Seed Post Crop).freeze
has_many :photo_associations, dependent: :delete_all, inverse_of: :photo
has_many :comments, as: :commentable, dependent: :destroy
# This doesn't work, ActiveRecord tries to use the polymoriphic photographable
# relationship instead.
@@ -83,6 +84,14 @@ class Photo < ApplicationRecord
"#{title} by #{owner.login_name}"
end
def subject
title
end
def author
owner
end
def flickr_photo_id
source_id if source == 'flickr'
end

View File

@@ -43,7 +43,8 @@ class Planting < ApplicationRecord
.where.not(gardens: { latitude: nil })
.where.not(gardens: { longitude: nil })
}
scope :active, -> { where('finished <> true').where('finished_at IS NULL OR finished_at < ?', Time.zone.now) }
scope :active, -> { where(finished: false, failed: false).where('finished_at IS NULL OR finished_at < ?', Time.zone.now) }
scope :failed, -> { where(failed: true) }
scope :annual, -> { joins(:crop).where(crops: { perennial: false }) }
scope :perennial, -> { joins(:crop).where(crops: { perennial: true }) }
scope :interesting, -> { has_photos.one_per_owner.order(planted_at: :desc) }
@@ -72,6 +73,7 @@ class Planting < ApplicationRecord
validates :crop, presence: true, approved: { message: "must be present and exist in our database" }
validate :finished_must_be_after_planted
validate :owner_must_match_garden_owner
validate :cannot_be_finished_and_failed
validates :quantity, allow_nil: true, numericality: {
only_integer: true, greater_than_or_equal_to: 0
}
@@ -96,7 +98,11 @@ class Planting < ApplicationRecord
end
def finished?
finished || (finished_at.present? && finished_at <= Time.zone.today)
(finished || (finished_at.present? && finished_at <= Time.zone.today)) && !failed?
end
def failed?
failed
end
def planted?
@@ -120,6 +126,10 @@ class Planting < ApplicationRecord
private
def cannot_be_finished_and_failed
errors.add(:failed, "can't be true if planting is also finished") if finished && failed
end
# check that any finished_at date occurs after planted_at
def finished_must_be_after_planted
return unless planted_at && finished_at # only check if we have both

View File

@@ -3,6 +3,7 @@
class Post < ApplicationRecord
extend FriendlyId
include Likeable
friendly_id :author_date_subject, use: %i(slugged finders)
include PhotoCapable
@@ -10,9 +11,10 @@ class Post < ApplicationRecord
# Relationships
belongs_to :author, class_name: 'Member', inverse_of: :posts
belongs_to :forum, optional: true
has_many :comments, dependent: :destroy
has_many :comments, as: :commentable, dependent: :destroy
has_many :crop_posts, dependent: :delete_all
has_many :crops, through: :crop_posts
has_many :notifications, as: :notifiable, dependent: :destroy
after_create :send_notification
#
@@ -95,6 +97,7 @@ class Post < ApplicationRecord
Notification.create(
recipient_id:,
sender_id: sender,
notifiable: self,
subject: "#{author} mentioned you in their post #{subject}",
body:
)

View File

@@ -59,6 +59,7 @@ class Seed < ApplicationRecord
scope :has_location, -> { joins(:owner).where.not('members.location': nil) }
scope :recent, -> { order(created_at: :desc) }
scope :active, -> { where('finished <> true').where('finished_at IS NULL OR finished_at < ?', Time.zone.now) }
scope :expired, -> { active.where('plant_before < ?', Time.zone.today) }
def tradable
tradable_to != 'nowhere'

View File

@@ -13,6 +13,7 @@ module Api
attribute :slug
attribute :planted_at
attribute :failed
attribute :finished
attribute :finished_at
attribute :quantity
@@ -37,9 +38,7 @@ module Api
filter :finished
attribute :percentage_grown
def percentage_grown
@model.percentage_grown
end
delegate :percentage_grown, to: :@model
attribute :crop_name
attribute :crop_slug

View File

@@ -47,7 +47,7 @@
.row
.col-md-6
= f.check_box :finished, label: 'Mark as finished'
= f.check_box :finished, label: t('buttons.mark_as_finished')
%span.help-block= t('.finish_helper')
.card-footer

View File

@@ -31,7 +31,8 @@
= f.label :name, class: 'control-label col-md-2'
.col-md-8
= f.text_field :name, class: 'form-control'
.col-md-8
= f.select :language, I18nData.languages.map {|code, name| [name.split(";").first, code] }, class: 'form-control'
.form-group
.form-actions.col-md-offset-2.col-md-8
= f.submit 'Save', class: 'btn btn-primary'

View File

@@ -1,12 +1,11 @@
%a{ name: "comments" }
- if post.comments
- if commentable.comments
%hr/
%h2
= comment_icon
= localize_plural(post.comments, Comment)
- post.comments.post_order.each do |comment|
= localize_plural(commentable.comments, Comment)
- commentable.comments.post_order.each do |comment|
= render "comments/single", comment: comment
- else
%h2 There are no comments yet

View File

@@ -1 +1 @@
#{link_to 'commented', event_model} on #{link_to event_model.post, event_model.post}
#{link_to 'commented', event_model} on #{link_to event_model.commentable, event_model.commentable}

View File

@@ -1,3 +1,4 @@
- @comment ||= Comment.new(commentable: @commentable)
.card.col-md-8.col-lg-7.mx-auto.float-none.white.z-depth-1.py-2.px-2
.card-body
- if content_for? :title
@@ -14,13 +15,13 @@
%li= msg
.md-form
= f.text_area :body, rows: 6, class: 'form-control md-textarea', autofocus: 'autofocus'
= f.text_area :body, rows: 6, class: 'form-control md-textarea', autofocus: 'autofocus', required: true, pattern: '\w+'
= f.label :body, "Your comment:"
%span.help-block
= render partial: "shared/markdown_help"
.actions.text-right
= f.submit 'Post comment', class: 'btn btn-primary'
- if defined?(@post)
.field
= f.hidden_field :post_id, value: @post.id
.field
= f.hidden_field :commentable_id, value: @commentable.id
= f.hidden_field :commentable_type, value: @commentable.class.name

View File

@@ -2,6 +2,6 @@
%p
Editing comment on
= link_to @comment.post.subject, @comment.post
= link_to @comment.commentable.subject, @comment.commentable
= render 'form'
= render 'form', locals: { comment: @comment, commentable: @comment.commentable }

View File

@@ -5,17 +5,18 @@
%link= comments_url
- @comments.each do |comment|
%item
%title Comment by #{comment.author.login_name} on #{comment.post.subject}
%title Comment by #{comment.author.login_name} on #{comment.commentable.subject}
%description
:escaped_markdown
<p>
Comment on
#{ link_to comment.post.subject, post_url(comment.post) }
#{ link_to comment.commentable.subject, polymorphic_url(comment.commentable) }
</p>
:escaped_markdown
#{ strip_tags markdownify(comment.body) }
%pubdate= comment.created_at.to_fs(:rfc822)
%link= post_url(comment.post)
%link= polymorphic_url(comment.commentable)
%guid= comment_url(comment)

View File

@@ -1,11 +1,17 @@
= content_for :title, "New comment"
- if @commentable.is_a?(Post)
%section.blog-post
.card.post{ id: "post-#{@commentable.id}" }
.card-header
%h2.display-3= @commentable.subject
.card-body= render "posts/single", post: @commentable || @comment.commentable, subject: true
- elsif @commentable.is_a?(Photo)
%section.blog-post
.card.photo{ id: "photo-#{@commentable.id}" }
.card-header
%h2.display-3= @commentable.subject
.card-body= render "photos/card", photo: @commentable || @comment.commentable, subject: true
%section.blog-post
.card.post{ id: "post-#{@post.id}" }
.card-header
%h2.display-3= @post.subject
.card-body= render "posts/single", post: @post || @comment.post, subject: true
= render partial: "comments/comments", locals: { commentable: @commentable || @comment.commentable }
= render partial: "posts/comments", locals: { post: @post || @comment.post }
= render 'form'
= render 'form', locals: { comment: @comment, commentable: @commentable || @comment.commentable }

View File

@@ -5,7 +5,7 @@
- if can? :edit, an
.dropdown.planting-actions
%a#crop-actions-altnames.dropdown-toggle{"aria-expanded" => "false", "aria-haspopup" => "true", "data-bs-toggle" => "dropdown", :type => "button", :href => '#'}
= an.name
= "#{an.name} (#{an.language})"
.dropdown-menu.dropdown-menu-xs{"aria-labelledby" => "crop-actions-altnames"}
- if can? :edit, an
= link_to edit_alternate_name_path(an), class: 'dropdown-item' do
@@ -16,7 +16,7 @@
= delete_icon
= t('.delete')
- else
.badge= an.name
.badge= "#{an.name} (#{an.language})"
%p.text-right

View File

@@ -10,10 +10,6 @@
= edit_icon
= t('.edit')
= link_to crop_openfarm_path(crop), method: :post, class: 'dropdown-item' do
= icon 'far', 'update'
Fetch data from OpenFarm
= link_to crop_gbif_path(crop), method: :post, class: 'dropdown-item' do
= icon 'far', 'update'
Fetch data from GBIF

View File

@@ -147,6 +147,14 @@
= icon 'fas', 'external-link-alt'
Google
%li.list-group-item
= link_to 'https://chat.openai.com/?model=gpt-4o&prompt=' + CGI.escape(['How do I grow', @crop.name, "and what grows well with it? What should I plant the next season if practicing crop rotation? Explain why and add links to your sources"].join(' ')),
target: "_blank",
class: 'card-link',
rel: "noopener noreferrer" do
= icon 'fas', 'external-link-alt'
ChatGPT
%li.list-group-item
= link_to "https://wikihow.com/wikiHowTo?search=#{CGI.escape "grow #{@crop.name}" }",
target: "_blank",

View File

@@ -3,19 +3,6 @@
html: { method: :put, class: 'form-horizontal' }) do |_f|
%br/
= render 'devise/shared/error_messages', resource: resource
.row
.col-md-12
%p
= image_tag "twitter_32.png", size: "32x32", alt: 'Twitter logo'
- if @twitter_auth
You are connected to Twitter as
= link_to @twitter_auth.name, "https://twitter.com/#{@twitter_auth.name}"
= link_to "Disconnect", @twitter_auth,
confirm: "Are you sure you want to remove this connection?",
method: :delete, class: "remove btn btn-danger"
- else
= link_to 'Connect to Twitter', '/members/auth/twitter', class: 'btn'
.row
.col-md-12
%p

View File

@@ -13,7 +13,32 @@
.form-group
= f.label :bio, class: 'control-label col-md-2'
.col-md-8
= f.text_area :bio, rows: 6, class: 'form-control'
= f.text_area :bio, rows: 6, class: 'form-control', placeholder: "I'm am XYZ gardener interested in A, B, C"
.form-group
= f.label :website_url, 'Website', class: 'control-label col-md-2'
.col-md-8
= f.url_field :website_url, class: 'form-control', placeholder: "https://you.example.com/"
.form-group
= f.label :instagram_handle, 'Instagram', class: 'control-label col-md-2'
.col-md-8
= f.text_field :instagram_handle, class: 'form-control', placeholder: 'your_handle'
.form-group
= f.label :facebook_handle, 'Facebook', class: 'control-label col-md-2'
.col-md-8
= f.text_field :facebook_handle, class: 'form-control', placeholder: 'your_handle'
.form-group
= f.label :bluesky_handle, 'Bluesky', class: 'control-label col-md-2'
.col-md-8
= f.text_field :bluesky_handle, class: 'form-control', placeholder: 'your_handle'
.form-group
= f.label :other_url, 'Other URL', class: 'control-label col-md-2'
.col-md-8
= f.url_field :other_url, class: 'form-control', placeholder: "https://you.example.com/"
.form-group
%label.control-label.col-md-2

View File

@@ -51,7 +51,8 @@
%section.seeds
= cute_icon
= render 'seeds'
%p.text-right= link_to "#{t('home.seeds.view_all')} »", seeds_path, class: 'btn btn-block'
%p.text-right
= link_to "#{t('home.seeds.view_all')} »", seeds_path(tradeable_to: ['locally', 'nationally', 'internationally']), class: 'btn btn-block'
.col-12.col-lg-6
%section.discussion.text-center
= cute_icon

View File

@@ -1,13 +1 @@
%h2 All about #{member.login_name}
%p
%small
%a{href: "#content"}
Skip to main content
- if member.bio.blank?
- if can? :edit, member
= link_to "Add a bio to complete your profile.", edit_member_registration_path
- else
#{member.login_name} hasn't written a bio yet.
- else
:markdown
#{ strip_tags markdownify(member.bio) }

View File

@@ -1,17 +1,37 @@
- if twitter_auth || flickr_auth || member.show_email
- if member.website_url.present? || member.instagram_handle.present? || member.facebook_handle.present? || member.bluesky_handle.present? || member.other_url.present? || flickr_auth || member.show_email
%h4 Contact
- if twitter_auth
- if member.website_url.present?
%p
= image_tag "twitter_32.png", size: "32x32", alt: 'Twitter logo'
= link_to twitter_auth.name, "https://twitter.com/#{twitter_auth.name}"
= icon 'fas', 'globe', class: 'fa-fw'
= link_to "Website", member.website_url, target: '_blank', rel: 'noopener noreferrer'
- if member.instagram_handle.present?
%p
= icon 'fab', 'instagram', class: 'fa-fw'
= link_to member.instagram_handle, "https://instagram.com/#{member.instagram_handle}", target: '_blank', rel: 'noopener noreferrer'
- if member.facebook_handle.present?
%p
= icon 'fab', 'facebook', class: 'fa-fw'
= link_to member.facebook_handle, "https://facebook.com/#{member.facebook_handle}", target: '_blank', rel: 'noopener noreferrer'
- if member.bluesky_handle.present?
%p
= icon 'fas', 'comment-dots', class: 'fa-fw'
= link_to member.bluesky_handle, "https://bsky.app/profile/#{member.bluesky_handle}", target: '_blank', rel: 'noopener noreferrer'
- if member.other_url.present?
%p
= icon 'fas', 'link', class: 'fa-fw'
= link_to "More...", member.other_url, target: '_blank', rel: 'noopener noreferrer'
- if flickr_auth
%p
= image_tag "flickr_32.png", size: "32x32", alt: 'Flickr logo'
= link_to flickr_auth.name, "https://flickr.com/photos/#{flickr_auth.uid}"
= link_to flickr_auth.name, "https://flickr.com/photos/#{flickr_auth.uid}", target: '_blank', rel: 'noopener noreferrer'
- if member.show_email
%p
Email:
= icon 'fas', 'envelope', class: 'fa-fw'
= mail_to member.email

View File

@@ -5,5 +5,5 @@
= link_to member.location, place_path(member.location, anchor: "members")
- else
.location-not-set
.sr-only Location not known
.sr-only We can't show you what's nearby
%h1 Location not known or geocodable
%p We can't show you what's nearby

View File

@@ -21,6 +21,21 @@
.row
.col= render "bio", member: @member
.col= render "avatar", member: @member
.row
.col
%p
%small
%a{href: "#content"}
Skip to main content
- if @member.bio.blank?
- if can? :edit, @member
= link_to "Add a bio to complete your profile.", edit_member_registration_path
- else
#{@member.login_name} hasn't written a bio yet.
- else
:markdown
#{ strip_tags markdownify(@member.bio) }
- if @member.roles.any?
%p
- @member.roles.each do |role|
@@ -30,12 +45,16 @@
= icon 'fas', 'map-marker'
= truncate(@member.location, length: 15, separator: ' ', omission: '... ')
%p
%strong Member since
= @member.created_at.to_fs(:date)
%small
%strong Member since
%br
= @member.created_at.to_fs(:date)
- if @member.last_sign_in_at
%p
%strong Last Login
= @member.last_sign_in_at&.to_fs(:default)
%small
%strong Last Login
%br
= @member.last_sign_in_at&.to_fs(:default)
- if can? :update, @member
= link_to edit_member_registration_path, class: 'btn btn-block' do
@@ -58,8 +77,7 @@
= render "stats", member: @member
.card-footer
= render "contact", member: @member, twitter_auth: @twitter_auth,
flickr_auth: @flickr_auth
= render "contact", member: @member, flickr_auth: @flickr_auth
.col-md-10#content
.row

View File

@@ -46,4 +46,12 @@
- else
= @photo.license_name
= render "associations", photo: @photo
= render "associations", photo: @photo
.row
- if can? :create, Comment
= link_to new_comment_path(comment: { commentable_type: 'Photo', commentable_id: @photo.id }), class: 'btn' do
= icon 'fas', 'comment'
Comment
.row
.col-md-9
= render 'comments/comments', commentable: @photo

View File

@@ -7,7 +7,16 @@
- if planting.active
= planting_plan_something_button(planting, classes: 'dropdown-item')
= planting_finish_button(planting, classes: 'dropdown-item')
= planting_failed_button(planting, classes: 'dropdown-item')
= planting_harvest_button(planting, classes: 'dropdown-item')
= planting_save_seeds_button(planting, classes: 'dropdown-item')
- if can?(:transplant, planting) && planting.active && transplantable_gardens_by_owner(planting).any?
.dropdown-divider
.px-2
= form_tag transplant_planting_path(planting), method: :post do
.form-group
= label_tag :garden_id, 'Transplant to:'
= select_tag :garden_id, options_from_collection_for_select(transplantable_gardens_by_owner(planting), :id, :name), class: 'form-control form-control-sm'
= submit_tag 'Transplant', class: 'btn btn-sm btn-primary mt-2'
.dropdown-divider
= delete_button(planting, classes: 'dropdown-item text-danger')

View File

@@ -19,6 +19,7 @@
- if planting.active
= planting_finish_button(planting, classes: 'dropdown-item')
= planting_failed_button(planting, classes: 'dropdown-item')
= planting_harvest_button(planting, classes: 'dropdown-item')
= planting_save_seeds_button(planting, classes: 'dropdown-item')

View File

@@ -1,13 +1,14 @@
%h2 Seeds saved
%a.btn.dropdown-toggle{"aria-expanded" => "false", "aria-haspopup" => "true", "data-bs-toggle" => "dropdown", role: "button"}
= seed_icon
= t('buttons.save_seeds')
.dropdown-menu.dropdown-secondary
- Seed::TRADABLE_TO_VALUES.each do |trade|
= link_to seeds_path(return: 'planting', seed: {crop_id: planting.crop.id, parent_planting_id: planting.id, tradable_to: trade}), method: :post, class: 'dropdown-item' do
Will trade:
= trade
- if can?(:edit, planting) && !planting.failed?
%a.btn.dropdown-toggle{"aria-expanded" => "false", "aria-haspopup" => "true", "data-bs-toggle" => "dropdown", role: "button"}
= seed_icon
= t('buttons.save_seeds')
.dropdown-menu.dropdown-secondary
- Seed::TRADABLE_TO_VALUES.each do |trade|
= link_to seeds_path(return: 'planting', seed: {crop_id: planting.crop.id, parent_planting_id: planting.id, tradable_to: trade}), method: :post, class: 'dropdown-item' do
Will trade:
= trade
- if planting.child_seeds.size.positive?
.index-cards

View File

@@ -40,7 +40,7 @@
- if planting.quantity.to_i.positive? && planting.planted_from.present?
= planting.planted_from.pluralize(planting.quantity.to_i)
- unless planting.finished?
- unless planting.finished? || planting.failed?
.card.fact-card.grid-sizer
%h3 Growing
%strong= seedling_icon

View File

@@ -34,9 +34,7 @@
.col-md-4
= f.text_field :planted_at,
value: @planting.planted_at ? @planting.planted_at.to_fs(:ymd) : '',
class: 'add-datepicker', label: 'When?'
%span.help-inline
Tip: Plan our your future plantings by forward dating, and subscribe to your iCalendar feed for reminders to plant
class: 'add-datepicker', label: 'When?', title: "Plan out your future plantings by forward dating, and subscribe to your iCalendar feed for reminders to plant"
.row
.col-md-4
@@ -49,14 +47,17 @@
.row
.col-md-6
= f.check_box :finished, label: 'Mark as finished'
%span.help-block= t('.finish_helper')
= f.check_box :finished, label: t('buttons.mark_as_finished'), title: t('.finish_helper')
.col-md-6
= f.text_field :finished_at,
value: @planting.finished_at ? @planting.finished_at.to_fs(:ymd) : '',
class: 'add-datepicker',
label: 'Finished date',
placeholder: 'optional'
.row
.col-md-6
= f.check_box :failed, label: t('buttons.mark_as_failed'), title: t('.failed_helper')
.card-footer
.text-right= f.submit 'Save'

View File

@@ -1,10 +1,9 @@
%h2 Harvests
- if can? :edit, planting
- if can?(:edit, planting) && !planting.failed
= render 'harvests/modal', harvest: Harvest.new(crop: planting.crop, planting: planting)
- if planting.harvests.empty?
%p No harvests recorded
- if !planting.finished? && can?(:edit, planting) && can?(:create, Harvest)
- if planting.finished? && can?(:edit, planting) && can?(:create, Harvest)
%p Record your harvests here to improve crop predictions, and you'll be able to compare with your garden next season.
- else
.index-cards

View File

@@ -8,6 +8,8 @@
%p.small #{harvest_icon} First harvest expected #{I18n.l planting.first_harvest_predicted_at}
- if planting.finished_at.present?
%p.small #{finished_icon} Finished #{I18n.l planting.finished_at}
- elsif planting.failed?
%p.small #{finished_icon} Failed
- elsif planting.finish_predicted_at.present?
%p.small #{finished_icon} Finish expected #{I18n.l planting.finish_predicted_at}
- if planting.planted_at.present? && planting.expected_lifespan.present?

View File

@@ -32,8 +32,10 @@
%strong= @planting.crop.name.titleize
%small.text-muted= @planting.crop.default_scientific_name
%tt
- if @planting.finished?
Finished
- if @planting.failed?
%span.badge.badge-danger Failed
- elsif @planting.finished?
%span.badge.badge-success Finished
- elsif @planting.percentage_grown.present?
#{@planting.percentage_grown.to_i}%
- if @planting.finish_is_predicatable?

View File

@@ -1,3 +1,4 @@
- @post ||= post if defined?(post)
%p
Posted by
- if @post.author
@@ -13,7 +14,7 @@
and edited at
= @post.updated_at.to_fs(:default)
= link_to "Permalink", post
= link_to "Permalink", @post
:markdown
#{ strip_tags markdownify(@post.body) }

View File

@@ -24,7 +24,7 @@
- content_for :buttonbar do
- if @post.comments.count > 10 && can?(:create, Comment)
= link_to 'Comment', new_comment_path(post_id: @post.id), class: 'btn'
= link_to 'Comment', new_comment_path(comment: { commentable_type: 'Post', commentable_id: @post.id }), class: 'btn'
- content_for :breadcrumbs do
%li.breadcrumb-item= link_to @post.author, @post.author
@@ -48,12 +48,12 @@
= render 'likes/likes', object: @post
.float-right
- if can? :create, Comment
= link_to new_comment_path(post_id: @post.id), class: 'btn' do
= link_to new_comment_path(comment: { commentable_type: 'Post', commentable_id: @post.id }), class: 'btn' do
= icon 'fas', 'comment'
Comment
%section.comments
= render "comments", post: @post
= render "comments/comments", commentable: @post
.col-md-4.col-12
= render @post.author

View File

@@ -38,7 +38,7 @@
.row
.col-12.col-md-4
= f.check_box :finished, label: 'Mark as finished'
= f.check_box :finished, label: t('buttons.mark_as_finished')
.col-12.col-md-4
= f.text_field :finished_at, class: 'add-datepicker', value: @seed.finished_at ? @seed.finished_at.to_fs(:ymd) : ''
.col-12.col-md-4

View File

@@ -17,6 +17,14 @@
= check_box_tag 'active', 'all', @show_all
include finished
%hr/
%section.filters
%h2 Tradeable
%ul.nav.flex-column
%li.nav-item= link_to "All tradable seeds", seeds_path(tradeable_to: ['locally', 'nationally', 'internationally'])
- Seed::TRADABLE_TO_VALUES.each do |value|
- unless value == 'nowhere'
%li.nav-item= link_to value.capitalize, seeds_path(tradeable_to: value)
%hr/
- if @owner
= render @owner
- if @crop

View File

@@ -5,7 +5,7 @@ Mailboxer.setup do |config|
config.uses_emails = true
# Configures the default from for emails sent for Messages and Notifications
config.default_from = "no-reply@growstuff.org"
config.default_from = "Growstuff <#{ENV.fetch('GROWSTUFF_EMAIL', "no-reply@growstuff.org")}>"
# Configures the methods needed by mailboxer
# config.email_method = :email

View File

@@ -1,6 +1,5 @@
# frozen_string_literal: true
Rails.application.config.middleware.use OmniAuth::Builder do
provider :twitter, ENV.fetch('GROWSTUFF_TWITTER_KEY', nil), ENV.fetch('GROWSTUFF_TWITTER_SECRET', nil)
provider :flickr, ENV.fetch('GROWSTUFF_FLICKR_KEY', nil), ENV.fetch('GROWSTUFF_FLICKR_SECRET', nil), scope: 'read'
end

View File

@@ -78,6 +78,7 @@ en:
harvest_crop: Harvest %{crop_name}
mark_as_active: Mark as active
mark_as_finished: Mark as finished
mark_as_failed: Mark as failed
mark_as_inactive: Mark as inactive
my_gardens: My Gardens
new_seeds: New saved seed
@@ -307,6 +308,8 @@ en:
finish_helper: >
A planting is finished when you've harvested all of the crop, or it dies, or it's otherwise
no longer growing in your garden.
failed_helper: >
Mark this planting as failed if it died or was removed without any harvest.
index:
title:
crop_plantings: Everyone's %{crop} plantings

View File

@@ -0,0 +1,7 @@
en:
mailboxer:
message_mailer:
subject_new: "New Notification: %{subject}"
subject_reply: "New Reply: %{subject}"
notification_mailer:
subject: "New notification: %{subject}"

View File

@@ -40,6 +40,9 @@ Rails.application.routes.draw do
collection do
get 'crop/:crop' => 'plantings#index', as: 'plantings_by_crop'
end
member do
post :transplant
end
end
resources :seeds, concerns: :has_photos, param: :slug do
@@ -78,7 +81,6 @@ Rails.application.routes.draw do
get 'sunniness' => 'charts/crops#sunniness', constraints: { format: 'json' }
get 'planted_from' => 'charts/crops#planted_from', constraints: { format: 'json' }
get 'harvested_for' => 'charts/crops#harvested_for', constraints: { format: 'json' }
post :openfarm
post :gbif
collection do

22
crowdin.yml Normal file
View File

@@ -0,0 +1,22 @@
# Hi there!
#
# This is a configuration file for the Crowdin CLI.
# You'll need to replace the placeholder project_id with your actual
# project ID from CrowdIn.
#
# For more information, see the Crowdin CLI documentation:
# https://support.crowdin.com/enterprise/cli-v3/
#
project_id: "your-project-id"
api_token_env: "CROWDIN_API_TOKEN"
base_path: "."
files:
- source: '/config/locales/en.yml'
translation: '/config/locales/%two_letters_code%.yml'
# The 'ignore' property is used to exclude files from processing.
# We are ignoring the existing Japanese translation file.
ignore:
- '/config/locales/ja.yml'
- source: '/config/locales/*.en.yml'
translation: '/config/locales/%file_name%.%two_letters_code%.yml'

View File

@@ -0,0 +1,9 @@
class AddSocialMediaToMembers < ActiveRecord::Migration[6.0]
def change
add_column :members, :website_url, :string
add_column :members, :instagram_handle, :string
add_column :members, :facebook_handle, :string
add_column :members, :bluesky_handle, :string
add_column :members, :other_handle, :string
end
end

View File

@@ -0,0 +1,5 @@
class RenameOtherHandleToOtherUrlInMembers < ActiveRecord::Migration[6.0]
def change
rename_column :members, :other_handle, :other_url
end
end

View File

@@ -0,0 +1,7 @@
# frozen_string_literal: true
class AddLanguageToAlternateNames < ActiveRecord::Migration[7.2]
def change
add_column :alternate_names, :language, :string, null: false
end
end

View File

@@ -0,0 +1,11 @@
# frozen_string_literal: true
class SetDefaultLanguageForExistingAlternateNames < ActiveRecord::Migration[7.2]
def up
AlternateName.update_all(language: 'en')
end
def down
AlternateName.update_all(language: nil)
end
end

View File

@@ -0,0 +1,14 @@
class MakeNotificationsPolymorphic < ActiveRecord::Migration[6.1]
def change
add_column :notifications, :notifiable_type, :string
rename_column :notifications, :post_id, :notifiable_id
reversible do |dir|
dir.up do
ActiveRecord::Base.connection.execute("UPDATE notifications SET notifiable_type = 'Post' WHERE notifiable_type IS NULL")
end
end
add_index :notifications, %i(notifiable_type notifiable_id)
end
end

View File

@@ -0,0 +1,14 @@
class ChangeCommentsPolymorphic < ActiveRecord::Migration[7.2]
def change
add_column :comments, :commentable_type, :string
rename_column :comments, :post_id, :commentable_id
add_index :comments, %i(commentable_type commentable_id)
reversible do |dir|
dir.up do
ActiveRecord::Base.connection.execute("UPDATE comments SET commentable_type = 'Post' WHERE commentable_type IS NULL")
end
end
end
end

View File

@@ -0,0 +1,24 @@
# frozen_string_literal: true
class AddPhotosCommentCount < ActiveRecord::Migration[7.2]
def change
change_table :photos do |t|
t.integer :comments_count, default: 0
end
reversible do |dir|
dir.up { set_counter_value }
end
end
def set_counter_value
execute <<-SQL.squish
UPDATE photos
SET comments_count = (
SELECT count(1)
FROM comments
WHERE comments.commentable_id = comments.id
AND comments.commentable_type = 'Photo'
)
SQL
end
end

View File

@@ -0,0 +1,7 @@
# frozen_string_literal: true
class AddFailedToPlantings < ActiveRecord::Migration[6.0]
def change
add_column :plantings, :failed, :boolean, default: false, null: false
end
end

View File

@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema[7.2].define(version: 2024_09_29_041435) do
ActiveRecord::Schema[7.2].define(version: 2025_08_24_162600) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@@ -67,6 +67,7 @@ ActiveRecord::Schema[7.2].define(version: 2024_09_29_041435) do
t.integer "creator_id", null: false
t.datetime "created_at", precision: nil
t.datetime "updated_at", precision: nil
t.string "language"
end
create_table "authentications", id: :serial, force: :cascade do |t|
@@ -202,11 +203,12 @@ ActiveRecord::Schema[7.2].define(version: 2024_09_29_041435) do
end
create_table "comments", id: :serial, force: :cascade do |t|
t.integer "post_id", null: false
t.integer "commentable_id", null: false
t.integer "author_id", null: false
t.text "body", null: false
t.datetime "created_at", precision: nil
t.datetime "updated_at", precision: nil
t.string "commentable_type"
end
create_table "crop_companions", force: :cascade do |t|
@@ -446,6 +448,11 @@ ActiveRecord::Schema[7.2].define(version: 2024_09_29_041435) do
t.integer "photos_count"
t.integer "forums_count"
t.integer "activities_count"
t.string "website_url"
t.string "instagram_handle"
t.string "facebook_handle"
t.string "bluesky_handle"
t.string "other_url"
t.index ["confirmation_token"], name: "index_members_on_confirmation_token", unique: true
t.index ["discarded_at"], name: "index_members_on_discarded_at"
t.index ["email"], name: "index_members_on_email", unique: true
@@ -465,9 +472,11 @@ ActiveRecord::Schema[7.2].define(version: 2024_09_29_041435) do
t.string "subject"
t.text "body"
t.boolean "read", default: false
t.integer "post_id"
t.integer "notifiable_id"
t.datetime "created_at", precision: nil
t.datetime "updated_at", precision: nil
t.string "notifiable_type"
t.index ["notifiable_type", "notifiable_id"], name: "index_notifications_on_notifiable_type_and_notifiable_id"
end
create_table "orders_products", id: false, force: :cascade do |t|
@@ -500,6 +509,7 @@ ActiveRecord::Schema[7.2].define(version: 2024_09_29_041435) do
t.datetime "date_taken", precision: nil
t.integer "likes_count", default: 0
t.string "source"
t.integer "comments_count", default: 0
t.index ["fullsize_url"], name: "index_photos_on_fullsize_url", unique: true
t.index ["thumbnail_url"], name: "index_photos_on_thumbnail_url", unique: true
end
@@ -543,6 +553,7 @@ ActiveRecord::Schema[7.2].define(version: 2024_09_29_041435) do
t.integer "parent_seed_id"
t.integer "harvests_count", default: 0
t.integer "likes_count", default: 0
t.boolean "failed", default: false, null: false
t.index ["slug"], name: "index_plantings_on_slug", unique: true
end

Some files were not shown because too many files have changed in this diff Show More