Commit Graph
49 Commits
Author SHA1 Message Date
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
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 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 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
Brenda Wallace 019d94f1cb Show the default photo for social media 2020-02-04 11:52:13 +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
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 e0b9acc27d Tidier link to member posts 2019-06-14 11:27:43 +12:00
Brenda Wallace c0b2a8431b Reinstate likes 2019-06-14 11:01:16 +12:00
Brenda Wallace 878c692b27 posts display 2019-06-12 14:48:00 +12:00
Brenda Wallace fad43f18c8 missing titles, icons, and breadcrumps 2019-06-05 22:46:41 +12:00
Brenda Wallace 70afa97b80 only shrink the member card on the homepage 2019-06-05 08:35:39 +12:00
Brenda Wallace 75b04ffe04 attempting to make posts appear nice on mobile 2019-06-04 20:02:28 +12:00
Brenda Wallace ac52fb743c tidy post display on small screens 2019-05-25 17:02:16 +12:00
Brenda Wallace 1e03d15434 Move post actions to own file 2019-05-25 15:18:58 +12:00
Brenda Wallace dea6f36b0e Fix filter posts by member 2019-05-19 15:34:26 +12:00
Brenda Wallace dcfe49901e Posts actions in dropdown menus 2019-05-19 10:20:35 +12:00
Brenda Wallace dccbf440cb Breadcrumbs 2019-05-18 23:18:27 +12:00
Brenda Wallace 77c0dea122 Tidy up posts#show 2019-05-18 20:14:25 +12:00
jenkr55 b3962bc9bc Comment button same style 2018-04-19 12:10:19 -05:00
jenkr55 634dc936f9 Show second comment button when many comments 2018-04-18 19:32:24 -05:00
Brenda Wallace b538330785 Form to delete your own account 2017-05-21 21:51:44 +12:00
Brenda Wallace 6f74566d47 Truncate, escape, and DRY og:description fields 2017-02-08 09:49:19 +13:00
Brenda Wallace acbb610e05 Haml clean up for posts views 2017-02-08 07:25:59 +13:00
Brenda Wallace bdb057ca0f Removed all trailing white space 2016-11-14 15:05:32 +13:00
Daniel O'Connor c278b36858 Up the various opengraph images to 200x200 2016-06-03 01:45:43 +09:30
Daniel O'Connor 7550bc860f #816 Add better opengraph behaviour, fix facebook share thumbnail size 2016-06-03 01:01:03 +09:30
Shiho Takagi 2abe6d7d12 show thumbnail even when there is no photo 2015-03-04 12:53:08 +11:00
Shiho Takagi 17ccea4b28 moving photo on posts/show view 2015-02-23 21:43:03 +11:00
Skud c6f5abc036 Made info alerts be green like Growstuff is green 2015-01-24 21:07:41 +11:00
Rocky Jaiswal 05260c05c2 incorporating feedback comments for showing message for logged out users. 2015-01-20 19:14:50 +01:00
Rocky Jaiswal 534c299383 Show friendly message to unregistered users who view posts.
https://github.com/Growstuff/growstuff/issues/625
2015-01-18 20:28:00 +01:00
Skud 117fd23bea add btn-default to all btn-xs 2014-07-22 12:06:28 +10:00
Skud 0294daf423 s/btn-mini/btn-xs/ for bootstrap3 2014-07-22 12:01:49 +10:00
Miles Gould 2b84fa8bad Show previous comments when creating a comment.
- Move "show previous comments" into a partial
 - invoke said partial from the new comment form
 - add tests.
2013-04-29 21:30:26 +01:00
Miles Gould c9cc7be0d1 Refactor model code out of view in posts/show. 2013-03-28 10:57:30 +00:00
gnattery d26b3d42ed standardise button styles 2013-03-21 00:37:46 +11:00
Miles Gould e7a1beb323 Add anchor tag for comments in posts/show. 2013-02-27 13:26:35 +00:00
Jared McCorkindale 1c1fac0aa5 hiding comment count from post show 2013-02-27 11:45:58 +00:00
Skud d37e7a148d Delete comments when post is deleted 2013-02-08 17:45:37 +11:00
Skud 660c626581 show comments on post page 2013-02-08 16:36:15 +11:00
Skud fc4c409cf4 Tests for views/posts now work.
Not going to make any claims for other views though!  About to test them
next.
2013-01-13 16:18:48 +11:00
Skud 21f0f39bf9 Model and controller spec files pass.
Views are another matter (and will explode badly at this point)
2013-01-13 16:12:45 +11:00