Use and organize constants for the config page (#9891)
* feat: update the descriptions * feat: alphebatize * alphabetize
This commit is contained in:
parent
d6465750ba
commit
df9aa4c5ae
2 changed files with 161 additions and 139 deletions
|
|
@ -5,14 +5,18 @@ module Constants
|
|||
description: "How can users sign in?",
|
||||
placeholder: ""
|
||||
},
|
||||
campaign_hero_html_variant_name: {
|
||||
description: "Hero HtmlVariant name",
|
||||
placeholder: ""
|
||||
},
|
||||
campaign_articles_require_approval: {
|
||||
description: "",
|
||||
placeholder: "Campaign stories show up on sidebar with approval?"
|
||||
},
|
||||
campaign_featured_tags: {
|
||||
description: "Posts with which tags will be featured in the campaign sidebar (comma separated, letters only)",
|
||||
placeholder: "List of campaign tags: comma separated, letters only e.g. shecoded,theycoded"
|
||||
},
|
||||
campaign_hero_html_variant_name: {
|
||||
description: "Hero HtmlVariant name",
|
||||
placeholder: ""
|
||||
},
|
||||
campaign_sidebar_enabled: {
|
||||
description: "",
|
||||
placeholder: "Campaign sidebar enabled or not"
|
||||
|
|
@ -25,71 +29,80 @@ module Constants
|
|||
description: "https://url.com/lander",
|
||||
placeholder: "URL campaign sidebar image will link to"
|
||||
},
|
||||
campaign_featured_tags: {
|
||||
description: "Posts with which tags will be featured in the campaign sidebar (comma separated, letters only)",
|
||||
placeholder: "List of campaign tags: comma separated, letters only e.g. shecoded,theycoded"
|
||||
},
|
||||
community_description: {
|
||||
description: "Used in meta description tags etc.",
|
||||
placeholder: "A fabulous community of kind and welcoming people."
|
||||
},
|
||||
community_name: {
|
||||
description: "Primary name... e.g. DEV",
|
||||
placeholder: "New Forem"
|
||||
},
|
||||
community_member_label: {
|
||||
description: "Used to determine what a member will be called e.g developer, hobbyist etc.",
|
||||
placeholder: "user"
|
||||
},
|
||||
community_action: {
|
||||
description: "Used to determine the action of community e.g coding, reading, training etc.",
|
||||
placeholder: ""
|
||||
placeholder: "coding"
|
||||
},
|
||||
community_copyright_start_year: {
|
||||
description: "Used to mark the year this forem was started.",
|
||||
placeholder: Time.zone.today.year.to_s
|
||||
},
|
||||
staff_user_id: {
|
||||
description: "Account ID which acts as automated 'staff'— used principally for welcome thread.",
|
||||
placeholder: ""
|
||||
community_description: {
|
||||
description: "Used in meta description tags etc.",
|
||||
placeholder: "A fabulous community of kind and welcoming people."
|
||||
},
|
||||
tagline: {
|
||||
description: "Used in signup modal.",
|
||||
placeholder: "We're a place where coders share, stay up-to-date and grow their careers."
|
||||
community_member_label: {
|
||||
description: "Used to determine what a member will be called e.g developer, hobbyist etc.",
|
||||
placeholder: "user"
|
||||
},
|
||||
email_addresses: {
|
||||
description: "Email address",
|
||||
placeholder: ""
|
||||
community_name: {
|
||||
description: "Primary name... e.g. DEV",
|
||||
placeholder: "New Forem"
|
||||
},
|
||||
periodic_email_digest_max: {
|
||||
description: "Determines the maximum for the periodic email digest",
|
||||
placeholder: 0
|
||||
credit_prices_in_cents: {
|
||||
small: {
|
||||
description: "Price for small credit purchase (<10 credits).",
|
||||
placeholder: ""
|
||||
},
|
||||
medium: {
|
||||
description: "Price for medium credit purchase (10 - 99 credits).",
|
||||
placeholder: ""
|
||||
},
|
||||
large: {
|
||||
description: "Price for large credit purchase (100 - 999 credits).",
|
||||
placeholder: ""
|
||||
},
|
||||
xlarge: {
|
||||
description: "Price for extra large credit purchase (1000 credits or more).",
|
||||
placeholder: ""
|
||||
}
|
||||
},
|
||||
periodic_email_digest_min: {
|
||||
description: "Determines the mininum for the periodic email digest",
|
||||
placeholder: 2
|
||||
},
|
||||
jobs_url: {
|
||||
description: "URL of the website where open positions are posted",
|
||||
placeholder: "Jobs URL"
|
||||
default_font: {
|
||||
description: "Determines the default Base Reading Font (registered users can change this in their UX settings)"
|
||||
},
|
||||
display_jobs_banner: {
|
||||
description: "Display a jobs banner that points users to the jobs page when they type 'job'" \
|
||||
"or 'jobs' in the search box",
|
||||
placeholder: ""
|
||||
},
|
||||
ga_view_id: {
|
||||
description: "Google Analytics Reporting API v4 - View ID",
|
||||
email_addresses: {
|
||||
description: "Email address",
|
||||
placeholder: ""
|
||||
},
|
||||
main_social_image: {
|
||||
description: "Used as the main image in social networks and OpenGraph",
|
||||
placeholder: "https://image.url"
|
||||
},
|
||||
favicon_url: {
|
||||
description: "Used as the site favicon",
|
||||
placeholder: "https://image.url"
|
||||
},
|
||||
feed_style: {
|
||||
description: "Determines which default feed the users sees (rich content, more minimal, etc.)",
|
||||
placeholder: "basic, rich, or compact"
|
||||
},
|
||||
ga_view_id: {
|
||||
description: "Google Analytics Reporting API v4 - View ID",
|
||||
placeholder: ""
|
||||
},
|
||||
health_check_token: {
|
||||
description: "Used to authenticate with your health check endpoints.",
|
||||
placeholder: "a secure token"
|
||||
},
|
||||
jobs_url: {
|
||||
description: "URL of the website where open positions are posted",
|
||||
placeholder: "Jobs URL"
|
||||
},
|
||||
left_navbar_svg_icon: {
|
||||
description: "The SVG icon used to expand the left navbar navigation menu. Should be a max of 24x24px.",
|
||||
placeholder: "<svg ...></svg>"
|
||||
},
|
||||
logo_png: {
|
||||
description: "Minimum 1024px, used for PWA etc.",
|
||||
placeholder: "https://image.url/image.png"
|
||||
|
|
@ -98,57 +111,10 @@ module Constants
|
|||
description: "Used as the SVG logo of the community",
|
||||
placeholder: "<svg ...></svg>"
|
||||
},
|
||||
secondary_logo_url: {
|
||||
description: "Used as the secondary logo",
|
||||
main_social_image: {
|
||||
description: "Used as the main image in social networks and OpenGraph",
|
||||
placeholder: "https://image.url"
|
||||
},
|
||||
left_navbar_svg_icon: {
|
||||
description: "The SVG icon used to expand the left navbar navigation menu. Should be a max of 24x24px.",
|
||||
placeholder: "<svg ...></svg>"
|
||||
},
|
||||
right_navbar_svg_icon: {
|
||||
description: "The SVG icon used to expand the right navbar navigation menu. Should be a max of 24x24px.",
|
||||
placeholder: "<svg ...></svg>"
|
||||
},
|
||||
mascot_user_id: {
|
||||
description: "User ID of the Mascot account",
|
||||
placeholder: "1"
|
||||
},
|
||||
mascot_image_url: {
|
||||
description: "Used as the mascot image.",
|
||||
placeholder: "https://image.url"
|
||||
},
|
||||
mascot_footer_image_url: {
|
||||
description: "Special cute mascot image used in the footer.",
|
||||
placeholder: "https://image.url"
|
||||
},
|
||||
mascot_image_description: {
|
||||
description: "Used as the alt text for the mascot image",
|
||||
placeholder: ""
|
||||
},
|
||||
meta_keywords: {
|
||||
description: "",
|
||||
placeholder: "List of valid keywords: comma separated, letters only e.g. engineering, development"
|
||||
},
|
||||
shop_url: {
|
||||
description: "Used as the shop url of the community",
|
||||
placeholder: "https://shop.url"
|
||||
},
|
||||
payment_pointer: {
|
||||
description: "Used for site-wide web monetization. " \
|
||||
"See: https://github.com/thepracticaldev/dev.to/pull/6345",
|
||||
placeholder: "$pay.somethinglikethis.co/value"
|
||||
},
|
||||
stripe_api_key: {
|
||||
description: "Secret Stripe key for receiving payments. " \
|
||||
"See: https://stripe.com/docs/keys",
|
||||
placeholder: "sk_live_...."
|
||||
},
|
||||
stripe_publishable_key: {
|
||||
description: "Public Stripe key for receiving payments. " \
|
||||
"See: https://stripe.com/docs/keys",
|
||||
placeholder: "pk_live_...."
|
||||
},
|
||||
mailchimp_newsletter_id: {
|
||||
description: "Main Newsletter ID",
|
||||
placeholder: ""
|
||||
|
|
@ -165,18 +131,85 @@ module Constants
|
|||
description: "Community Moderators Newsletter ID",
|
||||
placeholder: ""
|
||||
},
|
||||
onboarding_logo_image: {
|
||||
description: "Main onboarding display logo image",
|
||||
mascot_footer_image_url: {
|
||||
description: "Special cute mascot image used in the footer.",
|
||||
placeholder: "https://image.url"
|
||||
},
|
||||
mascot_image_description: {
|
||||
description: "Used as the alt text for the mascot image",
|
||||
placeholder: ""
|
||||
},
|
||||
mascot_image_url: {
|
||||
description: "Used as the mascot image.",
|
||||
placeholder: "https://image.url"
|
||||
},
|
||||
mascot_user_id: {
|
||||
description: "User ID of the Mascot account",
|
||||
placeholder: "1"
|
||||
},
|
||||
meta_keywords: {
|
||||
description: "",
|
||||
placeholder: "List of valid keywords: comma separated, letters only e.g. engineering, development"
|
||||
},
|
||||
onboarding_background_image: {
|
||||
description: "Background for onboarding splash page",
|
||||
placeholder: "https://image.url"
|
||||
},
|
||||
onboarding_logo_image: {
|
||||
description: "Main onboarding display logo image",
|
||||
placeholder: "https://image.url"
|
||||
},
|
||||
onboarding_taskcard_image: {
|
||||
description: "Used as the onboarding task-card image",
|
||||
placeholder: "https://image.url"
|
||||
},
|
||||
payment_pointer: {
|
||||
description: "Used for site-wide web monetization. " \
|
||||
"See: https://github.com/thepracticaldev/dev.to/pull/6345",
|
||||
placeholder: "$pay.somethinglikethis.co/value"
|
||||
},
|
||||
periodic_email_digest_max: {
|
||||
description: "Determines the maximum for the periodic email digest",
|
||||
placeholder: 0
|
||||
},
|
||||
periodic_email_digest_min: {
|
||||
description: "Determines the mininum for the periodic email digest",
|
||||
placeholder: 2
|
||||
},
|
||||
right_navbar_svg_icon: {
|
||||
description: "The SVG icon used to expand the right navbar navigation menu. Should be a max of 24x24px.",
|
||||
placeholder: "<svg ...></svg>"
|
||||
},
|
||||
secondary_logo_url: {
|
||||
description: "Used as the secondary logo",
|
||||
placeholder: "https://image.url"
|
||||
},
|
||||
shop_url: {
|
||||
description: "Used as the shop url of the community",
|
||||
placeholder: "https://shop.url"
|
||||
},
|
||||
sidebar_tags: {
|
||||
description: "Determines which tags are shown on the homepage righthand sidebar",
|
||||
placeholder: "List of valid tags: comma separated, letters only e.g. help,discuss,explainlikeimfive,meta"
|
||||
},
|
||||
sponsor_headline: {
|
||||
description: "Determines the heading text of the main sponsors sidebar above the list of sponsors.",
|
||||
placeholder: "Community Sponsors"
|
||||
},
|
||||
staff_user_id: {
|
||||
description: "Account ID which acts as automated 'staff'— used principally for welcome thread.",
|
||||
placeholder: ""
|
||||
},
|
||||
stripe_api_key: {
|
||||
description: "Secret Stripe key for receiving payments. " \
|
||||
"See: https://stripe.com/docs/keys",
|
||||
placeholder: "sk_live_...."
|
||||
},
|
||||
stripe_publishable_key: {
|
||||
description: "Public Stripe key for receiving payments. " \
|
||||
"See: https://stripe.com/docs/keys",
|
||||
placeholder: "pk_live_...."
|
||||
},
|
||||
suggested_tags: {
|
||||
description: "Determines which tags are suggested to new users during onboarding (comma
|
||||
separated, letters only)",
|
||||
|
|
@ -188,24 +221,13 @@ module Constants
|
|||
"recently-active commenters or producers can be suggested",
|
||||
placeholder: "List of valid usernames: comma separated, letters only e.g. ben,jess,peter,maestromac,andy,liana"
|
||||
},
|
||||
tagline: {
|
||||
description: "Used in signup modal.",
|
||||
placeholder: "We're a place where coders share, stay up-to-date and grow their careers."
|
||||
},
|
||||
twitter_hashtag: {
|
||||
description: "Used as the twitter hashtag of the community",
|
||||
placeholder: "#DEVCommunity"
|
||||
},
|
||||
sponsor_headline: {
|
||||
description: "Determines the heading text of the main sponsors sidebar above the list of sponsors.",
|
||||
placeholder: "Community Sponsors"
|
||||
},
|
||||
sidebar_tags: {
|
||||
description: "Determines which tags are shown on the homepage righthand sidebar",
|
||||
placeholder: "List of valid tags: comma separated, letters only e.g. help,discuss,explainlikeimfive,meta"
|
||||
},
|
||||
feed_style: {
|
||||
description: "Determines which default feed the users sees (rich content, more minimal, etc.)",
|
||||
placeholder: "basic, rich, or compact"
|
||||
},
|
||||
default_font: {
|
||||
description: "Determines the default Base Reading Font (registered users can change this in their UX settings)"
|
||||
}
|
||||
# Dynamic values ommitted: configurable_rate_limits and social_media_handles
|
||||
}.freeze
|
||||
|
|
|
|||
|
|
@ -102,8 +102,8 @@
|
|||
<%= f.text_field :health_check_token,
|
||||
class: "form-control",
|
||||
value: SiteConfig.health_check_token,
|
||||
placeholder: "a secure token" %>
|
||||
<div class="alert alert-info">Used to authenticate with your health check endpoints.</div>
|
||||
placeholder: Constants::SiteConfig::DETAILS[:health_check_token][:placeholder] %>
|
||||
<div class="alert alert-info"><%= Constants::SiteConfig::DETAILS[:health_check_token][:description] %></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -128,7 +128,7 @@
|
|||
),
|
||||
multiple: true,
|
||||
class: "form-control selectpicker" %>
|
||||
<div class="alert alert-info">How can users sign in?</div>
|
||||
<div class="alert alert-info"><%= Constants::SiteConfig::DETAILS[:authentication_providers][:description] %></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -147,20 +147,20 @@
|
|||
<%= f.text_field :campaign_hero_html_variant_name,
|
||||
class: "form-control",
|
||||
value: SiteConfig.campaign_hero_html_variant_name,
|
||||
placeholder: "" %>
|
||||
<div class="alert alert-info">Hero HtmlVariant name</div>
|
||||
placeholder: Constants::SiteConfig::DETAILS[:campaign_hero_html_variant_name][:placeholder] %>
|
||||
<div class="alert alert-info"><%= Constants::SiteConfig::DETAILS[:campaign_hero_html_variant_name][:description] %></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<%= admin_config_label :campaign_articles_require_approval %>
|
||||
<%= f.check_box :campaign_articles_require_approval, checked: SiteConfig.campaign_articles_require_approval %>
|
||||
<div class="alert alert-info">Campaign stories show up on sidebar with approval?</div>
|
||||
<div class="alert alert-info"><%= Constants::SiteConfig::DETAILS[:campaign_articles_require_approval][:description] %></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<%= admin_config_label :campaign_sidebar_enabled %>
|
||||
<%= f.check_box :campaign_sidebar_enabled, checked: SiteConfig.campaign_sidebar_enabled %>
|
||||
<div class="alert alert-info">Campaign sidebar enabled or not</div>
|
||||
<div class="alert alert-info"><%= Constants::SiteConfig::DETAILS[:campaign_sidebar_enabled][:description] %></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
|
|
@ -175,8 +175,8 @@
|
|||
<%= f.text_field :campaign_sidebar_image,
|
||||
class: "form-control",
|
||||
value: SiteConfig.campaign_sidebar_image,
|
||||
placeholder: "https://image.url" %>
|
||||
<div class="alert alert-info">Used at the top of the campaign sidebar</div>
|
||||
placeholder: Constants::SiteConfig::DETAILS[:campaign_sidebar_image][:placeholder] %>
|
||||
<div class="alert alert-info"><%= Constants::SiteConfig::DETAILS[:campaign_sidebar_image][:description] %></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
|
|
@ -184,8 +184,8 @@
|
|||
<%= f.text_field :campaign_url,
|
||||
class: "form-control",
|
||||
value: SiteConfig.campaign_url,
|
||||
placeholder: "https://url.com/lander" %>
|
||||
<div class="alert alert-info">URL campaign sidebar image will link to</div>
|
||||
placeholder: Constants::SiteConfig::DETAILS[:campaign_url][:placeholder] %>
|
||||
<div class="alert alert-info"><%= Constants::SiteConfig::DETAILS[:campaign_url][:description] %></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
|
|
@ -193,8 +193,8 @@
|
|||
<%= f.text_field :campaign_featured_tags,
|
||||
class: "form-control",
|
||||
value: SiteConfig.campaign_featured_tags.join(","),
|
||||
placeholder: "List of campaign tags: comma separated, letters only e.g. shecoded,theycoded" %>
|
||||
<div class="alert alert-info">Posts with which tags will be featured in the campaign sidebar (comma separated, letters only)</div>
|
||||
placeholder: Constants::SiteConfig::DETAILS[:campaign_featured_tags][:placeholder] %>
|
||||
<div class="alert alert-info"><%= Constants::SiteConfig::DETAILS[:campaign_featured_tags][:description] %></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -222,8 +222,8 @@
|
|||
<%= f.text_field :community_description,
|
||||
class: "form-control",
|
||||
value: SiteConfig.community_description,
|
||||
placeholder: "A fabulous community of kind and welcoming people." %>
|
||||
<div class="alert alert-info">Used in meta description tags etc.</div>
|
||||
placeholder: Constants::SiteConfig::DETAILS[:community_description][:placeholder] %>
|
||||
<div class="alert alert-info"><%= Constants::SiteConfig::DETAILS[:community_description][:description] %></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
|
|
@ -231,8 +231,8 @@
|
|||
<%= f.text_field :community_member_label,
|
||||
class: "form-control",
|
||||
value: SiteConfig.community_member_label,
|
||||
placeholder: "" %>
|
||||
<div class="alert alert-info">Used to determine what a member will be called e.g developer, hobbyist etc.</div>
|
||||
placeholder: Constants::SiteConfig::DETAILS[:community_member_label][:placeholder] %>
|
||||
<div class="alert alert-info"><%= Constants::SiteConfig::DETAILS[:community_member_label][:description] %></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
|
|
@ -240,8 +240,8 @@
|
|||
<%= f.text_field :community_action,
|
||||
class: "form-control",
|
||||
value: SiteConfig.community_action,
|
||||
placeholder: "" %>
|
||||
<div class="alert alert-info">Used to determine the action of community e.g coding, reading, training etc.</div>
|
||||
placeholder: Constants::SiteConfig::DETAILS[:community_action][:placeholder] %>
|
||||
<div class="alert alert-info"><%= Constants::SiteConfig::DETAILS[:community_action][:description] %></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
|
|
@ -249,8 +249,8 @@
|
|||
<%= f.text_field :tagline,
|
||||
class: "form-control",
|
||||
value: SiteConfig.tagline,
|
||||
placeholder: "We're a place where coders share, stay up-to-date and grow their careers." %>
|
||||
<div class="alert alert-info">Used in signup modal.</div>
|
||||
placeholder: Constants::SiteConfig::DETAILS[:tagline][:placeholder] %>
|
||||
<div class="alert alert-info"><%= Constants::SiteConfig::DETAILS[:tagline][:description] %></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
|
|
@ -289,26 +289,26 @@
|
|||
<%= price_field.number_field :small,
|
||||
class: "form-control",
|
||||
value: SiteConfig.credit_prices_in_cents[:small] %>
|
||||
<div class="alert alert-info">Price for small credit purchase (<10 credits).</div>
|
||||
<div class="alert alert-info"><%= Constants::SiteConfig::DETAILS[:credit_prices_in_cents][:small][:description] %></div>
|
||||
<%= price_field.label "Credit price in cents (M)" %>
|
||||
<%= price_field.number_field :medium,
|
||||
class: "form-control",
|
||||
value: SiteConfig.credit_prices_in_cents[:medium] %>
|
||||
<div class="alert alert-info">Price for medium credit purchase (10 - 99 credits).</div>
|
||||
<div class="alert alert-info"><%= Constants::SiteConfig::DETAILS[:credit_prices_in_cents][:medium][:description] %></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<%= price_field.label "Credit price in cents (L)" %>
|
||||
<%= price_field.number_field :large,
|
||||
class: "form-control",
|
||||
value: SiteConfig.credit_prices_in_cents[:large] %>
|
||||
<div class="alert alert-info">Price for large credit purchase (100 - 999 credits).</div>
|
||||
<div class="alert alert-info"><%= Constants::SiteConfig::DETAILS[:credit_prices_in_cents][:large][:description] %></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<%= price_field.label "Credit price in cents (XL)" %>
|
||||
<%= price_field.number_field :xlarge,
|
||||
class: "form-control",
|
||||
value: SiteConfig.credit_prices_in_cents[:xlarge] %>
|
||||
<div class="alert alert-info">Price for extra large credit purchase (1000 credits or more).</div>
|
||||
<div class="alert alert-info"><%= Constants::SiteConfig::DETAILS[:credit_prices_in_cents][:xlarge][:description] %></div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
|
@ -336,8 +336,8 @@
|
|||
<%= email_field.text_field type,
|
||||
class: "form-control",
|
||||
value: SiteConfig.email_addresses[type],
|
||||
placeholder: "" %>
|
||||
<div class="alert alert-info"><%= type.capitalize %>Email</div>
|
||||
placeholder: Constants::SiteConfig::DETAILS[:email_addresses][:placeholder] %>
|
||||
<div class="alert alert-info"><%= type.capitalize %><%= Constants::SiteConfig::DETAILS[:email_addresses][:description] %></div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue