From a9b25086643db0777bcc0ad7e2856ecc11b07e6e Mon Sep 17 00:00:00 2001 From: Ridhwana Date: Tue, 28 Apr 2020 16:56:29 +0200 Subject: [PATCH] [deploy] Configure the community_member_label (rails console update required) (#7564) * feat: add base site config * chore: rename developer/developers * feat: update to use community_member_label * chore: amend text * chore: update spec * chore: extra space --- app/controllers/internal/configs_controller.rb | 4 +++- app/helpers/application_helper.rb | 4 ++++ app/models/site_config.rb | 1 + app/views/articles/manage.html.erb | 2 +- app/views/dashboards/pro.html.erb | 4 ++-- app/views/internal/configs/show.html.erb | 9 +++++++++ .../mailers/digest_mailer/digest_email.html.erb | 4 ++-- app/views/partnerships/_gold_sponsor_copy.html.erb | 14 +++++++------- app/views/partnerships/index.html.erb | 4 ++-- app/views/podcast_episodes/_meta.html.erb | 6 +++--- spec/helpers/application_helper_spec.rb | 10 ++++++++++ spec/requests/internal/configs_spec.rb | 6 ++++++ 12 files changed, 50 insertions(+), 18 deletions(-) diff --git a/app/controllers/internal/configs_controller.rb b/app/controllers/internal/configs_controller.rb index a526e48b5..a92006c5f 100644 --- a/app/controllers/internal/configs_controller.rb +++ b/app/controllers/internal/configs_controller.rb @@ -32,7 +32,9 @@ class Internal::ConfigsController < Internal::ApplicationController campaign_sidebar_enabled campaign_sidebar_image community_description - community_member_description tagline + community_member_description + community_member_label + tagline favicon_url ga_view_id ga_fetch_rate logo_png diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index de3ab3ce0..442103231 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -177,6 +177,10 @@ module ApplicationHelper mail_to email, text || email, additional_info end + def community_members_label + SiteConfig.community_member_label.pluralize + end + # Creates an app internal URL # # @note Uses protocol and domain specified in the environment, ensure they are set. diff --git a/app/models/site_config.rb b/app/models/site_config.rb index 6b4635849..f916b367b 100644 --- a/app/models/site_config.rb +++ b/app/models/site_config.rb @@ -14,6 +14,7 @@ class SiteConfig < RailsSettings::Base # Community Content field :community_description, type: :string, default: "A constructive and inclusive social network. Open source and radically transparent." field :community_member_description, type: :string, default: "amazing humans who code." + field :community_member_label, type: :string, default: "user" field :tagline, type: :string, default: "We're a place where coders share, stay up-to-date and grow their careers." field :mascot_user_id, type: :integer, default: 1 diff --git a/app/views/articles/manage.html.erb b/app/views/articles/manage.html.erb index 0dd9caf12..16b0f5c9f 100644 --- a/app/views/articles/manage.html.erb +++ b/app/views/articles/manage.html.erb @@ -11,7 +11,7 @@

<%= flash[:pins_success] %>

<% end %>

Tools:

-

Suggest a Tweet: Help get your post in front of more developers by suggesting a tweet that ">@<%= SiteConfig.social_media_handles["twitter"] %> editors can use. +

Suggest a Tweet: Help get your post in front of more <%= community_members_label %> by suggesting a tweet that ">@<%= SiteConfig.social_media_handles["twitter"] %> editors can use.

Experience Level of Post: The best target dev experience level— a gentle indicator to help show the post to the people who will benefit the most.

Tips:

    diff --git a/app/views/dashboards/pro.html.erb b/app/views/dashboards/pro.html.erb index 40412ff93..22762e1cb 100644 --- a/app/views/dashboards/pro.html.erb +++ b/app/views/dashboards/pro.html.erb @@ -18,8 +18,8 @@

    Pro Dashboard for <%= @user_or_org.name %>

    -

    Welcome to the Pro Dashboard, the home of in-depth user metrics so that authors can make data-driven decisions about the developer ecosystem.

    -

    This dashboard highlights deep insights especially relevant to developer relations, authors, and serious bloggers.

    +

    Welcome to the Pro Dashboard, the home of in-depth user metrics so that authors can make data-driven decisions about the <%= SiteConfig.community_member_label %> ecosystem.

    +

    This dashboard highlights deep insights especially relevant to <%= SiteConfig.community_member_label %> relations, authors, and serious bloggers.

    <%= render "shared/stats" %> diff --git a/app/views/internal/configs/show.html.erb b/app/views/internal/configs/show.html.erb index 42f650f13..456882c65 100644 --- a/app/views/internal/configs/show.html.erb +++ b/app/views/internal/configs/show.html.erb @@ -50,6 +50,15 @@
    Used in pre-login banners.
    +
    + <%= f.label :community_member_label, "Community member name" %> + <%= f.text_field :community_member_label, + class: "form-control", + value: SiteConfig.community_member_label, + placeholder: "" %> +
    Used to determine what a member will be called e.g developer, hobbyist etc.
    +
    +
    <%= f.label :tagline, "Tagline" %> <%= f.text_field :tagline, diff --git a/app/views/mailers/digest_mailer/digest_email.html.erb b/app/views/mailers/digest_mailer/digest_email.html.erb index f4f5ea8e1..5934c80a4 100644 --- a/app/views/mailers/digest_mailer/digest_email.html.erb +++ b/app/views/mailers/digest_mailer/digest_email.html.erb @@ -14,7 +14,7 @@
    👋 Looking for work? ">Browse job openings or create an ">available for hire listing.
    - 🔍 Hiring developers? Post your position(s) on <%= community_name %> Listings. + 🔍 Hiring <%= community_members_label %>? Post your position(s) on <%= community_name %> Listings.
    @@ -29,7 +29,7 @@ You can change it any time in the future. Happy coding! <% elsif @user.follows.size == 0 %> - <%= community_name %> Digest is a new periodic email featuring the best posts from our community of developers. + <%= community_name %> Digest is a new periodic email featuring the best posts from our community of <%= community_members_label %>.

    Your digest is not yet customized. Follow the people and technologies on diff --git a/app/views/partnerships/_gold_sponsor_copy.html.erb b/app/views/partnerships/_gold_sponsor_copy.html.erb index 7de30366a..9d11acc59 100644 --- a/app/views/partnerships/_gold_sponsor_copy.html.erb +++ b/app/views/partnerships/_gold_sponsor_copy.html.erb @@ -1,34 +1,34 @@

    Gold Sponsorship

    -🏆 The Gold Standard. This is our highest level of community sponsorship, and we work with just three Gold partners each month. Here are more details about our most substantial sponsorship package: +🏆 The Gold Standard. This is our highest level of community sponsorship, and we work with just three Gold partners each month. Here are more details about our most substantial sponsorship package:

    👀 Dedicated homepage logo + tagline placement

    - Your company will receive prominent logo and tagline placement directly on the <%= community_name %> homepage, where it will be seen by hundreds of thousands of unique visitors each month. This is the most prime real estate on the platform, dedicated just for our Gold sponsors. + Your company will receive prominent logo and tagline placement directly on the <%= community_name %> homepage, where it will be seen by hundreds of thousands of unique visitors each month. This is the most prime real estate on the platform, dedicated just for our Gold sponsors.

    🙌 Inclusion in our weekly newsletter, and the option to add a boosted article to every newsletter

    -Each week, we send a newsletter to ~150k subscribed developers, seeing ~30% open rates for each issue. Your logo and a short blurb will be featured at the bottom of each email. +Each week, we send a newsletter to ~150k subscribed <%= community_members_label %>, seeing ~30% open rates for each issue. Your logo and a short blurb will be featured at the bottom of each email.

    -As a Gold sponsor, you will have an exclusive opportunity to include one boosted article in each weekly newsletter. This is an incredible channel to promote your work to a highly-targeted audience of passionate developers. +As a Gold sponsor, you will have an exclusive opportunity to include one boosted article in each weekly newsletter. This is an incredible channel to promote your work to a highly-targeted audience of passionate <%= community_members_label %>.

    👋 Top real estate on the dedicated sponsorships page, including a full write-up

    - The dedicated sponsorship page lists all the organizations that support the community. You will receive top placement, featuring not just your logo, but a full write-up that highlights your company and emphasizes the most important aspects of your company’s message. It will stand tall amongst all other sponsors on the page. + The dedicated sponsorship page lists all the organizations that support the community. You will receive top placement, featuring not just your logo, but a full write-up that highlights your company and emphasizes the most important aspects of your company’s message. It will stand tall amongst all other sponsors on the page.

    💪 Prominent placement in our monthly sponsor-awareness thread

    -Each month, we publish an awareness and recognition thread where we highlight the organizations that support the community. You will receive the most prominent placement, including a full write-up about your product or service. This thread will serve to drive major awareness, engagement, and positive association to your company. +Each month, we publish an awareness and recognition thread where we highlight the organizations that support the community. You will receive the most prominent placement, including a full write-up about your product or service. This thread will serve to drive major awareness, engagement, and positive association to your company.

    It will also include a call-to-action to follow your organization directly in the post. @@ -37,7 +37,7 @@ It will also include a call-to-action to follow your organization directly in th 🏆 Special flair on your organization profile page

    -As a Gold sponsor, you will receive special flair that lives on your organization page. This visual cue will show the <%= community_name %> Community and broader ecosystem that you are an important community supporter, providing a natural draw for increased engagement on the platform. And, of course, you’ll have bragging rights and company pride knowing that you’re supporting a wonderful community. +As a Gold sponsor, you will receive special flair that lives on your organization page. This visual cue will show the <%= community_name %> Community and broader ecosystem that you are an important community supporter, providing a natural draw for increased engagement on the platform. And, of course, you’ll have bragging rights and company pride knowing that you’re supporting a wonderful community.

    <% unless user_signed_in? %>

    Email <%= email_link(:business) %> for pricing information

    diff --git a/app/views/partnerships/index.html.erb b/app/views/partnerships/index.html.erb index 15cdc5a03..18467c7e5 100644 --- a/app/views/partnerships/index.html.erb +++ b/app/views/partnerships/index.html.erb @@ -10,11 +10,11 @@

    Partner With " />

    🚀 Reach

    - <%= community_name %> serves millions of unique visitors per month. This highly-targeted developer audience is comprised of registered members (<%= number_with_delimiter(User.estimated_count) %>) and visitors from the open web — many of whom visit <%= community_name %> as part of their daily routine. You may be interested in the public analytics available on SimilarWeb. + <%= community_name %> serves millions of unique visitors per month. This highly-targeted <%= SiteConfig.community_member_label %> audience is comprised of registered members (<%= number_with_delimiter(User.estimated_count) %>) and visitors from the open web — many of whom visit <%= community_name %> as part of their daily routine. You may be interested in the public analytics available on SimilarWeb.

    ❤️ Community

    - <%= community_name %> is committed to maintaining an inclusive and constructive environment, and welcomes developers of all backgrounds and experience levels. We work with a large group of community moderators who help us uphold and enforce our Code of Conduct. + <%= community_name %> is committed to maintaining an inclusive and constructive environment, and welcomes <%= community_members_label %> of all backgrounds and experience levels. We work with a large group of community moderators who help us uphold and enforce our Code of Conduct.

    💎 Quality

    diff --git a/app/views/podcast_episodes/_meta.html.erb b/app/views/podcast_episodes/_meta.html.erb index 73167abe0..1b6125cc9 100644 --- a/app/views/podcast_episodes/_meta.html.erb +++ b/app/views/podcast_episodes/_meta.html.erb @@ -25,7 +25,7 @@ <% title "Podcasts" %> <%= content_for :page_meta do %> - + @@ -33,14 +33,14 @@ - + "> "> - + <% end %> <% end %> diff --git a/spec/helpers/application_helper_spec.rb b/spec/helpers/application_helper_spec.rb index d57f47b3a..0841c039d 100644 --- a/spec/helpers/application_helper_spec.rb +++ b/spec/helpers/application_helper_spec.rb @@ -147,4 +147,14 @@ RSpec.describe ApplicationHelper, type: :helper do expect(email_link(text: "text", additional_info: additional_info)).to eq("text") end end + + describe "#community_members_label" do + before do + allow(SiteConfig).to receive(:community_member_label).and_return("hobbyist") + end + + it "returns the pluralized community_member_label" do + expect(community_members_label).to eq("hobbyists") + end + end end diff --git a/spec/requests/internal/configs_spec.rb b/spec/requests/internal/configs_spec.rb index 3e8e866f4..755e8dfff 100644 --- a/spec/requests/internal/configs_spec.rb +++ b/spec/requests/internal/configs_spec.rb @@ -52,6 +52,12 @@ RSpec.describe "/internal/config", type: :request do expect(SiteConfig.community_member_description).to eq(description) end + it "updates the community_member_label" do + name = "developer" + post "/internal/config", params: { site_config: { community_member_label: name }, confirmation: confirmation_message } + expect(SiteConfig.community_member_label).to eq(name) + end + it "updates the tagline" do description = "Hey hey #{rand(100)}" post "/internal/config", params: { site_config: { tagline: description }, confirmation: confirmation_message }