Files
growstuff/app/views/places/show.html.haml
T
Brenda Wallace e68c98fd38 Add JavaScript functionality for planting alternate names and tab navigation
- Implemented `planting_alternate_name.js` to load alternate names for crops in the planting form based on user input.
- Added `tab_navigation.js` to manage tab navigation and update the URL hash accordingly.

Update map rendering in member and place views

- Modified `_map.html.haml` to include a custom marker icon for member maps.
- Updated `index.html.haml` and `show.html.haml` to pass `places_map_data` to the map sections.

Refactor asset management in Rails application

- Removed Sprockets from the application configuration and adjusted asset paths.
- Updated asset precompilation settings and removed deprecated asset configurations from environment files.
- Added new build scripts for CSS and updated package dependencies in `package.json` for Bootstrap, Chart.js, and others.

Ensure React and CSS bundles are built before running tests

- Updated `react_bundle.rb` to check for the existence of both JavaScript and CSS bundles and build them if missing.
2026-10-20 23:55:33 +13:00

53 lines
1.8 KiB
Plaintext

- content_for :title, "#{ENV['GROWSTUFF_SITE_NAME']} community near #{@place}"
- content_for :opengraph do
= tag("meta", property: "og:title", content: "#{ENV['GROWSTUFF_SITE_NAME']} community near #{@place}")
= tag("meta", property: "og:type", content: "website")
= tag("meta", property: "og:url", content: request.original_url)
= tag("meta", property: "og:site_name", content: ENV['GROWSTUFF_SITE_NAME'])
%h1 #{ENV['GROWSTUFF_SITE_NAME']} community near #{@place}
= render partial: 'search_form'
%section.map#placesmap{ style: "height:300px", data: places_map_data }
%section.members
%h2#members= "Nearby members"
- if @nearby_members.any?
.index-cards.members
- @nearby_members.first(30).each do |member|
= render partial: "members/thumbnail", locals: { member: member }
- else
%p No nearby members
= link_to "View all members >>", members_path
%section.seeds
%h2#seeds Seeds available for trade near #{@place}
- crop_id = []
- @nearby_members.first(10).each do |member|
- member.seeds.first(5).each do |seed|
- crop_id.push seed.crop.id
- if crop_id.present?
.index-cards.crops
- crop_id.uniq.first(20).each do |crop|
= render partial: "crops/thumbnail", locals: { crop: Crop.find(crop) }
- else
%p No nearby seeds found
= link_to "View all seeds >>", seeds_path
%section#plantings
%h2 Recent plantings near #{@place}
- plantings = []
- @nearby_members.first(10).each do |member|
- member.plantings.first(5).each do |planting|
- plantings << planting
- if plantings.any?
.index-cards.plantings
- plantings.first(10).each.with_index do |planting, index|
= render partial: "plantings/card", locals: { planting: planting, index: index }
- else
%p No nearby plantings found
= link_to "View all plantings >>", plantings_path