Commit Graph

2452 Commits

Author SHA1 Message Date
google-labs-jules[bot]
f2421bf4c7 Here's the plan to add polymorphic comments and update related functionality:
This change introduces polymorphic comments, allowing you to comment on Photos, Plantings, Harvests, and Activities, in addition to Posts.

Key changes include:

-   **Comment Model:**
    -   Made `Comment.commentable` a polymorphic association.
    -   Added a data migration to move existing post comments to the new structure.
    -   Updated notification creation logic for polymorphic commentables.
-   **CommentsController:**
    -   Refactored to handle various commentable types using a `find_commentable` method.
-   **Ability Model:**
    -   Updated permissions for comment creation, editing (author/admin), and deletion (author/commentable owner/admin).
-   **Routes:**
    -   Added nested comment routes for Photos, Plantings, Harvests, Activities, and Posts using a `commentable` concern with shallow routes.
-   **Views:**
    -   Created generic partials for comment forms (`_form.html.haml`) and display (`_comment.html.haml`, `_comments.html.haml`).
    -   Integrated these partials into the show pages of all commentable types.
    -   Updated `comments/new` and `comments/edit` views to be generic.
    -   Relevant parent controller `show` actions now eager-load comments.
-   **Testing:**
    -   Added extensive model, controller (using shared examples), and feature tests to cover the new polymorphic comment functionality, including permissions and UI interactions for all commentable types.
    -   Updated and created factories as needed.

