Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,8 @@ def title(type, owner, crop, planting)
def og_description(description)
strip_tags(description).split(' ')[0..20].join(' ')
end

def site_name
ENV.fetch('GROWSTUFF_SITE_NAME', 'Growstuff')
end
end
1 change: 1 addition & 0 deletions app/mailers/application_mailer.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# frozen_string_literal: true

class ApplicationMailer < ActionMailer::Base
helper :application
default from: '[email protected]'
layout 'mailer'
end
2 changes: 1 addition & 1 deletion app/views/activities/index.rss.haml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion app/views/activities/show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion app/views/alternate_names/show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion app/views/comments/index.rss.haml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion app/views/crops/_info.haml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
- if [email protected]?
#{@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?
Expand Down
2 changes: 1 addition & 1 deletion app/views/crops/index.rss.haml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions app/views/crops/show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -115,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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
- site_name = ENV['GROWSTUFF_SITE_NAME']
%p Hello #{@resource.login_name},

%p
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
- site_name = ENV['GROWSTUFF_SITE_NAME']
%p Hello #{@resource.login_name},

%p
Expand Down
1 change: 0 additions & 1 deletion app/views/devise/mailer/unlock_instructions.html.haml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
- site_name = ENV['GROWSTUFF_SITE_NAME']
%p Hello #{@resource.login_name},

%p
Expand Down
2 changes: 1 addition & 1 deletion app/views/devise/registrations/_delete.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion app/views/devise/registrations/_edit_email.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down
2 changes: 1 addition & 1 deletion app/views/devise/registrations/_newsletter_blurb.html.haml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 3 additions & 3 deletions app/views/devise/registrations/new.html.haml
Original file line number Diff line number Diff line change
@@ -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),
Expand All @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion app/views/forums/show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion app/views/garden_collaborators/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -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.


Expand Down
2 changes: 1 addition & 1 deletion app/views/garden_types/index.html.haml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion app/views/gardens/show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion app/views/harvests/index.rss.haml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion app/views/harvests/show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion app/views/home/_blurb.html.haml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions app/views/home/index.html.haml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
- 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
Expand Down
14 changes: 7 additions & 7 deletions app/views/layouts/_head.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
4 changes: 2 additions & 2 deletions app/views/members/index.html.haml
Original file line number Diff line number Diff line change
@@ -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" },
Expand Down
2 changes: 1 addition & 1 deletion app/views/members/show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion app/views/members/show.rss.haml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion app/views/notifier_mailer/_signature.html.haml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%p
The #{ENV['GROWSTUFF_SITE_NAME']} team.
The #{site_name} team.
%br/
= link_to root_url, root_url
2 changes: 1 addition & 1 deletion app/views/notifier_mailer/new_crop_request.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
2 changes: 1 addition & 1 deletion app/views/photos/show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion app/views/plantings/index.rss.haml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion app/views/plantings/show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion app/views/posts/index.rss.haml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions app/views/posts/show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@
= 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
= link_to 'hundreds of different crops', crops_url
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)
Expand Down
2 changes: 1 addition & 1 deletion app/views/posts/show.rss.haml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion app/views/seeds/index.rss.haml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion app/views/seeds/show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading
Loading