From e763da0d753f5d24635638b35904ea09f127ce5c Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Sun, 31 Aug 2025 05:19:23 +0000 Subject: [PATCH] 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. --- app/helpers/application_helper.rb | 4 ++++ app/mailers/application_mailer.rb | 1 + app/views/activities/index.rss.haml | 2 +- app/views/activities/show.html.haml | 2 +- app/views/admin/index.html.haml | 2 +- app/views/alternate_names/show.html.haml | 2 +- app/views/comments/index.rss.haml | 2 +- app/views/crops/_info.haml | 2 +- app/views/crops/index.rss.haml | 2 +- app/views/crops/show.html.haml | 4 ++-- .../mailer/confirmation_instructions.html.haml | 1 - .../mailer/reset_password_instructions.html.haml | 1 - .../devise/mailer/unlock_instructions.html.haml | 1 - app/views/devise/registrations/_delete.html.haml | 2 +- .../devise/registrations/_edit_email.html.haml | 2 +- .../registrations/_newsletter_blurb.html.haml | 2 +- app/views/devise/registrations/new.html.haml | 6 +++--- app/views/forums/show.html.haml | 2 +- app/views/garden_collaborators/index.html.haml | 2 +- app/views/garden_types/index.html.haml | 2 +- app/views/gardens/show.html.haml | 2 +- app/views/harvests/index.rss.haml | 2 +- app/views/harvests/show.html.haml | 2 +- app/views/home/_blurb.html.haml | 2 +- app/views/home/index.html.haml | 4 ++-- app/views/layouts/_head.html.haml | 14 +++++++------- app/views/members/index.html.haml | 4 ++-- app/views/members/show.html.haml | 2 +- app/views/members/show.rss.haml | 2 +- app/views/notifier_mailer/_signature.html.haml | 2 +- .../notifier_mailer/new_crop_request.html.haml | 2 +- app/views/photos/show.html.haml | 2 +- app/views/plantings/index.rss.haml | 2 +- app/views/plantings/show.html.haml | 2 +- app/views/posts/index.rss.haml | 2 +- app/views/posts/show.html.haml | 6 +++--- app/views/posts/show.rss.haml | 2 +- app/views/seeds/index.rss.haml | 2 +- app/views/seeds/show.html.haml | 2 +- app/views/support/index.html.haml | 1 + 40 files changed, 53 insertions(+), 50 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 98fb076be3..8d3a9cb2c2 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -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 diff --git a/app/mailers/application_mailer.rb b/app/mailers/application_mailer.rb index d84cb6e71e..4766d5ee8b 100644 --- a/app/mailers/application_mailer.rb +++ b/app/mailers/application_mailer.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true class ApplicationMailer < ActionMailer::Base + helper :application default from: 'from@example.com' layout 'mailer' end diff --git a/app/views/activities/index.rss.haml b/app/views/activities/index.rss.haml index d1d89dec7e..779975553e 100644 --- a/app/views/activities/index.rss.haml +++ b/app/views/activities/index.rss.haml @@ -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 diff --git a/app/views/activities/show.html.haml b/app/views/activities/show.html.haml index 982daa1d8e..6b155b6bb4 100644 --- a/app/views/activities/show.html.haml +++ b/app/views/activities/show.html.haml @@ -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 diff --git a/app/views/admin/index.html.haml b/app/views/admin/index.html.haml index d987411df0..e775656f25 100644 --- a/app/views/admin/index.html.haml +++ b/app/views/admin/index.html.haml @@ -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 diff --git a/app/views/alternate_names/show.html.haml b/app/views/alternate_names/show.html.haml index 59d5fc04e8..0517748042 100644 --- a/app/views/alternate_names/show.html.haml +++ b/app/views/alternate_names/show.html.haml @@ -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 diff --git a/app/views/comments/index.rss.haml b/app/views/comments/index.rss.haml index 180274f314..5650c03c90 100644 --- a/app/views/comments/index.rss.haml +++ b/app/views/comments/index.rss.haml @@ -1,7 +1,7 @@ %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 diff --git a/app/views/crops/_info.haml b/app/views/crops/_info.haml index 3b1c343689..051bef3bed 100644 --- a/app/views/crops/_info.haml +++ b/app/views/crops/_info.haml @@ -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? diff --git a/app/views/crops/index.rss.haml b/app/views/crops/index.rss.haml index 5a2da356b8..5baf8b6d20 100644 --- a/app/views/crops/index.rss.haml +++ b/app/views/crops/index.rss.haml @@ -1,7 +1,7 @@ %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 diff --git a/app/views/crops/show.html.haml b/app/views/crops/show.html.haml index 8478b09d4a..aa1081dadc 100644 --- a/app/views/crops/show.html.haml +++ b/app/views/crops/show.html.haml @@ -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" @@ -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 diff --git a/app/views/devise/mailer/confirmation_instructions.html.haml b/app/views/devise/mailer/confirmation_instructions.html.haml index 333258a5d7..c36cb07076 100644 --- a/app/views/devise/mailer/confirmation_instructions.html.haml +++ b/app/views/devise/mailer/confirmation_instructions.html.haml @@ -1,4 +1,3 @@ -- site_name = ENV['GROWSTUFF_SITE_NAME'] %p Hello #{@resource.login_name}, %p diff --git a/app/views/devise/mailer/reset_password_instructions.html.haml b/app/views/devise/mailer/reset_password_instructions.html.haml index 2af1c27f33..f00b7610cb 100644 --- a/app/views/devise/mailer/reset_password_instructions.html.haml +++ b/app/views/devise/mailer/reset_password_instructions.html.haml @@ -1,4 +1,3 @@ -- site_name = ENV['GROWSTUFF_SITE_NAME'] %p Hello #{@resource.login_name}, %p diff --git a/app/views/devise/mailer/unlock_instructions.html.haml b/app/views/devise/mailer/unlock_instructions.html.haml index 9bdc87543e..0ad436aa7c 100644 --- a/app/views/devise/mailer/unlock_instructions.html.haml +++ b/app/views/devise/mailer/unlock_instructions.html.haml @@ -1,4 +1,3 @@ -- site_name = ENV['GROWSTUFF_SITE_NAME'] %p Hello #{@resource.login_name}, %p diff --git a/app/views/devise/registrations/_delete.html.haml b/app/views/devise/registrations/_delete.html.haml index d1c582e360..96fc6faa6a 100644 --- a/app/views/devise/registrations/_delete.html.haml +++ b/app/views/devise/registrations/_delete.html.haml @@ -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 diff --git a/app/views/devise/registrations/_edit_email.html.haml b/app/views/devise/registrations/_edit_email.html.haml index 6c96712153..bb6a7aceca 100644 --- a/app/views/devise/registrations/_edit_email.html.haml +++ b/app/views/devise/registrations/_edit_email.html.haml @@ -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' diff --git a/app/views/devise/registrations/_newsletter_blurb.html.haml b/app/views/devise/registrations/_newsletter_blurb.html.haml index 3ba06ba710..c71464e99e 100644 --- a/app/views/devise/registrations/_newsletter_blurb.html.haml +++ b/app/views/devise/registrations/_newsletter_blurb.html.haml @@ -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 diff --git a/app/views/devise/registrations/new.html.haml b/app/views/devise/registrations/new.html.haml index 3a895b73f3..d803944b1d 100644 --- a/app/views/devise/registrations/new.html.haml +++ b/app/views/devise/registrations/new.html.haml @@ -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' diff --git a/app/views/forums/show.html.haml b/app/views/forums/show.html.haml index 1faebc348c..5da5452cf6 100644 --- a/app/views/forums/show.html.haml +++ b/app/views/forums/show.html.haml @@ -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 diff --git a/app/views/garden_collaborators/index.html.haml b/app/views/garden_collaborators/index.html.haml index 6f9fec3f20..57b4168aa6 100644 --- a/app/views/garden_collaborators/index.html.haml +++ b/app/views/garden_collaborators/index.html.haml @@ -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. diff --git a/app/views/garden_types/index.html.haml b/app/views/garden_types/index.html.haml index d40e16ae9a..3073e6720e 100644 --- a/app/views/garden_types/index.html.haml +++ b/app/views/garden_types/index.html.haml @@ -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 diff --git a/app/views/gardens/show.html.haml b/app/views/gardens/show.html.haml index 33934d87c0..a8db840fec 100644 --- a/app/views/gardens/show.html.haml +++ b/app/views/gardens/show.html.haml @@ -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 diff --git a/app/views/harvests/index.rss.haml b/app/views/harvests/index.rss.haml index 10f226d47a..4dd054ae92 100644 --- a/app/views/harvests/index.rss.haml +++ b/app/views/harvests/index.rss.haml @@ -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 diff --git a/app/views/harvests/show.html.haml b/app/views/harvests/show.html.haml index 88d55664a3..300fdb8591 100644 --- a/app/views/harvests/show.html.haml +++ b/app/views/harvests/show.html.haml @@ -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 diff --git a/app/views/home/_blurb.html.haml b/app/views/home/_blurb.html.haml index f9997a028b..448987f27b 100644 --- a/app/views/home/_blurb.html.haml +++ b/app/views/home/_blurb.html.haml @@ -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 diff --git a/app/views/home/index.html.haml b/app/views/home/index.html.haml index 6e8c60d9a6..a634b29fa2 100644 --- a/app/views/home/index.html.haml +++ b/app/views/home/index.html.haml @@ -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 diff --git a/app/views/layouts/_head.html.haml b/app/views/layouts/_head.html.haml index e3058ad555..a86007bdfe 100644 --- a/app/views/layouts/_head.html.haml +++ b/app/views/layouts/_head.html.haml @@ -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" diff --git a/app/views/members/index.html.haml b/app/views/members/index.html.haml index 64d85cfb7f..59a44e2f18 100644 --- a/app/views/members/index.html.haml +++ b/app/views/members/index.html.haml @@ -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" }, diff --git a/app/views/members/show.html.haml b/app/views/members/show.html.haml index e37d9bd30e..1c60c03770 100644 --- a/app/views/members/show.html.haml +++ b/app/views/members/show.html.haml @@ -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 diff --git a/app/views/members/show.rss.haml b/app/views/members/show.rss.haml index aded083b0e..f706eda296 100644 --- a/app/views/members/show.rss.haml +++ b/app/views/members/show.rss.haml @@ -1,7 +1,7 @@ %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 diff --git a/app/views/notifier_mailer/_signature.html.haml b/app/views/notifier_mailer/_signature.html.haml index 78b5dca9b7..029a624bfa 100644 --- a/app/views/notifier_mailer/_signature.html.haml +++ b/app/views/notifier_mailer/_signature.html.haml @@ -1,4 +1,4 @@ %p - The #{ENV['GROWSTUFF_SITE_NAME']} team. + The #{site_name} team. %br/ = link_to root_url, root_url diff --git a/app/views/notifier_mailer/new_crop_request.html.haml b/app/views/notifier_mailer/new_crop_request.html.haml index 17974d57c9..7f0627e8ff 100644 --- a/app/views/notifier_mailer/new_crop_request.html.haml +++ b/app/views/notifier_mailer/new_crop_request.html.haml @@ -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} diff --git a/app/views/photos/show.html.haml b/app/views/photos/show.html.haml index 6af8bed0a3..d91e6976f0 100644 --- a/app/views/photos/show.html.haml +++ b/app/views/photos/show.html.haml @@ -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 diff --git a/app/views/plantings/index.rss.haml b/app/views/plantings/index.rss.haml index 6a7536755d..5087d7ed84 100644 --- a/app/views/plantings/index.rss.haml +++ b/app/views/plantings/index.rss.haml @@ -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 diff --git a/app/views/plantings/show.html.haml b/app/views/plantings/show.html.haml index db5af66c6f..47a73f4f6c 100644 --- a/app/views/plantings/show.html.haml +++ b/app/views/plantings/show.html.haml @@ -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 diff --git a/app/views/posts/index.rss.haml b/app/views/posts/index.rss.haml index 6e485464de..ed05463b3a 100644 --- a/app/views/posts/index.rss.haml +++ b/app/views/posts/index.rss.haml @@ -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 diff --git a/app/views/posts/show.html.haml b/app/views/posts/show.html.haml index be53ae27d3..3ef5101a33 100644 --- a/app/views/posts/show.html.haml +++ b/app/views/posts/show.html.haml @@ -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) diff --git a/app/views/posts/show.rss.haml b/app/views/posts/show.rss.haml index f98642a5e4..30f1c46235 100644 --- a/app/views/posts/show.rss.haml +++ b/app/views/posts/show.rss.haml @@ -1,7 +1,7 @@ %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 diff --git a/app/views/seeds/index.rss.haml b/app/views/seeds/index.rss.haml index 912e11293e..27047d3da5 100644 --- a/app/views/seeds/index.rss.haml +++ b/app/views/seeds/index.rss.haml @@ -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 diff --git a/app/views/seeds/show.html.haml b/app/views/seeds/show.html.haml index da321243e5..f937681f4d 100644 --- a/app/views/seeds/show.html.haml +++ b/app/views/seeds/show.html.haml @@ -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 diff --git a/app/views/support/index.html.haml b/app/views/support/index.html.haml index e69de29bb2..1cf32e0242 100644 --- a/app/views/support/index.html.haml +++ b/app/views/support/index.html.haml @@ -0,0 +1 @@ +%h1 Support #{site_name}