This fulfills the issue requirements for adding comments to multiple resource types with appropriate permissions.
2025-05-25 02:03:17 +00:00
Daniel O'Connor
8224fe2aea Update _form.html.haml 2024-10-14 00:14:26 +10:30
Daniel O'Connor
58780ec199 Swap harvest to html5 date field (#3894)
* Update gardens to have a non 0 area

* Spec no longer possible through frontend

* Fix spec

* Swap harvest to html5 date field

* Fix spec
2024-10-14 00:09:30 +10:30
Daniel O'Connor
196ca1ba49 Merge pull request #3896 from Growstuff/CloCkWeRX-patch-2
Update _form.html.haml
2024-10-13 23:53:28 +10:30
Daniel O'Connor
443be95915 Merge pull request #3895 from Growstuff/CloCkWeRX-patch-5
Swap to HTML5 date field
2024-10-13 23:49:50 +10:30
Daniel O'Connor
9167c334f9 Merge pull request #3890 from Growstuff/CloCkWeRX-patch-3
Swap activities to datepicker
2024-10-13 23:36:12 +10:30
Daniel O'Connor
66f3a712ea Update _form.html.haml 2024-10-13 23:32:19 +10:30
Daniel O'Connor
26691419dc Merge pull request #3893 from Growstuff/CloCkWeRX-patch-2
Update _form.html.haml to mark required
2024-10-13 23:29:58 +10:30
Daniel O'Connor
8459bc2fdf Swap to HTML5 date field 2024-10-13 23:29:17 +10:30
Daniel O'Connor
2fe3c8fc73 Merge pull request #3892 from Growstuff/CloCkWeRX-patch-5
Update _form.html.haml to require a min of 1 seed
2024-10-13 23:22:13 +10:30
Daniel O'Connor
2b72e8f2da Merge pull request #3891 from Growstuff/CloCkWeRX-patch-4
Update _form.html.haml to require a min of 1 when planting
2024-10-13 23:21:11 +10:30
Daniel O'Connor
a2faf945a2 Update _form.html.haml to mark required 2024-10-13 23:08:16 +10:30
Daniel O'Connor
d1871106fa Merge pull request #3889 from Growstuff/CloCkWeRX-patch-2
Update _form.html.haml to mark dropdowns required
2024-10-13 23:04:21 +10:30
Daniel O'Connor
9a1b62fe52 Update _form.html.haml 2024-10-13 23:02:36 +10:30
Daniel O'Connor
d61222d4cc Update _form.html.haml 2024-10-13 23:01:10 +10:30
Daniel O'Connor
f8e1d75e83 Swap activities to datepicker 2024-10-13 22:57:26 +10:30
Daniel O'Connor
925bb582d3 Update gardens to have a non 0 area (#3885)
* Update gardens to have a non 0 area

* Spec no longer possible through frontend

* Fix spec
2024-10-13 22:53:51 +10:30
Daniel O'Connor
7acef18bc5 Merge pull request #3888 from Growstuff/required-help
Remove required text UI element
2024-10-13 22:47:21 +10:30
Daniel O'Connor
44857c3de7 Update _form.html.haml 2024-10-13 22:43:51 +10:30
Daniel O'Connor
825b0347af Merge pull request #3887 from Growstuff/CloCkWeRX-patch-2
Update _form.html.haml
2024-10-13 22:38:14 +10:30
Daniel O'Connor
001f370283 Merge branch 'dev' into required-help 2024-10-13 22:28:33 +10:30
Daniel O'Connor
a7a5b6ef17 Remove required text UI element 2024-10-13 11:56:56 +00:00
Daniel O'Connor
c05ea9e651 Update _form.html.haml 2024-10-13 22:15:52 +10:30
Daniel O'Connor
6f5a241970 Update _form.html.haml 2024-10-13 21:56:01 +10:30
Daniel O'Connor
73e73e6c14 Update _form.html.haml 2024-10-13 21:54:49 +10:30
Daniel O'Connor
2484bd39ed Render where a planting is in card view (#3882)
* Render where a planting is in card view

* Update app/assets/stylesheets/_plantings.scss
2024-10-13 14:25:46 +10: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
c063a33e8b Garden show and edit: encourage descriptions, add more calls to action (#3846)
* Better edit links

* Prompt for more detail

* Better action links

* Better action links

* Update show.html.haml

* Apply suggestions from code review

* Apply suggestions from code review
2024-09-29 18:28:42 +09:30
Daniel O'Connor
79ef7347ad Avoid showing plantings which are finished 2024-09-08 02:26:11 +00:00
Daniel O'Connor
c28b2c0c38 Likes: Add capability to Activities, Plantings, Harvests (#3805)
* Ability to like activities

* Ability to like activities

* Add likeable everywhere

* Refactor

* Remove extra newline

* Typo

* Use classes, not IDs

* Explicitly wait for ajax

* Fix tests

* Move likes under owner

* Add separation

* Move harvest likes near actions

* Rearrange harvests

* Render likes under owner

* Make harvest consistent with other views

* Move planting detail into header

* Move detail into header

* Move detail into header

* Revert

* Fix header

* Move likes into jumotrons

* Fix name

* Change all actions to be after likes and a span

* Cleanup

* Cleanup

* Cleanup

* Cleanup

* i18n and accessibility

* Fix name

* Temporarily make ack into a div

* Update app/views/photos/_actions.html.haml
2024-07-24 17:07:56 +09:30
Daniel O'Connor
83f2cf4a3c Require name, handle errors on crop create (#3799)
* Fix #3278 by ensuring we rebuild names on error

* Require a URL

* Require a name

* 'Only required for wrangers, and only when approving

* Re-add expectation
2024-07-23 19:44:21 +09:30
Daniel O'Connor
e7a0d0276f Photos > Show crop link (#3803)
* Fix #3802 Show crop link

* Fix #3802 Show crop link

* Fix missing arg

* Fix missing arg

* Translations
2024-07-17 20:06:32 +09:30
Daniel O'Connor
000f4979db Trial Ruby32 (#3418)
* Ruby 3.2/Bundler 2.4

* Fix creation

* Upgrade to js-routes 2. Put all js routes into a global namespace.

* Remove js-routes

* Remove

* Adjust ownership

* Appease codeclimate for the nth time

* Fix deprecation warning by explicitly calling to_fs

* Fix deprecation warning by explicitly calling to_fs

* Fix deprecation warning by explicitly calling to_fs

* Swap to will paginate successor for bootstrap

* Update app/views/members/show.html.haml

* Update app/views/plantings/index.rss.haml

* Update .env

* Update .devcontainer/.env

* Fix spec

* Update spec

* Fix spec

* Pin to 2.4.22

* 3 space indent

* Regenerate

* Update rubocop
2024-07-13 14:45:33 +09:30
domthor
a713d2936c fix linting errors 2024-04-26 17:48:09 -04:00
domthor
9fd7e145b5 Added javascript to fix edit profile tab issue. Fixes #497 2024-04-26 21:35:34 +00:00
Daniel O'Connor
e435d21bd9 Merge branch 'dev' into add-noseed-ux 2024-04-09 22:17:31 +09:30
Daniel O'Connor
559e272347 Merge branch 'dev' into add-noseed-ux 2024-04-09 21:51:14 +09:30
Daniel O'Connor
e334fc449e Merge branch 'dev' into trade-seeds 2024-04-09 21:51:04 +09:30
Bennett Zink
9a0a5935d2 change seed wording 2024-04-07 11:06:43 -04:00
Bennett Zink
41446f281e change plantings wording 2024-04-07 11:06:09 -04:00
Bennett Zink
d149e25aec change harvest wording
Co-authored-by: Daniel O'Connor <daniel.oconnor@gmail.com>
2024-04-07 11:05:35 -04:00
Bennett Zink
637aba85bf Merge branch 'dev' into add-noseed-ux 2024-04-07 11:04:21 -04:00
Daniel O'Connor
7f16f51a47 Fix https://github.com/Growstuff/growstuff/issues/3632 2024-04-07 12:45:50 +00:00
Daniel O'Connor
f23289ec6e Improve header, footer 2024-04-07 12:31:07 +00:00
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
e3bb749e6d Fix activities (#3710)
* Clean up activities display

* Clean up activities display

* Fix display
2024-04-07 20:10:29 +09:30
Daniel O'Connor
dea254c658 Merge branch 'dev' into add-noseed-ux 2024-04-07 17:54:56 +09:30
bennett-zink
c408687e36 added ux when none logged #3618 2024-04-06 20:08:31 +00:00
bennett-zink
b5bab8bd0b fixed Bug: 404 on "add a bio" #3667 2024-04-04 23:41:41 +00:00
Daniel O'Connor
eb6f032272 Attempt to fix inbox (#3687)
* Move delete button

* Swap for different displays

* Swap for different displays

* Reorganise

* Reorganise

* Update spec

* Update spec
2024-03-24 22:19:30 +10:30