Commit Graph
197 Commits
Author SHA1 Message Date
Brenda Wallace f20bf69d32 feat: Allow saving blank drafts for photo attachments and update validations 2026-10-28 21:50:26 +13:00
Brenda Wallace 96e37b6c90 feat: Enhance photo handling in posts with new features and UI updates 2026-10-28 21:50:26 +13:00
Brenda Wallace bb02a61f75 feat: Add photo selection functionality and update UI for CardPhotoDialog 2026-10-28 21:50:26 +13:00
Brenda Wallace 232a62c3a8 feat: Enhance post editor with link suggestions for crops, members, and plantings 2026-10-28 21:50:26 +13:00
Brenda Wallace b6006df384 feat: Implement draft autosave and preview functionality in PostEditor
- Added useDraftAutosave hook to handle automatic saving of post drafts.
- Enhanced PostEditor component to include a preview tab that fetches and displays rendered markdown.
- Updated Post model to manage draft state and associated published_at timestamp.
- Introduced card_photo association to Post for representing a primary image.
- Modified post form to support draft saving and publishing actions.
- Updated navigation to include links to drafts.
- Added tests for draft saving, preview functionality, and card photo validation.
- Created migrations for new database fields related to drafts and card photos.
2026-10-28 21:50:26 +13:00
Brenda Wallace 334e7a8370 feat: integrate Tiptap editor for post body editing
- Updated post actions menu to link directly to the edit post path.
- Enhanced post form to include a React-based body editor using Tiptap, with a fallback to a plain textarea.
- Added Tiptap dependencies to package.json and updated yarn.lock.
- Created a feature spec to verify navigation to the edit page from the post actions menu.
2026-10-26 15:22:45 +13:00
Brenda Wallace 07a415b6e3 Remove edit modal for posts from the view 2026-10-26 15:22:45 +13:00
51feec8de1 Add comment support for plantings (#4984)
* Add comment support for plantings

- Add polymorphic comments association, subject, and author methods to Planting.
- Add comments_count column migration for Planting counter cache.
- Update CommentsController and comments view templates to support Planting.
- Render comments list and form on Planting show view.
- Add specs for Planting comments in models, controllers, and requests.

Co-authored-by: CloCkWeRX <365751+CloCkWeRX@users.noreply.github.com>

* put 4.0.7 back

* Opt comments on posts into record-page styling temporarily

* Drop hr

* Flatten comments

* Update schema

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: Brenda Wallace <brenda@wallace.net.nz>
2026-10-22 15:22:32 +00:00
Brenda Wallace 3deb7befbc Add modal form helper and update post actions to use modal for editing 2026-10-16 22:21:26 +13:00
Brenda WallaceandClaude Sonnet 5.5 64c9bd3baa Open every add-photo link in the photo dialog
The dialog is mounted once in the layout and any link marked
data-photo-dialog opens it, naming its record in the heading. The gardens
and posts menus, the old planting card and add_photo_button now use it
instead of going to the new-photo page.

Part of #4933

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-16 22:21:26 +13:00
Brenda WallaceandClaude Sonnet 5.5 73bf8b5552 Write a comment on the post page itself
The comment form now sits under the post's comments instead of on a page of
its own; the Comment buttons jump to it.

Part of #4933

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-16 22:21:26 +13:00
Brenda WallaceandClaude Sonnet 5.5 be04ef963f Give record action menus a shared three-dot menu with green icons
One actions_menu helper now builds the three-dot toggle and dropdown for
seeds, harvests, crops, gardens, posts, photos, activities and comments,
replacing the text "Actions" toggle. Every item carries a green line icon
(menu_icon), and delete uses a darker red ($danger-text, 5.6:1 on white)
so it stays readable; it is still last, under a divider, with its own icon.
The React menus draw the same icons. DESIGN.md now says menu items have icons.

Also fixes the posts menu delete, which confirmed but never sent DELETE.

Closes #4939
Closes #4940
Closes #4942
Closes #4943
Closes #4944
Closes #4945
Closes #4946
Part of #4933

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-16 22:21:26 +13:00
Brenda Wallace 2989dafc4c Merge dev into chore/bootstrap-5 2026-09-20 20:20:51 +12:00
Daniel O'Connorandgoogle-labs-jules[bot] 2b366213e8 Cap RSS feeds iterate unbounded associations to 50 records (#4809)
- Cap @member.posts in app/views/members/show.rss.haml with .limit(50)
- Cap @post.comments in app/views/posts/show.rss.haml with .limit(50) and eager load authors
- Remove eager loading of all comments+authors on Post in PostsController#show
- Add view specs to verify RSS feed limits

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
2026-09-20 16:41:28 +09:30
Brenda WallaceandClaude Sonnet 5 92f3f0cc36 Convert Bootstrap 3 horizontal forms to Bootstrap 5
The label-beside-input forms (label col-md-2, input col-md-8) relied on
form-horizontal and form-group acting as a row. Each field wrapper is now a real
.row.mb-3, labels are col-form-label, help text is form-text, and the leftover
form-horizontal and form-actions classes, which do nothing in Bootstrap 5, are
dropped.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-20 18:03:36 +12:00
Brenda WallaceandClaude Sonnet 5 be5ed5fca5 Rename Bootstrap 4 utility classes to their Bootstrap 5 names
text-left/right -> text-start/end, float-left/right -> float-start/end,
ml-/mr-/pl-/pr- -> ms-/me-/ps-/pe-, border-left/right -> border-start/end,
dropdown-menu-left/right -> dropdown-menu-start/end, font-weight-* -> fw-*,
font-italic -> fst-italic and sr-only -> visually-hidden. Bootstrap 5 dropped
text-justify, so the site keeps a one-line rule for it.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-20 18:01:00 +12:00
google-labs-jules[bot]andDaniel O'Connor 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 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 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
Daniel O'Connor 7d63234841 Upgrade to bootstrap 5 (#3605)
* Upgrade boostrap

* Remove deprecated bootstrap toggles

* Migrate other details

* Avoid accidentally including bootstrap twice

* Avoid accidentally including bootstrap twice

* Avoid accidentally including bootstrap twice

* Fix spec

* Fix spec, where the size of the screen has gone to a partial breakpoint/you can't click on your own name in tablet view

* Fix spec

* Cleanup

* Cleanup
2024-03-10 11:49:22 +10:30
Daniel O'Connor 49284eb169 Fix haml preview (#3610)
* HAML

* rewrite

* Fix specs - but likely still wrong

* Return temple

* Trailing line

* Fix specs

* This was rearranged, apparently.

* Fix tests

* Retain escaping

* Fix specs

* Rubocop

* Attempt to fix rendering

* Fix output

* Move away from filter

* Move away from filter

* Fix spec

* Fix specs

* Fix structure to avoid nested paragraph tags
2024-02-04 15:08:18 +10:30
Daniel O'Connor fb86448061 HAML 6 (#3607)
* HAML

* rewrite

* Fix specs - but likely still wrong

* Return temple

* Trailing line

* Fix specs

* This was rearranged, apparently.

* Fix tests

* Retain escaping

* Fix specs

* Rubocop

* Apparently the escaped filter doesn't work with interpolation. Swap to our implementation
2024-02-03 17:33:39 +10:30
Daniel O'Connor 196b8078e6 Posts - Ensure responsive (#3584)
* Fix model validations and responsiveness

* Fix model validations and responsiveness

* Update app/models/post.rb
2024-01-21 16:05:14 +10:30
Daniel O'Connor 78eaf0b4c9 Address minor accessibility issues: Image elements do not have [alt] attributes (#3561)
* Add alt tags

* Update app/views/members/_tiny.haml

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

* Use crop_name as this is a searchkick record
2024-01-17 22:02:09 +10:30
Daniel O'Connor 67857f23d6 Update _summary.html.haml 2023-08-09 23:55:55 +09:30
Daniel O'Connor e557695b37 Update _summary.html.haml
Fix issue #3410
2023-08-09 23:52:24 +09:30
Daniel O'Connor 955dbcba08 Fix the layout of the tables (#3194) 2023-03-13 13:00:50 +10:30
Daniel O'Connor 06c5e4b8e8 to_s 2022-11-07 23:20:49 +10:30
Brenda 821ddd90cb fix specs 2020-02-10 14:21:03 +13:00
Brenda 9dfd6dbc73 Tidy up index pages 2020-02-10 14:21:03 +13:00
Brenda Wallace 019d94f1cb Show the default photo for social media 2020-02-04 11:52:13 +13:00
Brenda Wallace 6017c04b5f don't check if post is liked by member, unless the member is signed in 2020-01-01 15:54:52 +13:00
Brenda Wallace 6e81f2966d fixed colouring of likes button 2020-01-01 09:24:47 +13:00
Brenda Wallace 54778d9884 Likes popuplating from elastic, no more extra look ups 2020-01-01 08:38:27 +13:00
Brenda Wallace b0c8b11246 📝 Inline editing and display tidy ups (#2200)
* Inline editing and display tidy ups
2019-10-08 11:06:53 +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 57ca80f0eb line up display of posts 2019-07-21 20:26:04 +12:00
Brenda Wallace c9f9315d8d specs for liking photos from photos#show 2019-07-12 11:29:47 +12:00
Brenda Wallace 9686305857 The like icons are now the buttons 2019-07-12 10:13:24 +12:00
Brenda Wallace a87248a43e DRY up detecting if photo/post already liked 2019-07-12 09:42:45 +12:00
Brenda Wallace af0d84d9f1 Updating likes js code 2019-07-12 09:28:45 +12:00
Brenda Wallace 61047df429 Merge branch 'dev' into following-page 2019-07-08 20:02:47 +12:00
Brenda Wallace 253c0cb939 Merge branch 'dev' into following-page 2019-07-08 16:44:03 +12:00
Daniel O'Connor cf0d648b31 Merge branch 'dev' into post-photos 2019-07-08 13:45:26 +09:30
Brenda Wallace bbd43f57bc Prevent post images going off screen 2019-07-08 04:08:58 +00:00
Brenda Wallace 5cef4d728c Adding photos directly to a post 2019-07-08 13:20:57 +12:00
Brenda Wallace 3859122fa5 tidy 2019-07-08 10:04:08 +12:00
Brenda Wallace c61f13625c Moved html into haml instead of html_safe in helper 2019-07-08 09:52:33 +12:00
Brenda Wallace 1d98668ac4 scss lint 2019-06-26 16:21:59 +12:00
Brenda Wallace b176ba59dc removed byline method
avoiding use of htmlseafe
2019-06-26 11:21:40 +12:00