Commit Graph

83 Commits

Author SHA1 Message Date
google-labs-jules[bot]
449ab1f6c0 Add ability to create companion plantings
This change adds the ability for crop wranglers to create and manage companion plantings for crops.

- Adds a `source_url` to the `CropCompanion` model to store an optional reference URL.
- Restricts the management of companion plantings to users with the `crop_wrangler` role.
- Creates a new admin interface for managing companion plantings for a specific crop.
- Updates the crop show page to display companions from both the crop and its parent crop.
2025-09-21 00:49:11 +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
Daniel O'Connor
1c97ba1495 Garden collaboration (small part of community gardens) (#3862)
* Add collaboration model

* Permissions and garden show

* List by owner, or where I am a collaborator

* Add index

* Add permissions

* Typo

* Typo

* Add route

* Update schema

* Update schema

* Add CRUD

* Add CRUD

* Add CRUD

* Factory

* Add validations

* Rubocop

* Rubocop

* Rubocop

* Unique index

* Fix

* Make CI more fine grained for faster feedback

* Swap order

* Fix path, fail-fast

* Fix spec

* Remove 'significant drop in coverage' as not everything runs in one giant run

* Fix tests?
2024-09-29 18:28:52 +09:30
Daniel O'Connor
725c146e2d Improve profile page on mobile (#3711)
* Avoid showing when there are 0 things

* Styling

* Styling

* Collapse stats by default on small screens

* Add ARIA skip links

* Refactoring out of partial, and use CSS to set order on mobile

* Remove partial

* Update expectations

* Fix visual appearance on Ban button on your own profile for admins

* Typo

* Stale expectation
2024-04-07 21:43:52 +09:30
Daniel O'Connor
5be0153c74 Activities (#3646)
* Implement activities

* Add activities to timeline

* Add factory

* Add coverage

* Fix misc issues

* Activities display

* Add activities to garden and plantings

* Add activities to garden and plantings

* Add planting

* Add to planting, harvest show

* More CRUD

* More CRUD

* index

* index

* Extract card view

* Permissions

* Add edit

* Remove workaround fro vs code

* Fix title

* CSV

* CSV

* Add RSS, ical

* Extend ical slightly

* Cleanup

* Rubocop

* Remove doubled form

* Change icon

* Fix short description

* Add menus

* Put homepage widget in

* Add activity icon - MIT licenced - https://www.svgrepo.com/svg/336823/plan

* Naming

* Missing files

* Revert VS Code lag induced change

* Update app/views/home/_harvests.html.haml

* Update activities_controller.rb

* Update activities_controller.rb

* Update app/controllers/activities_controller.rb

* Update index.html.haml

* Apply suggestions from code review

* Apply suggestions from code review

* Typo

* Translation

* Apply suggestions from code review

* Update app/views/plantings/index.ics.erb

* Update app/models/activity.rb

* Update plantings_spec.rb

* Update plantings_spec.rb

* We are now rendering an extra event, so check the next one for the old behaviour
2024-03-10 11:36:24 +10:30
Daniel O'Connor
1f0cfa9b6c Add GBIF to our scientific names, so that our crops can associate creative commons photos (#3559)
* Add GBIF cient

* Add lookup

* Add autocomplete for GBIF lookup

* Add extra detail to scientific names

* Autocomplete

* Add routes

* Rmeove mapping

* Add autocomplete

* Update GBIF data on save

* db/schema

* Style

* Extract service

* Add concern

* Add concern

* Save photos

* Initial coverage

* Coverage

* Add coverage

* Shut up, codeclimate

* Shut up, codeclimate

* Unused

* Shut up, codeclimate

* Apply suggestions from code review

* Remove localhost

* Fix rubocop

* Fix rubocop

* Add UI links

* Add rake

* Indent

* Update Gemfile.lock

* Update lib/tasks/gbif.rake

* Update app/views/crops/_scientific_names.html.haml

* Rubocop

* Expand edit photo form

* Fix error

* Add model validations

* Skip photos without backlinks

* Fix tests

* Add photo words

* Allow blank

* Rubocop and handle invalid legacy data

* Apply suggestions from code review

* Update lib/tasks/gbif.rake
2024-01-21 13:22:25 +10:30
Daniel O'Connor
a8b8a58f33 Various rspec autocorrections 2022-11-08 00:09:50 +10:30
Awesome Code
5816b13244 Auto corrected by following Lint Ruby Lint/RedundantCopDisableDirective 2020-05-23 07:48:28 +12:00
Brenda
7257b2ada1 Update with frozen literals 2020-01-10 16:50:52 +13:00
Brenda Wallace
7b5698f977 👩‍🌾 Import openfarm data (#2177)
* Pull in openfarm icons, photos, info
* Truncating member location
* tidying up harvest display, and reducing duplication in css styles
* Tiny crop chip
* only show crop charts if there is data to show
* Make the styles more Growstuff
* Fixed links to openfarm
* Updating specs to cope with new photo sources
fix broken garden timeline on some pages
* Update homepage blurb
* Import crop companions
* More fluid page
* use thumbnail unless the source is flickr
* Messing with homepage
* Added crop growing_degree_days
* expect full size url on photos helper spec
* formatted dates from seeds#show
* tidy up places#show
* Move progress bar
* Quicker buttons for approve/reject crops
* Remove kaminari gem
* use crop cards on hierarchy page
* more crops on crops#index
* Wrap photo creation in transaction
* Wrap crop companions in a transaction
2019-09-28 17:23:25 +12:00
Brenda Wallace
5ded29ef7c Allow anyone to view followers - and tidy up display
fixes #2106
2019-08-31 14:25:31 +12:00
Brenda Wallace
5395aefa66 Rename containers to garden types 2019-03-26 20:56:11 +13:00
Brandon Baker
02174a0acb builds views for containers 2018-11-30 11:56:58 -07:00
Brandon Baker
c898a958a5 adds container to garden form 2018-11-29 12:51:15 -07:00
Brenda Wallace
f9d4e1d6ae Ancestry of food. Seeds -> Planting -> Seeds -> Planting (#1550)
* Add seed ancestry, and seeds.finished_at
* Plantings and seeds produce each other
* Permissions for seeds actions
* View update, for seed actions, and planting ancestry
* Routes for seeds
* Scopes for harvests
* Spec updates for seeds
* Removed in-line style
* Add seed ancestry, and seeds.finished_at
* Plantings and seeds produce each other
* Permissions for seeds actions
* View update, for seed actions, and planting ancestry
* Routes for seeds
* Scopes for harvests
* Spec updates for seeds
* Moved finishable to a concern
* Seeds.finished_at
* rubocop fixes
* Made seeds sown migration the most recent
* Specs for home page
* Only show current seeds on home page
* Seeds appear for logged in or not
* Buttons to mark seeds finished
* JS for marking seeds finished
* Some actions only appear if seed or planting is active
* Fixed up display of home page
* Fixed typo in admin members#index
* Tidying up actions on all the things
* Harvest description in #index
* Truncate garden description if long
* Updated link label in view spec
* Show planted_from always, becuase it might be a parent seed
* find correct link in spec adding photos to garden
* fixed spec finding link to edit garden
* Better harvest description truncation
* Helping spec find the edit button
* specs for the home page
* Re-instate crops js, but in the correct file now
* Fixed link to garden in actions
* Tweaking mobile view
2018-03-12 08:39:32 +13:00
Brenda Wallace
42de726405 Removing shop, products, accounts, orders 2018-02-09 10:53:05 +13:00
Brenda Wallace
65b4c7dbc1 Revert "Auto corrected by following Style/StringLiterals"
This reverts commit ab56a3c6b3.
2018-02-09 07:58:47 +13:00
Awesome Code
ab56a3c6b3 Auto corrected by following Style/StringLiterals 2018-02-07 10:20:26 +13:00
Brenda Wallace
9db4736229 Permissions (and specs) for charts json 2018-01-23 09:00:34 +13:00
Brenda Wallace
4c35987cb7 Ignore long method in ability.rb 2017-12-17 17:57:19 +13:00
Brenda Wallace
54e0806f38 don't check role is there's no member 2017-12-17 17:55:14 +13:00
Brenda Wallace
01a7463ae8 Split up ability.rb into methods 2017-12-17 12:47:41 +13:00
Brenda Wallace
998befb30f Limited plantings to member's own garden, and approved crops 2017-03-16 15:29:25 +13:00
Brenda Wallace
21f11a4d5d highest MethodLength is now 34 2017-02-17 09:26:30 +13:00
Brenda Wallace
6b8474e01b Checks for cancan ability before allowing like 2017-02-12 15:23:58 +13:00
Brenda Wallace
4fedc7f23f Member can see crops they have requested 2017-01-23 09:49:47 +13:00
Brenda Wallace
0fa9f54c9c Rename member.has_role? to role? 2017-01-14 20:54:43 +13:00
Brenda Wallace
283bb76a9e Link a harvest to a planting, and display 2017-01-04 22:45:49 +13:00
Brenda Wallace
ca7868b79a Use guard clauses 2016-12-14 21:28:35 +00:00
Shiny
0c2a60ecc3 Reduce max AbcSize to 38 (#1112)
Reduce how complex methods are allowed to be, according to our code checker, so we're forced to write readable code
2016-12-02 08:06:53 -05:00
Brenda Wallace
723ebff923 Spacing fixes 2016-11-26 12:13:17 +13:00
Brenda Wallace
bdb057ca0f Removed all trailing white space 2016-11-14 15:05:32 +13:00
Daniel O'Connor
4b4e0cf69a $ rubocop --only HashSyntax --auto-correct
483 files inspected, 2018 offenses detected, 2018 offenses corrected
2016-05-19 15:53:11 -04:00
Andrey
e35ebab380 Reply to notification action 2015-05-27 11:56:24 +10:00
Taylor Griffin
b81e034254 tweak permissions for alternate names just like sci names 2015-02-10 18:38:32 +11:00
Taylor Griffin
0dbc2e1964 prevent users from seeing sci names of crops unless approved 2015-02-09 21:52:52 +11:00
Taylor Griffin
076a6cc1df catch up with upstream dev 2015-02-04 21:41:42 +11:00
Taylor Griffin
b842bff9cb wip: fix misc tests 2015-02-04 18:36:14 +11:00
Taylor Griffin
80a28085f1 make pending crops unviewable to regular members 2015-02-04 14:44:12 +11:00
Taylor Griffin
abece6473b make rejected and pending crops viewable on wrangle crops page 2015-02-04 14:18:10 +11:00
Taylor Griffin
28d29291a7 any member can create a crop at least provisionally 2015-01-31 10:03:44 +11:00
Skud
17e94e01d0 Tidied up authorization around follows 2015-01-17 00:57:05 +11:00
Yoong Kang Lim
aeb7192f48 Break up tests into different scenarios. Defined cancan ability for follows and updated member profile view 2014-11-20 23:46:15 +11:00
Yoong Kang Lim
b5e1b6bc22 Delete unused views, add feature tests 2014-11-13 00:46:34 +11:00
Miles Gould
7e4b51d1cb Add "Edit" link for alternate names on crops page. 2014-10-18 15:18:23 +01:00
Skud
ac5027ec27 Can't delete plant parts that are being used 2013-11-06 10:38:28 +11:00
Skud
67b88e8e18 set cancan abilities for harvests 2013-09-17 15:53:51 +10:00
Skud
8f7becfa78 added a basic crop wrangler homepage 2013-08-21 21:24:22 +10:00
Skud
cc711a0a48 prettified seed-related views 2013-07-15 22:53:30 +10:00
Skud
89a5a777e6 Merge branch 'dev' into payments-new
Conflicts:
	.gitignore
	app/models/ability.rb
	app/models/member.rb
	db/schema.rb
2013-06-04 19:42:00 +10:00