Compare commits

...

27 Commits

Author SHA1 Message Date
google-labs-jules[bot]
e763da0d75 Refactor all areas in app/views/ that reference an ENV variable, to read from a helper or similar central area.
A new helper method `site_name` was created in `app/helpers/application_helper.rb` to provide the value of `ENV['GROWSTUFF_SITE_NAME']`.

All occurrences of `ENV['GROWSTUFF_SITE_NAME']` in the `app/views` directory have been replaced with a call to the new `site_name` helper method.

The `ApplicationHelper` has been included in the `ApplicationMailer` to make the `site_name` helper available to mailer views.
2025-08-31 05:19:23 +00:00
Daniel O'Connor
a481cb7c06 Merge pull request #4171 from Growstuff/feature/pwa-install-instructions
Add PWA installation instructions to homepage
2025-08-31 13:17:22 +09:30
Daniel O'Connor
a177a53d57 Merge pull request #4172 from Growstuff/fix-width
Fix width of ready to harvest
2025-08-31 13:17:09 +09:30
Daniel O'Connor
abbe9ee7ca Update spec/features/home/home_spec.rb 2025-08-31 13:01:51 +09:30
Daniel O'Connor
48d2f0a224 Fix width of ready to harvest 2025-08-31 03:30:24 +00:00
Daniel O'Connor
074644d5c8 Adjust specs 2025-08-31 03:27:04 +00:00
Daniel O'Connor
2e2e47d405 Make links bold, not all of the stats text 2025-08-31 03:25:56 +00:00
Daniel O'Connor
0544abcd8f Github lure 2025-08-31 03:16:28 +00:00
Daniel O'Connor
73fb43fc4f Styling 2025-08-31 03:00:07 +00:00
Daniel O'Connor
532afafa0e Restyle slightly 2025-08-31 02:55:02 +00:00
google-labs-jules[bot]
378bd0d8f1 feat: Add PWA installation instructions to homepage
This commit adds instructions for mobile users on how to install the Growstuff website as a Progressive Web App (PWA).

The changes include:
- A new section on the homepage with instructions for both iOS and Android devices. This section is only visible to logged-out users.
- New translations for the instructions in the `en.yml` locale file.
- Basic styling for the new section.
- Updated feature tests to verify the new section's visibility.
2025-08-31 02:25:55 +00:00
Daniel O'Connor
bb943fe0c6 Merge pull request #4168 from Growstuff/menu
Fix Menu (a bit), Fix mobile UX for Crops
2025-08-30 02:17:15 +09:30
Daniel O'Connor
28742d4936 Fix crop button annoyance 2025-08-29 16:33:42 +00:00
Daniel O'Connor
d7e28e79fe Improve menu again 2025-08-29 16:22:55 +00:00
Daniel O'Connor
322bca9281 Merge pull request #4166 from Growstuff/age_in_days
Deal with age_in_days.nil?
2025-08-30 01:15:25 +09:30
Daniel O'Connor
7c081541eb Deal with age_in_days.nil? 2025-08-29 23:46:27 +09:30
Daniel O'Connor
475514a8f0 Merge pull request #4164 from Growstuff/bg-dark
Partially improve menu on mobile
2025-08-29 23:21:35 +09:30
Daniel O'Connor
bb3fd3bcb7 Merge pull request #4155 from Growstuff/remove-openfarm.cc
Remove openfarm.cc links
2025-08-29 23:21:20 +09:30
Daniel O'Connor
5c86622823 Partially improve menu on mobile 2025-08-29 12:51:32 +00:00
Daniel O'Connor
fefd387481 Merge pull request #4162 from Growstuff/fix-failed
Fix current plantings not to show failed
2025-08-29 21:38:20 +09:30
Daniel O'Connor
93de9b35bc Fix current plantings not to show failed 2025-08-29 11:51:46 +00:00
Daniel O'Connor
8044640023 Merge branch 'dev' into remove-openfarm.cc 2025-08-29 19:56:09 +09:30
Daniel O'Connor
ab29de3d04 Remove dead test 2025-08-27 14:45:57 +00:00
Daniel O'Connor
9ae90c1b7e Merge branch 'dev' into remove-openfarm.cc 2025-08-27 23:43:29 +09:30
Daniel O'Connor
e7090631ab Remove partial 2025-08-27 14:12:13 +00:00
Daniel O'Connor
fadf5154e4 Remove openfarm links (defunct) 2025-08-27 14:11:01 +00:00
Daniel O'Connor
13ed098172 Remove openfarm links (defunct) 2025-08-27 14:09:55 +00:00
56 changed files with 147 additions and 113 deletions

