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>
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#4939Closes#4940Closes#4942Closes#4943Closes#4944Closes#4945Closes#4946
Part of #4933
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
"Chives" is a crop. A page about one member's chives should say "Chives
planting" in its heading, not leave the reader to work it out from the
furniture around it. The same for harvests and saved seeds.
- plantings#show: "Chives planting", subtitle "by <owner> in <garden>".
- harvests#show: "Basil harvest", subtitle "by <owner> · <date>". The
owner was in a %small inside the h1 before.
- seeds#show: already said "seeds"; it now names who saved them.
Gardens are left as they are: a garden's name is the member's own, so the
noun belongs in the subtitle rather than appended to a name that may
already contain it.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The new harvest cards and seed packets only appeared on plantings#show.
Everywhere else either used the old thumbnails or hand-rolled its own
markup, which is what made harvests and plantings look alike in the first
place.
- members#show and members/_harvests render harvests/card. The latter also
wrapped each card in another .card, which nested a card in a card.
- The homepage harvest list was hand-rolled markup beside a seeds section
that already used seeds/card; both now use the shared partials.
- Homepage seed packets go in an .index-cards grid. Outside one they have
no width, and the packet's 3:4 ratio made each half the page wide.
- harvests/_harvest and seeds/_seed chose between card and thumbnail on a
`full:` local that nothing passes. Both render the card.
The crop pages' harvest and seed panels are lists of links in a sidebar,
not card grids, so they are left alone.
Section "add" buttons now open the same dialogs as the actions menu, via a
data-planting-dialog attribute the island listens for. Their href stays as
the fallback without JavaScript.
The rating card is now clickable: for someone who may edit the planting it
renders StarRating, which saves the new rating and puts it back if the
save fails. The card's own heading is the label, so the fieldset legend is
hidden rather than saying "Rating" twice.
"More photos" is a plain link again, and only shows when there are more
photos than the page is displaying — the photos are now paginated to 12,
where before the whole set was loaded and the link always showed.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This page read as a page about the crop rather than about one member's
planting, and its sections each did things their own way. Changes follow
the conventions written up in the UI consistency guide.
Identity
- Title, meta description and OpenGraph all read "<crop> planting by
<owner>"; the hero carries a muted "planting by X in Y" subtitle and
the scientific name moves to the crop card.
- Breadcrumb's last item is plain text, not a link to the current page.
Actions
- One actions menu per page: a quiet three-dot button in the top right of
the hero, rendered by the new PlantingActions island, opening the
EditPlanting, RecordHarvest, SaveSeeds, MarkFinished and AddPhoto
dialogs that already existed for the garden list.
- Menu items are lower case, so a menu reads as a list of things you can
do rather than a row of headings.
- Transplanting moves out of the sidebar into a dialog off that menu: it
is done once in a planting's life and should not hold real estate.
- The second seed-saving dropdown and the loose photo buttons are gone;
each section keeps one quiet "add" on its heading bar as the non-JS
path.
- The plant-part icons from the server-rendered harvest form now reach
the dialog, via icon_url on HarvestFormSerializer.
Fact cards
- Every card fills the same four slots, and the core cards always render
so one planting's page has the same shape as the next.
- Progress reads as a percentage with "day 43 of 90" beneath; quantity
and "grown from" merge into one card rather than both saying
"seedling"; rating is stars and renders even when unrated.
- Dates go through I18n.l and standard_time_distance instead of
assembling abbr_month_names by hand.
- Adds Planting#planned?, replacing three copies of age_in_days < 0.
- Perennial no longer claims the plant "grows back each year".
Cards by type
- Harvest cards get square corners, a warm accent and the harvest icon,
and say "<crop> harvest", so they are not mistaken for plantings.
- Seed cards are drawn as seed packets: portrait, papery, torn top edge,
printed band, small print along the foot and the year saved stamped on
them.
Layout
- The page wrapper is .planting-show, not .planting: that is the planting
*card's* class, and its absolutely positioned badges and quick actions
were leaking onto this page.
- Sections are bordered blocks with their heading bar as the lid, so a
heading and its content read as one thing.
- One spacing scale, and the hero aligns to the same left edge as
everything below it.
Copy
- Section headings and empty states go through en.yml, in one voice.
- "Add a photo to visually track growth of this planting, to Flickr,
iNaturalist or Pl@ntNet" was nonsense: photos come from Flickr only.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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>
.close with a times character -> .btn-close (which draws its own cross), with an
aria-label on each. The alert helper said alert-dismissable, Bootstrap 3's
spelling; Bootstrap 5 needs alert-dismissible for the close button's spacing.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
badge-info/success/... -> text-bg-info/success/..., which set the background
and a readable text colour together, and badge-pill -> rounded-pill. The site's
own badge-late, badge-harvest and similar hooks are unchanged.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* Update planting rating when recording a harvest
- Added virtual attribute `overall_rating` to `Harvest` model.
- Updated `HarvestsController` to permit `overall_rating` and synchronize it to the associated `Planting`.
- Added a rating range field (1-5) to the harvest form.
- Added controller tests to verify that the planting rating is updated.
- Refined feature tests for harvesting.
Co-authored-by: CloCkWeRX <365751+CloCkWeRX@users.noreply.github.com>
* I have updated the system to allow for recording a planting rating when a harvest is logged. Here is a summary of the changes:
- Added a virtual attribute `overall_rating` to the `Harvest` model.
- Updated `HarvestsController` to permit `overall_rating` and synchronize it to the associated `Planting`.
- Added a rating range field (1-5) to the harvest form.
- Added controller tests to verify that the planting rating is updated correctly.
- Updated feature tests to ensure the harvest form functions as expected.
Co-authored-by: CloCkWeRX <365751+CloCkWeRX@users.noreply.github.com>
* Update database.yml
* Apply suggestions from code review
Co-authored-by: Daniel O'Connor <daniel.oconnor@gmail.com>
* Adjust wording
* Change harvest modal
* Fix tests
---------
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
- Memoize display methods in `Harvest` model.
- Memoize calculation methods in `PredictHarvest` concern using `defined?` for nil safety.
- Add fragment caching to `app/views/harvests/_popover.html.haml`.
- Add fragment caching to `app/views/crops/_harvests.html.haml` with daily expiration for relative time strings.
Co-authored-by: CloCkWeRX <365751+CloCkWeRX@users.noreply.github.com>
This commit improves the meta descriptions for several pages by making them dynamic and object-specific.
- The default meta description in `app/views/layouts/_head.html.haml` has been updated to include a mention of open data.
- The `show.html.haml` views for crops, seeds, plantings, harvests, and members now have a `content_for :meta_description` block. This block uses the object's description or bio if available, and falls back to a generated string if not.
This commit introduces a new partial to display nutritional data from the Australian Food Composition Database.
Key changes:
- Adds a database index to the `public_food_key` on the `crops` table.
- Establishes a `has_one` relationship between `Crop` and `AustralianFoodClassificationData`.
- Creates a `_nutritional_data.html.haml` partial to display a summary of key nutritional information.
- Renders the partial on the `show` pages for both crops and harvests.
* 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
* 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