View File

@@ -1,6 +1,8 @@
// stats shown on homepage. eg. "999 members..."
.stats {
font-weight: bold;
a {
font-weight: bold;
}
}
.crops,

View File

@@ -10,9 +10,33 @@
width: 100%;
}
.navbar .nav > li {
#navbarSupportedContent {
ul {
flex-direction: column-reverse;
flex-wrap: nowrap;
li.nav-item {
display: block;
a {
display: grid;
grid-template-columns: 2em 1fr 2em;
}
a.dropdown-toggle::after {
width: 100%;
text-align: right;
}
}
}
}
.crop-actions {
flex-direction: column;
width: 100%;
a {
margin: auto;
display: block;
}
}
.navbar .navbar-form {
padding-left: 0;

View File

@@ -10,6 +10,7 @@ body {
.navbar {
flex-wrap: nowrap;
align-items: flex-start
}
.navbar-brand {
.site-name {
@@ -367,9 +368,6 @@ ul.thumbnail-buttons {
h1 {
font-size: 400%;
}
.stats a {
color: $black;
}
// signup widget on homepage
.signup {

View File

@@ -4,7 +4,7 @@ class GardensController < DataController
def index
@owner = Member.find_by(slug: params[:member_slug])
@show_all = params[:all] == '1'
@show_jump_to = params[:member_slug].present? ? true : false
@show_jump_to = params[:member_slug].present? || false
@gardens = @gardens.includes(:owner)
@gardens = @gardens.active unless @show_all
@@ -18,7 +18,7 @@ class GardensController < DataController
end
def show
@current_plantings = @garden.plantings.current.includes(:crop, :owner).order(planted_at: :desc)
@current_plantings = @garden.plantings.current.where.not(failed: true).includes(:crop, :owner).order(planted_at: :desc)
@current_activities = @garden.activities.current.includes(:owner).order(created_at: :desc)
@finished_plantings = @garden.plantings.finished.includes(:crop)
@suggested_companions = Crop.approved.where(

View File

@@ -21,6 +21,10 @@ module ApplicationHelper
classes
end
def count_github_contibutors
File.open(Rails.root.join('CONTRIBUTORS.md')).readlines.grep(/^-/).size
end
# Produces a cache key for uniquely identifying cached fragments.
def cache_key_for(klass, identifier = "all")
count = klass.count
@@ -93,4 +97,8 @@ module ApplicationHelper
def og_description(description)
strip_tags(description).split(' ')[0..20].join(' ')
end
def site_name
ENV.fetch('GROWSTUFF_SITE_NAME', 'Growstuff')
end
end

View File

@@ -1,6 +1,7 @@
# frozen_string_literal: true
class ApplicationMailer < ActionMailer::Base
helper :application
default from: 'from@example.com'
layout 'mailer'
end

View File

@@ -39,10 +39,6 @@ module OpenFarmData
fetch_attr('common_names')
end
def guides_count
fetch_attr('guides_count')
end
def binomial_name
fetch_attr('binomial_name')
end

View File

@@ -94,9 +94,9 @@ module PredictPlanting
private
def calculate_percentage_grown
return 0 if age_in_days < 0
return 0 if age_in_days.to_i < 0
percent = (age_in_days / expected_lifespan.to_f) * 100
percent = (age_in_days.to_f / expected_lifespan.to_f) * 100
(percent > 100 ? 100 : percent)
end
end

View File

@@ -2,7 +2,7 @@
%rss{ version: 2.0 }
%channel
%title
Recent activities from #{@owner ? @owner : 'all members'} (#{ENV['GROWSTUFF_SITE_NAME']})
Recent activities from #{@owner ? @owner : 'all members'} (#{site_name})
%link= activities_url
- @activities.each do |activity|
%item

View File

@@ -5,7 +5,7 @@
= tag("meta", property: "og:description", content: og_description(@activity.description))
= 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'])
= tag("meta", property: "og:site_name", content: site_name)
- content_for :breadcrumbs do
%li.breadcrumb-item= link_to 'Activities', activities_path

View File

@@ -3,7 +3,7 @@
- content_for :breadcrumbs do
%li.breadcrumb-item.active= link_to 'Admin', admin_path
%h1 Manage #{ENV['GROWSTUFF_SITE_NAME']}
%h1 Manage #{site_name}
.row
.col-md-4

View File

@@ -3,7 +3,7 @@
= tag("meta", property: "og:title", content: @alternate_name.name)
= 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'])
= tag("meta", property: "og:site_name", content: site_name)
%p#notice= notice

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
%rss{ version: 2.0 }
%channel
%title Recent comments on all posts (#{ENV['GROWSTUFF_SITE_NAME']})
%title Recent comments on all posts (#{site_name})
%link= comments_url
- @comments.each do |comment|
%item

View File

@@ -1,6 +1,6 @@
- if crop.approved? && signed_in?
.btn-group{"aria-label" => "Crop Actions", role: "group"}
.btn-group.crop-actions{"aria-label" => "Crop Actions", role: "group"}
= render 'plantings/modal', planting: Planting.new(crop: crop, owner: current_member)
= render 'harvests/modal', harvest: Harvest.new(crop: @crop, owner: current_member)
= render 'seeds/modal', seed: Seed.new(crop: @crop, owner: current_member)

View File

@@ -18,7 +18,7 @@
- if !@crop.plantings.empty?
#{@crop.name.titleize} has been planted
= pluralize(@crop.plantings.size, "time")
by #{ENV['GROWSTUFF_SITE_NAME']} members.
by #{site_name} members.
- else
Nobody is growing this yet. You could be the first!
- if @crop.description.present?

View File

@@ -1,6 +0,0 @@
- if crop.guides_count.present? && crop.guides_count.positive?
%p
There are
= link_to "https://openfarm.cc/en/crops/#{CGI.escape @crop.name.gsub(' ', '-').downcase}" do
#{crop.guides_count} growing guides on Open Farm

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
%rss{ version: 2.0 }
%channel
%title Recently added crops (#{ENV['GROWSTUFF_SITE_NAME']})
%title Recently added crops (#{site_name})
%link= crops_url
- @crops.each do |crop|
%item

View File

@@ -4,7 +4,7 @@
= tag("meta", property: "og:title", content: @crop.name)
= 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'])
= tag("meta", property: "og:site_name", content: site_name)
- content_for :scripts do
= javascript_include_tag "charts"
@@ -74,7 +74,6 @@
.card-body
%h4 How to grow #{@crop.name.pluralize}
= render 'grown_for', crop: @crop
= render 'planting_advice', crop: @crop
- if @crop.parent
%hr/
%p.parent-crop
@@ -116,7 +115,7 @@
.card
.card-body
%h3 Learn more about #{@crop.name.pluralize}
%h4.text-muted resources outside #{ENV['GROWSTUFF_SITE_NAME']}
%h4.text-muted resources outside #{site_name}
%ul.list-group.list-group-flush
%li.list-group-item
@@ -124,13 +123,6 @@
= icon 'fas', 'external-link-alt'
Wikipedia (English)
%li.list-group-item
= link_to "https://openfarm.cc/en/crops/#{CGI.escape @crop.name.gsub(' ', '-')}",
class: 'card-link',
target: "_blank",
rel: "noopener noreferrer" do
= icon 'fas', 'external-link-alt'
OpenFarm - Growing guide
%li.list-group-item
= link_to "https://www.gardenate.com/plant/#{CGI.escape @crop.name}",
target: "_blank",

View File

@@ -1,4 +1,3 @@
- site_name = ENV['GROWSTUFF_SITE_NAME']
%p Hello #{@resource.login_name},
%p

View File

@@ -1,4 +1,3 @@
- site_name = ENV['GROWSTUFF_SITE_NAME']
%p Hello #{@resource.login_name},
%p

View File

@@ -1,4 +1,3 @@
- site_name = ENV['GROWSTUFF_SITE_NAME']
%p Hello #{@resource.login_name},
%p

View File

@@ -4,7 +4,7 @@
%br/
= render 'devise/shared/error_messages', resource: resource
%p Delete your account from #{ENV['GROWSTUFF_SITE_NAME']}.
%p Delete your account from #{site_name}.
.form-group
= f.label :current_password, "Password required to delete", class: 'control-label col-md-2'
.col-md-4

View File

@@ -32,7 +32,7 @@
.col-md-offset-2.col-md-8.checkbox
%label
= f.check_box :newsletter
Subscribe to the #{ENV['GROWSTUFF_SITE_NAME']} newsletter
Subscribe to the #{site_name} newsletter
.help-block
= render partial: 'newsletter_blurb'

View File

@@ -1,4 +1,4 @@
The #{ENV['GROWSTUFF_SITE_NAME']} newsletter is sent out
The #{site_name} newsletter is sent out
every few weeks. Check out our
= link_to 'past newsletters', 'http://blog.growstuff.org/category/newsletter/'
if you want to see the sort of thing we'll send you. Of course, we'll never spam you

View File

@@ -1,8 +1,8 @@
.form-page
.card.form-card
%h1 Join #{ENV['GROWSTUFF_SITE_NAME']}
%h1 Join #{site_name}
.card-body
%p Sign up for a #{ENV['GROWSTUFF_SITE_NAME']} account to track your vegetable garden and connect with other local growers.
%p Sign up for a #{site_name} account to track your vegetable garden and connect with other local growers.
%p If you have accessibility issues with the captcha, please contact us via the links in the footer and we will help.
= bootstrap_form_for(resource, as: resource_name, url: registration_path(resource_name),
@@ -24,7 +24,7 @@
to the #{link_to 'Terms of Service', "/policy/tos"}
%p
= f.check_box :newsletter, checked: true, label: "Subscribe to the #{ENV['GROWSTUFF_SITE_NAME']} newsletter"
= f.check_box :newsletter, checked: true, label: "Subscribe to the #{site_name} newsletter"
%p= render partial: 'newsletter_blurb'
= f.submit "Sign up", class: 'btn btn-block btn-success'

View File

@@ -5,7 +5,7 @@
= tag("meta", property: "og:title", content: @forum.name)
= 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'])
= tag("meta", property: "og:site_name", content: site_name)
%h1= @forum.name

View File

@@ -18,7 +18,7 @@
%hr/
%p.text-center
#{ENV['GROWSTUFF_SITE_NAME']} helps you track what you're
#{site_name} helps you track what you're
harvesting from your home garden and see how productive it is.

View File

@@ -1,7 +1,7 @@
- content_for :title, 'GardenTypes'
%p
#{ENV['GROWSTUFF_SITE_NAME']} tracks who's growing what, where.
#{site_name} tracks who's growing what, where.
View any garden_type page to see which of our members have used it.
.index-cards

View File

@@ -7,7 +7,7 @@
= tag("meta", property: "og:title", content: "#{@garden.owner}'s #{@garden}")
= 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'])
= tag("meta", property: "og:site_name", content: site_name)
- content_for :breadcrumbs do
%li.breadcrumb-item= link_to 'Gardens', gardens_path

View File

@@ -2,7 +2,7 @@
%rss{ version: 2.0 }
%channel
%title
Recent harvests from #{@owner ||= 'all members'} (#{ENV['GROWSTUFF_SITE_NAME']})
Recent harvests from #{@owner ||= 'all members'} (#{site_name})
%link= harvests_url
- @harvests.each do |harvest|
%item

View File

@@ -5,7 +5,7 @@
= tag("meta", property: "og:title", content: "#{@harvest.crop} harvested by #{@harvest.owner}")
= 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'])
= tag("meta", property: "og:site_name", content: site_name)
- content_for :breadcrumbs do
%li.breadcrumb-item= link_to 'Harvests', harvests_path

View File

@@ -1,7 +1,7 @@
.row.homepage-blurb
.col-md-8.info
%h1 Growstuff - An open gardening platform
%p= t('.intro', site_name: ENV['GROWSTUFF_SITE_NAME'])
%p= t('.intro', site_name: site_name)
= render 'stats'
.col-md-4
.signup

View File

@@ -4,6 +4,6 @@
member: link_to(t('.member_linktext', count: Member.confirmed.size.to_i), members_path),
number_crops: link_to(t('.number_crops_linktext', count: Crop.count.to_i), crops_path),
number_plantings: link_to(t('.number_plantings_linktext', count: Planting.count.to_i), plantings_path),
number_gardens: link_to(t('.number_gardens_linktext', count: Garden.count.to_i), gardens_path))
number_gardens: link_to(t('.number_gardens_linktext', count: Garden.count.to_i), gardens_path),
contributors: link_to(count_github_contibutors, 'http://github.com/Growstuff/growstuff/CONTRIBUTORS.md', target: '_blank', rel: 'noopener'),
github: link_to('GitHub', 'http://github.com/Growstuff/growstuff', target: '_blank', rel: 'noopener'))

View File

@@ -1,13 +1,14 @@
- content_for :title do
= ENV['GROWSTUFF_SITE_NAME']
= site_name
- if member_signed_in?
.row
.col-lg-8.col-md-12
%h1.display-4= t('.welcome', site_name: ENV['GROWSTUFF_SITE_NAME'], member_name: current_member)
%h1.display-4= t('.welcome', site_name: site_name, member_name: current_member)
%p= render 'stats', cached: true
.col
%br
%p
- if current_member.plantings.active.any?
= link_to member_path(current_member, anchor: "#content"), class: 'btn btn-dark' do
@@ -61,3 +62,16 @@
%section.members
= cute_icon
= render 'members', cached: true
.col-12.col-lg-6
%section.pwa-install
= cute_icon
%h2.text-center= t('home.pwa_title')
.index-cards
.card
.card-body
%h3= t('home.pwa_ios_title')
%p= t('home.pwa_ios_steps_html')
.card
.card-body
%h3= t('home.pwa_android_title')
%p= t('home.pwa_android_steps_html')

View File

@@ -6,27 +6,27 @@
- else
= tag("meta", property: "og:image", content: image_url('facebook-thumbnail.png'))
= tag("meta", property: "og:title",
content: (content_for?(:title) ? yield(:title) + " - " : "") + ENV['GROWSTUFF_SITE_NAME'])
content: (content_for?(:title) ? yield(:title) + " - " : "") + site_name)
= tag("meta", property: "og:type", content: "website")
= tag("meta", property: "og:url", content: root_url)
= tag("meta", property: "og:site_name", content: ENV['GROWSTUFF_SITE_NAME'])
= tag("meta", property: "og:site_name", content: site_name)
- if content_for?(:member_rss_login_name) && content_for(:member_rss_slug)
= auto_discovery_link_tag(:rss,
{ controller: "/members", action: 'show', format: "rss", id: yield(:member_rss_slug) },
title: "#{ENV['GROWSTUFF_SITE_NAME']}- #{yield(:member_rss_login_name)}'s posts")
title: "#{site_name}- #{yield(:member_rss_login_name)}'s posts")
= auto_discovery_link_tag(:rss,
{ controller: "/posts", format: "rss" },
title: "#{ENV['GROWSTUFF_SITE_NAME']} - Recent posts from all members")
title: "#{site_name} - Recent posts from all members")
= auto_discovery_link_tag(:rss,
{ controller: "/crops", format: "rss" },
title: "#{ENV['GROWSTUFF_SITE_NAME']} - Recently added crops")
title: "#{site_name} - Recently added crops")
= auto_discovery_link_tag(:rss,
{ controller: "/plantings", format: "rss" },
title: "#{ENV['GROWSTUFF_SITE_NAME']} - Recent plantings from all members")
title: "#{site_name} - Recent plantings from all members")
%title
= content_for?(:title) ? yield(:title) + " - #{ENV['GROWSTUFF_SITE_NAME']} " : ENV['GROWSTUFF_SITE_NAME']
= content_for?(:title) ? yield(:title) + " - #{site_name} " : site_name
= csrf_meta_tags
= stylesheet_link_tag "application", media: "all"

View File

@@ -6,6 +6,6 @@
%span.site-name Growstuff
.nav= render 'crops/search_bar'
.nav
%button.navbar-toggler{ "aria-controls" => "navbarSupportedContent", "aria-expanded" => "false", "aria-label" => "Toggle navigation", "data-bs-target" => "#navbarSupportedContent", "data-bs-toggle" => "collapse", type: "button" }
%i.fas.fa-ellipsis-v.navbar-toggler-icon
%button.navbar-toggler.ml-auto{ "aria-controls" => "navbarSupportedContent", "aria-expanded" => "false", "aria-label" => "Toggle navigation", "data-bs-target" => "#navbarSupportedContent", "data-bs-toggle" => "collapse", type: "button" }
%span.navbar-toggler-icon
= render 'layouts/menu'

View File

@@ -1,5 +1,5 @@
#navbarSupportedContent.collapse.navbar-collapse
%ul.navbar-nav.mr-auto
%ul.navbar-nav.mr-auto.bg-dark
- if signed_in?
%li.nav-item
= link_to timeline_index_path, method: :get, class: 'nav-link text-white' do
@@ -30,7 +30,9 @@
- cache("everyone-menu", expires_in: 1.week) do
%li.nav-item.dropdown
%a.nav-link.dropdown-toggle{"aria-expanded" => "false", "aria-haspopup" => "true", "data-bs-toggle" => "dropdown", href: "#", role: "button"}= t('.crops')
%a.nav-link.dropdown-toggle{"aria-expanded" => "false", "aria-haspopup" => "true", "data-bs-toggle" => "dropdown", href: "#", role: "button"}
%span
= t('.crops')
.dropdown-menu
= link_to crops_path, class: 'dropdown-item' do
= t('.browse_crops')
@@ -44,7 +46,9 @@
= harvest_icon
= t('.harvests')
%li.nav-item.dropdown
%a.nav-link.dropdown-toggle{"aria-expanded" => "false", "aria-haspopup" => "true", "data-bs-toggle" => "dropdown", href: "#", role: "button"}= t('.community')
%a.nav-link.dropdown-toggle{"aria-expanded" => "false", "aria-haspopup" => "true", "data-bs-toggle" => "dropdown", href: "#", role: "button"}
%span
= t('.community')
.dropdown-menu{"aria-labelledby" => "navbarDropdown"}
= link_to t('.community_map'), places_path, class: 'dropdown-item'
= link_to t('.browse_members'), members_path, class: 'dropdown-item'
@@ -54,7 +58,9 @@
- if member_signed_in?
- if current_member.role?(:crop_wrangler) || current_member.role?(:admin)
%li.nav-item.dropdown
%a.nav-link.dropdown-toggle{"aria-expanded" => "false", "aria-haspopup" => "true", "data-bs-toggle" => "dropdown", href: "#", role: "button"}= t('.admin')
%a.nav-link.dropdown-toggle{"aria-expanded" => "false", "aria-haspopup" => "true", "data-bs-toggle" => "dropdown", href: "#", role: "button"}
%span
= t('.admin')
.dropdown-menu{"aria-labelledby" => "navbarDropdown"}
- if current_member.role?(:crop_wrangler)
= link_to t('.crop_wrangling'), wrangle_crops_path, class: 'dropdown-item'

View File

@@ -1,5 +1,5 @@
- cache member do
.card.card-double
.card
.card-body
%h4.login-name= link_to member, member
%div

View File

@@ -1,8 +1,8 @@
= content_for :title, t(".title", site_name: ENV['GROWSTUFF_SITE_NAME'])
= content_for :title, t(".title", site_name: site_name)
%h1
= member_icon
= t(".title", site_name: ENV['GROWSTUFF_SITE_NAME'])
= t(".title", site_name: site_name)
= bootstrap_form_tag(url: members_path, method: :get, layout: :inline) do |f|
= f.select "sort",
options_for_select({ "alphabetically": 'alpha', "recently joined": "recently_joined" },

View File

@@ -5,7 +5,7 @@
= tag("meta", property: "og:title", content: @member.login_name)
= tag("meta", property: "og:type", content: "profile")
= tag("meta", property: "og:url", content: request.original_url)
= tag("meta", property: "og:site_name", content: ENV['GROWSTUFF_SITE_NAME'])
= tag("meta", property: "og:site_name", content: site_name)
- content_for :member_rss_login_name, @member.login_name
- content_for :member_rss_slug, @member.slug
@@ -82,8 +82,8 @@
.col-md-10#content
.row
%section.order-3.order-md-1.col-12= render "map", member: @member
- if @harvesting.size.positive?
%section.harvests.order-2.order-md-1
- if @harvesting.size.positive?
%section.harvests.order-2.order-md-1.col-12
%h2 Ready to harvest
.index-cards
- @harvesting.each do |planting|

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
%rss{ version: 2.0 }
%channel
%title #{@member.login_name}'s recent posts (#{ENV['GROWSTUFF_SITE_NAME']})
%title #{@member.login_name}'s recent posts (#{site_name})
%link= member_url(@member)
- @member.posts.each do |post|
%item

View File

@@ -1,4 +1,4 @@
%p
The #{ENV['GROWSTUFF_SITE_NAME']} team.
The #{site_name} team.
%br/
= link_to root_url, root_url

View File

@@ -6,7 +6,7 @@
%p
= @request.requester.login_name
has requested a new crop on
= ENV['GROWSTUFF_SITE_NAME']
= site_name
%ul
%li Name: #{@request.name}

View File

@@ -5,7 +5,7 @@
= tag("meta", property: "og:image:user_generated", content: "true")
= 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'])
= tag("meta", property: "og:site_name", content: site_name)
- content_for :breadcrumbs do
%li.breadcrumb-item= link_to 'Photos', photos_path

View File

@@ -21,7 +21,7 @@
- if planting.finish_is_predicatable?
.card.fact-card
%h3 Progress
- if planting.age_in_days < 0
- if planting.age_in_days.to_i < 0
%strong Planned
- else
%strong #{planting.age_in_days}/#{planting.expected_lifespan}
@@ -45,7 +45,7 @@
%h3 Growing
%strong= seedling_icon
%span
- if planting.age_in_days < 0
- if planting.age_in_days.to_i < 0
Planting planned
- else
Planting is still growing today

View File

@@ -2,7 +2,7 @@
%rss{ version: 2.0 }
%channel
%title
Recent plantings from #{@owner ? @owner : 'all members'} (#{ENV['GROWSTUFF_SITE_NAME']})
Recent plantings from #{@owner ? @owner : 'all members'} (#{site_name})
%link= plantings_url
- @plantings.each do |planting|
%item

View File

@@ -6,7 +6,7 @@
= tag("meta", property: "og:description", content: og_description(@planting.description))
= 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'])
= tag("meta", property: "og:site_name", content: site_name)
- content_for :breadcrumbs do
%li.breadcrumb-item= link_to 'Plantings', plantings_path
@@ -39,10 +39,10 @@
- elsif @planting.percentage_grown.present?
#{@planting.percentage_grown.to_i}%
- if @planting.finish_is_predicatable?
- if @planting.age_in_days < 0
- if @planting.age_in_days.to_i < 0
%strong Planned
- else
%strong #{@planting.age_in_days}/#{@planting.expected_lifespan} days
%strong #{@planting.age_in_days.to_i}/#{@planting.expected_lifespan} days
= render 'timeline', planting: @planting
= render 'likes/likes', object: @planting

View File

@@ -2,7 +2,7 @@
%rss{ version: 2.0 }
%channel
%title
Recent posts from #{@author ? @author : 'all members'} (#{ENV['GROWSTUFF_SITE_NAME']})
Recent posts from #{@author ? @author : 'all members'} (#{site_name})
%link= posts_url
- @posts.each do |post|
%item

View File

@@ -6,13 +6,13 @@
= tag("meta", property: "og:title", content: @post.subject)
= tag("meta", property: "og:type", content: "article")
= tag("meta", property: "og:url", content: request.original_url)
= tag("meta", property: "og:site_name", content: ENV['GROWSTUFF_SITE_NAME'])
= tag("meta", property: "og:site_name", content: site_name)
- if @post.author && !current_member
.alert.alert-info
= link_to @post.author.login_name, member_path(@post.author)
is using
= link_to ENV["GROWSTUFF_SITE_NAME"], root_path
= link_to site_name, root_path
to discuss #{@post.subject} with a community of food gardeners worldwide.
We have advice on growing
= succeed "," do
@@ -20,7 +20,7 @@
and a community from all around the world.
= render "shared/signin_signup",
to: "or to start using #{ENV['GROWSTUFF_SITE_NAME']} to track what you're planting and harvesting"
to: "or to start using #{site_name} to track what you're planting and harvesting"
- content_for :buttonbar do
- if @post.comments.count > 10 && can?(:create, Comment)

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
%rss{ version: 2.0 }
%channel
%title Recent comments on #{@post.subject} (#{ENV['GROWSTUFF_SITE_NAME']})
%title Recent comments on #{@post.subject} (#{site_name})
%link= post_url(@post)
- @post.comments.each do |comment|
%item

View File

@@ -2,7 +2,7 @@
%rss{ version: 2.0 }
%channel
%title
Recent seeds from #{@owner ||= 'all members'} (#{ENV['GROWSTUFF_SITE_NAME']})
Recent seeds from #{@owner ||= 'all members'} (#{site_name})
%link= seeds_url
- @seeds.each do |seed|
%item

View File

@@ -6,7 +6,7 @@
= tag("meta", property: "og:image", content: "#{@seed.owner}'s #{@seed.crop} seeds")
= 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'])
= tag("meta", property: "og:site_name", content: site_name)
- content_for :breadcrumbs do

View File

@@ -0,0 +1 @@
%h1 Support #{site_name}

View File

@@ -175,7 +175,6 @@ en:
Our team includes volunteers from all walks of life and all skill levels. To get involved,
visit %{talk_link} or find more information on the %{wiki_link}.
get_involved_title: Get Involved
github_linktext: Github
open_data_body_html: >
We're building a database of crops, planting advice, seed sources, and other information that anyone
can use for free, under a %{creative_commons_link}. You can use this data for research, to build apps,
@@ -207,10 +206,15 @@ en:
view_all: View all seeds
stats:
member_linktext: "%{count} members"
message_html: So far, %{member} have planted %{number_crops} %{number_plantings} in %{number_gardens}.
message_html: So far, %{member} have planted %{number_crops} %{number_plantings} in %{number_gardens}; and %{contributors} people have contributed to our code on %{github}!
number_crops_linktext: "%{count} crops"
number_gardens_linktext: "%{count} gardens"
number_plantings_linktext: "%{count} times"
pwa_android_steps_html: 1. Tap the three dots in the top right corner of Chrome.<br>2. Tap <strong>Install app</strong> or <strong>Add to Home screen</strong>.
pwa_android_title: For Android
pwa_ios_steps_html: 1. Tap the <strong>Share</strong> button in Safari.<br>2. Scroll down and tap <strong>Add to Home Screen</strong>'.
pwa_ios_title: For iOS (iPhone/iPad)
pwa_title: Want to install Growstuff on your phone?
label:
days_until_harvest: "%{number} days"
weeks_until_harvest: "%{number} weeks until harvest"

View File

@@ -76,10 +76,6 @@ describe "crop detail page", :js do
expect(page).to have_link "Wikipedia (English)", href: crop.en_wikipedia_url
end
it "has a link to OpenFarm" do
expect(page).to have_link "OpenFarm - Growing guide"
end
it "has a link to gardenate" do
expect(page).to have_link "Gardenate - Planting reminders",
href: "https://www.gardenate.com/plant/#{CGI.escape crop.name}"
@@ -144,7 +140,7 @@ describe "crop detail page", :js do
let(:crop) { FactoryBot.create(:annual_crop) }
describe 'with harvests' do
include_examples "predicts harvest"
it_behaves_like "predicts harvest"
end
it "predicts lifespan" do
@@ -165,7 +161,7 @@ describe "crop detail page", :js do
end
describe 'with harvests' do
include_examples "predicts harvest"
it_behaves_like "predicts harvest"
end
it "describes Perennial crops" do
@@ -181,7 +177,7 @@ describe "crop detail page", :js do
end
describe 'with harvests' do
include_examples "predicts harvest"
it_behaves_like "predicts harvest"
end
end
end

View File

@@ -85,21 +85,22 @@ describe "home page", :search do
end
context 'when anonymous' do
include_examples 'show crops'
include_examples 'show plantings'
include_examples 'show harvests'
include_examples 'shows seeds'
include_examples 'is accessible'
it_behaves_like 'show crops'
it_behaves_like 'show plantings'
it_behaves_like 'show harvests'
it_behaves_like 'shows seeds'
it_behaves_like 'is accessible'
it { is_expected.to have_text 'community of food gardeners' }
it { is_expected.to have_text 'Want to install Growstuff on your phone?' }
end
context "when signed in" do
include_context 'signed in member'
include_examples 'show crops'
include_examples 'show plantings'
include_examples 'show harvests'
include_examples 'shows seeds'
include_examples 'is accessible'
it_behaves_like 'show crops'
it_behaves_like 'show plantings'
it_behaves_like 'show harvests'
it_behaves_like 'shows seeds'
it_behaves_like 'is accessible'
describe 'should say welcome' do
before { visit root_path }