From 6dfabd578f727cad8776ba65930a2889b1573faf Mon Sep 17 00:00:00 2001 From: Michael Kohl Date: Fri, 21 May 2021 19:45:37 +0700 Subject: [PATCH] Rename `SiteConfig` to `Settings::General` (#13573) * Rename SiteConfig * More renaming * Update spec * Update mandatory settings mapping * More renaming * e2e test fixes * You have a rename, and you have a rename * Spec fix * More changes * Temporarily disable specs * After-merge update * Undo rename for migration * undo rename of DUS * Fix DUS * Fix merge problem * Remove redundant DUS * Fix specs * Remove unused code * Change wrong class name * More cleanup * Re-add missing values to constant * Fix constant * Fix spec * Remove obsolete fields * Add accidentally removed field * Update spec * Move methods from Settings::General to ForemInstance * Remove unneeded model * Change mentions of 'site config' --- .gitignore | 1 + app/controllers/admin/configs_controller.rb | 2 +- .../settings/authentications_controller.rb | 2 +- .../admin/settings/campaigns_controller.rb | 2 +- .../admin/settings/communities_controller.rb | 2 +- .../settings/mandatory_settings_controller.rb | 2 +- .../admin/settings/rate_limits_controller.rb | 2 +- .../settings/user_experiences_controller.rb | 2 +- app/controllers/admin/users_controller.rb | 2 +- .../api/v0/admin/configs_controller.rb | 11 +- .../api/v0/health_checks_controller.rb | 2 +- app/controllers/api_secrets_controller.rb | 3 +- app/controllers/application_controller.rb | 13 +- app/controllers/async_info_controller.rb | 2 +- app/controllers/chat_channels_controller.rb | 8 +- app/controllers/comments_controller.rb | 2 +- app/controllers/concerns/settings_params.rb | 18 +- .../concerns/verify_setup_completed.rb | 2 +- app/controllers/confirmations_controller.rb | 2 +- app/controllers/credits_controller.rb | 2 +- app/controllers/deep_links_controller.rb | 2 +- app/controllers/ga_events_controller.rb | 2 +- .../mailchimp_unsubscribes_controller.rb | 4 +- app/controllers/registrations_controller.rb | 12 +- app/controllers/search_controller.rb | 2 +- app/controllers/stories_controller.rb | 4 +- app/controllers/tags_controller.rb | 2 +- app/controllers/users_controller.rb | 8 +- app/controllers/video_states_controller.rb | 2 +- app/errors/authentication/errors.rb | 2 +- app/helpers/application_helper.rb | 26 +- app/helpers/authentication_helper.rb | 2 +- .../admin/controllers/config_controller.js | 28 +- .../onboarding/components/FollowTags.jsx | 22 +- app/lib/constants/settings/campaign.rb | 2 +- app/lib/constants/settings/general.rb | 146 +++++++ app/lib/constants/site_config.rb | 142 ------- app/lib/html_css_to_image.rb | 2 +- app/lib/middlewares/set_cookie_domain.rb | 2 +- app/lib/redcarpet/render/html_rouge.rb | 2 +- app/lib/url.rb | 4 +- app/liquid_tags/link_tag.rb | 2 +- app/liquid_tags/twitch_tag.rb | 2 +- app/mailers/application_mailer.rb | 4 +- app/mailers/devise_mailer.rb | 8 +- app/mailers/verification_mailer.rb | 2 +- app/models/article.rb | 6 +- app/models/comment.rb | 4 +- app/models/forem_instance.rb | 15 + app/models/message.rb | 6 +- app/models/reaction.rb | 2 +- app/models/settings/general.rb | 136 +++++++ app/models/settings/mandatory.rb | 4 +- app/models/settings/mascot.rb | 21 - app/models/site_config.rb | 146 ------- app/models/user.rb | 8 +- app/policies/video_policy.rb | 2 +- .../authentication/providers/apple.rb | 2 +- app/services/email_digest.rb | 2 +- .../email_digest_article_collector.rb | 2 +- app/services/error_messages/clean.rb | 2 +- app/services/html/parser.rb | 2 +- app/services/mailchimp/bot.rb | 28 +- app/services/re_captcha/check_enabled.rb | 2 +- .../re_captcha/check_registration_enabled.rb | 2 +- app/services/settings/upsert.rb | 8 +- .../slack/messengers/article_published.rb | 4 +- app/services/tag_moderators/add.rb | 4 +- .../tag_moderators/add_trusted_role.rb | 4 +- app/services/tag_moderators/remove.rb | 4 +- app/services/users/create_mascot_account.rb | 6 +- app/view_objects/articles/social_image.rb | 2 +- .../admin/configs/_form_submission.html.erb | 2 +- app/views/admin/configs/show.html.erb | 228 +++++------ .../feedback_messages/_abuse_reports.html.erb | 2 +- app/views/admin/users/_data_export.html.erb | 2 +- .../api/v0/admin/configs/show.json.jbuilder | 2 +- app/views/articles/_actions.html.erb | 2 +- app/views/articles/_sidebar.html.erb | 2 +- app/views/articles/index.html.erb | 6 +- app/views/articles/search/_meta.html.erb | 6 +- app/views/articles/show.html.erb | 2 +- app/views/articles/tags/_meta.html.erb | 6 +- app/views/collections/_meta.html.erb | 6 +- app/views/comments/_comment_avatar.html.erb | 2 +- app/views/comments/_form.html.erb | 2 +- .../deleted_commentable_comment.html.erb | 2 +- app/views/comments/index.html.erb | 2 +- app/views/credits/new.html.erb | 2 +- app/views/dashboards/show.html.erb | 4 +- app/views/deep_links/mobile.html.erb | 2 +- app/views/events/_event.html.erb | 2 +- app/views/events/index.html.erb | 6 +- app/views/events/show.html.erb | 6 +- app/views/layouts/_logo.html.erb | 2 +- app/views/layouts/_signup_modal.html.erb | 2 +- app/views/layouts/_social_media.html.erb | 2 +- app/views/layouts/admin.html.erb | 4 +- app/views/layouts/application.html.erb | 34 +- app/views/listings/index.html.erb | 6 +- .../account_deleted_email.text.erb | 2 +- .../tag_moderator_confirmation_email.text.erb | 2 +- .../notify_mailer/trusted_role_email.text.erb | 2 +- .../moderations/_mod_sidebar_left.html.erb | 2 +- app/views/notifications/index.html.erb | 2 +- app/views/onboardings/_task_card.html.erb | 2 +- app/views/onboardings/show.html.erb | 4 +- app/views/open_search/show.xml.erb | 2 +- app/views/pages/badge.html.erb | 2 +- app/views/pages/badges.html.erb | 2 +- app/views/pages/code_of_conduct.html.erb | 2 +- app/views/pages/contact.html.erb | 8 +- app/views/pages/privacy.html.erb | 6 +- app/views/pages/report_abuse.html.erb | 2 +- app/views/pages/show.html.erb | 6 +- app/views/pages/terms.html.erb | 6 +- app/views/podcast_episodes/_meta.html.erb | 14 +- app/views/podcast_episodes/show.html.erb | 2 +- app/views/reading_list_items/index.html.erb | 2 +- .../_email_registration_form.html.erb | 2 +- app/views/sidebars/_homepage_content.html.erb | 2 +- .../stories/_sign_in_invitation.html.erb | 2 +- app/views/tags/index.html.erb | 6 +- app/views/users/_billing.html.erb | 2 +- app/views/users/_meta.html.erb | 2 +- app/views/users/_org_admin.html.erb | 2 +- app/views/users/_profile.html.erb | 2 +- app/views/videos/index.html.erb | 6 +- .../send_welcome_notifications_worker.rb | 4 +- app/workers/emails/enqueue_digest_worker.rb | 2 +- app/workers/sitemap_refresh_worker.rb | 2 +- config/initializers/1_imgproxy.rb | 2 +- .../initializers/carrierwave_monkeypatch.rb | 4 +- config/initializers/devise_monkeypatch.rb | 8 +- .../config/authenticationSection.spec.js | 20 +- .../adminFlows/config/campaignSection.spec.js | 12 +- .../config/communitySection.spec.js | 12 +- .../config/emailDigestFrequencySection.js | 15 +- .../adminFlows/config/getStartedSection.js | 16 +- .../adminFlows/config/mascotSection.js | 12 +- .../adminFlows/config/rateLimitSection.js | 8 +- .../config/userExperienceSection.js | 6 +- cypress/support/commands.js | 36 +- db/seeds.rb | 6 +- docs/api_v0.yml | 4 +- docs/backend/auth-facebook.md | 2 +- docs/backend/configuration.md | 6 +- docs/backend/emails.md | 4 +- docs/backend/push-notifications.md | 19 +- docs/creators/configure-forem.md | 24 +- .../20201001173841_add_navigation_links.rb | 2 +- ...18080343_update_default_email_addresses.rb | 14 +- ...222641_resave_users_for_imgproxy_update.rb | 2 +- ...10322092753_fill_badges_credits_awarded.rb | 2 +- ...43750_remove_site_config_secondary_logo.rb | 7 - .../20210512033821_clean_up_site_config.rb | 55 --- ...091342_remove_shop_url_from_site_config.rb | 7 - ...210518043957_remove_site_config_scripts.rb | 17 + lib/tasks/add_navigation_links.rake | 2 +- lib/tasks/app_initializer.rake | 2 +- lib/tasks/forem.rake | 2 +- lib/tasks/metrics.rake | 2 +- spec/decorators/user_decorator_spec.rb | 2 +- spec/helpers/application_helper_spec.rb | 11 +- spec/helpers/social_image_helper_spec.rb | 4 +- .../carrierwave_monkeypatch_spec.rb | 4 +- .../fill_badges_credits_awarded_spec.rb | 4 +- .../update_default_email_addresses_spec.rb | 6 +- spec/lib/html_css_to_image_spec.rb | 2 +- spec/lib/url_spec.rb | 8 +- spec/liquid_tags/link_tag_spec.rb | 6 +- spec/mailers/devise_mailer_spec.rb | 6 +- spec/mailers/digest_mailer_spec.rb | 4 +- spec/mailers/notify_mailer_spec.rb | 86 ++--- spec/mailers/verification_mailer_spec.rb | 4 +- spec/models/article_spec.rb | 4 +- spec/models/comment_spec.rb | 2 +- spec/models/forem_instance_spec.rb | 28 ++ spec/models/reaction_spec.rb | 4 +- spec/models/settings/general_spec.rb | 29 ++ spec/models/site_config_spec.rb | 57 --- spec/models/user_spec.rb | 4 +- spec/rails_helper.rb | 4 +- spec/requests/admin/configs_spec.rb | 358 +++++++++++------- spec/requests/admin/navigation_link_spec.rb | 6 +- spec/requests/api/v0/admin/configs_spec.rb | 39 +- spec/requests/api/v0/health_checks_spec.rb | 2 +- spec/requests/api/v0/users_spec.rb | 4 +- spec/requests/articles/articles_show_spec.rb | 10 +- spec/requests/async_info_spec.rb | 2 +- spec/requests/comments_create_spec.rb | 2 +- spec/requests/dashboard_spec.rb | 6 +- spec/requests/ga_events_spec.rb | 2 +- .../mailchimp/unsubscribe_spec.rb | 4 +- spec/requests/invitations_spec.rb | 2 +- spec/requests/onboardings_spec.rb | 4 +- spec/requests/pages_spec.rb | 2 +- spec/requests/registrations_spec.rb | 14 +- spec/requests/sidebars_spec.rb | 2 +- spec/requests/stories_index_spec.rb | 14 +- spec/requests/tags_spec.rb | 10 +- spec/requests/universal_links_spec.rb | 2 +- spec/requests/user/user_settings_spec.rb | 6 +- spec/requests/user/user_suggestions_spec.rb | 8 +- spec/requests/video_states_update_spec.rb | 2 +- .../email_digest_article_collector_spec.rb | 4 +- spec/services/email_digest_spec.rb | 2 +- spec/services/exporter/service_spec.rb | 2 +- .../images/generate_social_image_spec.rb | 2 +- spec/services/mailchimp/bot_spec.rb | 10 +- .../services/re_captcha/check_enabled_spec.rb | 4 +- .../messengers/article_published_spec.rb | 4 +- spec/services/twitter_client/client_spec.rb | 2 +- .../users/create_mascot_account_spec.rb | 4 +- spec/support/seeds/seeds_e2e.rb | 6 +- .../admin/admin_manages_configuration_spec.rb | 6 +- .../articles/user_edits_an_article_spec.rb | 12 +- .../omniauth_redirect_uri_spec.rb | 14 +- .../user_logs_in_with_email_spec.rb | 2 +- .../user_request_confirmation_spec.rb | 2 +- spec/views/comments/_comment.html.erb_spec.rb | 2 +- spec/views/dashboards/show.html.erb_spec.rb | 2 +- .../send_welcome_notifications_worker_spec.rb | 6 +- spec/workers/sitemap_refresh_worker_spec.rb | 4 +- 224 files changed, 1299 insertions(+), 1293 deletions(-) create mode 100644 app/lib/constants/settings/general.rb delete mode 100644 app/lib/constants/site_config.rb create mode 100644 app/models/settings/general.rb delete mode 100644 app/models/settings/mascot.rb delete mode 100644 app/models/site_config.rb delete mode 100644 lib/data_update_scripts/20210430043750_remove_site_config_secondary_logo.rb delete mode 100644 lib/data_update_scripts/20210512033821_clean_up_site_config.rb delete mode 100644 lib/data_update_scripts/20210517091342_remove_shop_url_from_site_config.rb create mode 100644 lib/data_update_scripts/20210518043957_remove_site_config_scripts.rb create mode 100644 spec/models/settings/general_spec.rb delete mode 100644 spec/models/site_config_spec.rb diff --git a/.gitignore b/.gitignore index 1fe4febe7..bb128ffbd 100644 --- a/.gitignore +++ b/.gitignore @@ -100,3 +100,4 @@ postcss_error.log # ripgrep ignore file .rgignore +config/definitions.rb diff --git a/app/controllers/admin/configs_controller.rb b/app/controllers/admin/configs_controller.rb index 2c21106b3..ed0d9ee2d 100644 --- a/app/controllers/admin/configs_controller.rb +++ b/app/controllers/admin/configs_controller.rb @@ -7,7 +7,7 @@ module Admin if result.success? Audit::Logger.log(:internal, current_user, params.dup) bust_content_change_caches - redirect_to admin_config_path, notice: "Site configuration was successfully updated." + redirect_to admin_config_path, notice: "Successfully updated settings." else redirect_to admin_config_path, alert: "😭 #{result.errors.to_sentence}" end diff --git a/app/controllers/admin/settings/authentications_controller.rb b/app/controllers/admin/settings/authentications_controller.rb index f99f16f56..495dcc767 100644 --- a/app/controllers/admin/settings/authentications_controller.rb +++ b/app/controllers/admin/settings/authentications_controller.rb @@ -6,7 +6,7 @@ module Admin if result.success? Audit::Logger.log(:internal, current_user, params.dup) - redirect_to admin_config_path, notice: "Site configuration was successfully updated." + redirect_to admin_config_path, notice: "Successfully updated settings." else redirect_to admin_config_path, alert: "😭 #{result.errors.to_sentence}" end diff --git a/app/controllers/admin/settings/campaigns_controller.rb b/app/controllers/admin/settings/campaigns_controller.rb index aaaa4ce86..2e5995e20 100644 --- a/app/controllers/admin/settings/campaigns_controller.rb +++ b/app/controllers/admin/settings/campaigns_controller.rb @@ -6,7 +6,7 @@ module Admin if result.success? Audit::Logger.log(:internal, current_user, params.dup) - redirect_to admin_config_path, notice: "Site configuration was successfully updated." + redirect_to admin_config_path, notice: "Successfully updated settings." else redirect_to admin_config_path, alert: "😭 #{result.errors.to_sentence}" end diff --git a/app/controllers/admin/settings/communities_controller.rb b/app/controllers/admin/settings/communities_controller.rb index 3a9ae4e5f..e511b9a0b 100644 --- a/app/controllers/admin/settings/communities_controller.rb +++ b/app/controllers/admin/settings/communities_controller.rb @@ -6,7 +6,7 @@ module Admin if errors.none? Audit::Logger.log(:internal, current_user, params.dup) - redirect_to admin_config_path, notice: "Site configuration was successfully updated." + redirect_to admin_config_path, notice: "Successfully updated settings." else redirect_to admin_config_path, alert: "😭 #{errors.to_sentence}" end diff --git a/app/controllers/admin/settings/mandatory_settings_controller.rb b/app/controllers/admin/settings/mandatory_settings_controller.rb index 6a6c5dbae..71c214bce 100644 --- a/app/controllers/admin/settings/mandatory_settings_controller.rb +++ b/app/controllers/admin/settings/mandatory_settings_controller.rb @@ -6,7 +6,7 @@ module Admin if errors.none? Audit::Logger.log(:internal, current_user, params.dup) - redirect_to admin_config_path, notice: "Site configuration was successfully updated." + redirect_to admin_config_path, notice: "Successfully updated settings." else redirect_to admin_config_path, alert: "😭 #{errors.to_sentence}" end diff --git a/app/controllers/admin/settings/rate_limits_controller.rb b/app/controllers/admin/settings/rate_limits_controller.rb index 646d6632c..6a95f3570 100644 --- a/app/controllers/admin/settings/rate_limits_controller.rb +++ b/app/controllers/admin/settings/rate_limits_controller.rb @@ -6,7 +6,7 @@ module Admin if result.success? Audit::Logger.log(:internal, current_user, params.dup) - redirect_to admin_config_path, notice: "Site configuration was successfully updated." + redirect_to admin_config_path, notice: "Successfully updated settings." else redirect_to admin_config_path, alert: "😭 #{result.errors.to_sentence}" end diff --git a/app/controllers/admin/settings/user_experiences_controller.rb b/app/controllers/admin/settings/user_experiences_controller.rb index 53c0b6dc5..cba921581 100644 --- a/app/controllers/admin/settings/user_experiences_controller.rb +++ b/app/controllers/admin/settings/user_experiences_controller.rb @@ -6,7 +6,7 @@ module Admin if errors.none? Audit::Logger.log(:internal, current_user, params.dup) - redirect_to admin_config_path, notice: "Site configuration was successfully updated." + redirect_to admin_config_path, notice: "Successfully updated settings." else redirect_to admin_config_path, alert: "😭 #{errors.to_sentence}" end diff --git a/app/controllers/admin/users_controller.rb b/app/controllers/admin/users_controller.rb index b36c2d6a9..2e2c1bc08 100644 --- a/app/controllers/admin/users_controller.rb +++ b/app/controllers/admin/users_controller.rb @@ -73,7 +73,7 @@ module Admin user = User.find(params[:id]) send_to_admin = params[:send_to_admin].to_boolean if send_to_admin - email = SiteConfig.email_addresses[:contact] + email = ::Settings::General.email_addresses[:contact] receiver = "admin" else email = user.email diff --git a/app/controllers/api/v0/admin/configs_controller.rb b/app/controllers/api/v0/admin/configs_controller.rb index 9ab9ffdf8..f535a91bf 100644 --- a/app/controllers/api/v0/admin/configs_controller.rb +++ b/app/controllers/api/v0/admin/configs_controller.rb @@ -9,7 +9,14 @@ module Api skip_before_action :verify_authenticity_token, only: %i[update] def show - @site_configs = SiteConfig.all + @settings = + Settings::Authentication.all + + Settings::Campaign.all + + Settings::Community.all + + Settings::General.all + + Settings::Mascot.all + + Settings::RateLimit.all + + Settings::UserExperience.all end def update @@ -20,7 +27,7 @@ module Api auth_settings_result = ::Authentication::SettingsUpsert.call(auth_settings_params) if settings_result.success? && auth_settings_result.success? - @site_configs = SiteConfig.all + Settings::Authentication.all + @settings = Settings::General.all + Settings::Authentication.all Audit::Logger.log(:internal, @user, params.dup) bust_content_change_caches render "show" diff --git a/app/controllers/api/v0/health_checks_controller.rb b/app/controllers/api/v0/health_checks_controller.rb index 31e1b719f..689cebedc 100644 --- a/app/controllers/api/v0/health_checks_controller.rb +++ b/app/controllers/api/v0/health_checks_controller.rb @@ -30,7 +30,7 @@ module Api key = request.headers["health-check-token"] - return if key == SiteConfig.health_check_token + return if key == Settings::General.health_check_token error_unauthorized end diff --git a/app/controllers/api_secrets_controller.rb b/app/controllers/api_secrets_controller.rb index 7f9120a89..69686df4a 100644 --- a/app/controllers/api_secrets_controller.rb +++ b/app/controllers/api_secrets_controller.rb @@ -23,7 +23,8 @@ class ApiSecretsController < ApplicationController if @secret.destroy flash[:notice] = "Your API Key has been revoked." else - flash[:error] = "An error occurred. Please try again or send an email to: #{SiteConfig.email_addresses[:contact]}" + flash[:error] = + "An error occurred. Please try again or send an email to: #{Settings::General.email_addresses[:contact]}" end redirect_back(fallback_location: root_path) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 85899d5a7..65b96c532 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -168,7 +168,7 @@ class ApplicationController < ActionController::Base end def initialize_stripe - Stripe.api_key = SiteConfig.stripe_api_key + Stripe.api_key = Settings::General.stripe_api_key return unless Rails.env.development? && Stripe.api_key.present? @@ -186,16 +186,19 @@ class ApplicationController < ActionController::Base end def forward_to_app_config_domain - return unless request.get? && # Let's only redirect get requests for this purpose. - request.host == ENV["APP_DOMAIN"] && # If the request equals the original set domain, e.g. forem-x.forem.cloud. - ENV["APP_DOMAIN"] != SiteConfig.app_domain # If the app domain config has now been set, let's go there instead. + # Let's only redirect get requests for this purpose. + return unless request.get? && + # If the request equals the original set domain, e.g. forem-x.forem.cloud. + request.host == ENV["APP_DOMAIN"] && + # If the app domain config has now been set, let's go there instead. + ENV["APP_DOMAIN"] != Settings::General.app_domain redirect_to URL.url(request.fullpath) end def bust_content_change_caches EdgeCache::Bust.call(CONTENT_CHANGE_PATHS) - SiteConfig.admin_action_taken_at = Time.current # Used as cache key + Settings::General.admin_action_taken_at = Time.current # Used as cache key end protected diff --git a/app/controllers/async_info_controller.rb b/app/controllers/async_info_controller.rb index 35a94cc65..90963117f 100644 --- a/app/controllers/async_info_controller.rb +++ b/app/controllers/async_info_controller.rb @@ -31,7 +31,7 @@ class AsyncInfoController < ApplicationController set_surrogate_key_header "shell-version-endpoint" # shell_version will change on every deploy. # *Technically* could be only on changes to assets and shell, but this is more fool-proof. - shell_version = ForemInstance.deployed_at.to_s + SiteConfig.admin_action_taken_at.to_s + shell_version = ForemInstance.deployed_at.to_s + Settings::General.admin_action_taken_at.to_s render json: { version: shell_version }.to_json end diff --git a/app/controllers/chat_channels_controller.rb b/app/controllers/chat_channels_controller.rb index 07bcfd855..e130b9b03 100644 --- a/app/controllers/chat_channels_controller.rb +++ b/app/controllers/chat_channels_controller.rb @@ -57,10 +57,10 @@ class ChatChannelsController < ApplicationController flash[:error] = chat_channel.errors.full_messages.to_sentence else if chat_channel_params[:discoverable].to_i.zero? - ChatChannelMembership.create(user_id: SiteConfig.mascot_user_id, chat_channel_id: chat_channel.id, + ChatChannelMembership.create(user_id: Settings::General.mascot_user_id, chat_channel_id: chat_channel.id, role: "member", status: "active") else - ChatChannelMembership.find_by(user_id: SiteConfig.mascot_user_id)&.destroy + ChatChannelMembership.find_by(user_id: Settings::General.mascot_user_id)&.destroy end flash[:settings_notice] = "Channel settings updated." end @@ -76,10 +76,10 @@ class ChatChannelsController < ApplicationController message: "Channel settings updation failed. Try again later." }, success: :bad_request else if chat_channel_params[:discoverable] - ChatChannelMembership.create(user_id: SiteConfig.mascot_user_id, chat_channel_id: @chat_channel.id, + ChatChannelMembership.create(user_id: Settings::General.mascot_user_id, chat_channel_id: @chat_channel.id, role: "member", status: "active") else - ChatChannelMembership.find_by(user_id: SiteConfig.mascot_user_id)&.destroy + ChatChannelMembership.find_by(user_id: Settings::General.mascot_user_id)&.destroy end render json: { success: true, message: "Channel settings updated.", data: {} }, success: :ok end diff --git a/app/controllers/comments_controller.rb b/app/controllers/comments_controller.rb index 154626e34..030ace0f6 100644 --- a/app/controllers/comments_controller.rb +++ b/app/controllers/comments_controller.rb @@ -110,7 +110,7 @@ class CommentsController < ApplicationController response_template = ResponseTemplate.find(params[:response_template][:id]) authorize response_template, :moderator_create? - moderator = User.find(SiteConfig.mascot_user_id) + moderator = User.find(Settings::General.mascot_user_id) @comment = Comment.new(permitted_attributes(Comment)) @comment.user_id = moderator.id @comment.body_markdown = response_template.content diff --git a/app/controllers/concerns/settings_params.rb b/app/controllers/concerns/settings_params.rb index 5dda74f08..ba7d06e04 100644 --- a/app/controllers/concerns/settings_params.rb +++ b/app/controllers/concerns/settings_params.rb @@ -1,4 +1,4 @@ -# Helper method for controllers interacting with SiteConfig +# Helper method for controllers interacting with Settings::General module SettingsParams SPECIAL_PARAMS_TO_ADD = %w[ credit_prices_in_cents @@ -7,21 +7,21 @@ module SettingsParams ].freeze def settings_params - has_emails = params.dig(:site_config, :email_addresses).present? - params[:site_config][:email_addresses][:default] = ApplicationConfig["DEFAULT_EMAIL"] if has_emails + has_emails = params.dig(:settings_general, :email_addresses).present? + params[:settings_general][:email_addresses][:default] = ApplicationConfig["DEFAULT_EMAIL"] if has_emails - params.require(:site_config)&.permit( + params.require(:settings_general)&.permit( settings_keys.map(&:to_sym), - social_media_handles: SiteConfig.social_media_handles.keys, - email_addresses: SiteConfig.email_addresses.keys, - meta_keywords: SiteConfig.meta_keywords.keys, - credit_prices_in_cents: SiteConfig.credit_prices_in_cents.keys, + social_media_handles: Settings::General.social_media_handles.keys, + email_addresses: Settings::General.email_addresses.keys, + meta_keywords: Settings::General.meta_keywords.keys, + credit_prices_in_cents: Settings::General.credit_prices_in_cents.keys, ) end private def settings_keys - SiteConfig.keys + SPECIAL_PARAMS_TO_ADD + Settings::General.keys + SPECIAL_PARAMS_TO_ADD end end diff --git a/app/controllers/concerns/verify_setup_completed.rb b/app/controllers/concerns/verify_setup_completed.rb index 4f882d926..756da0a62 100644 --- a/app/controllers/concerns/verify_setup_completed.rb +++ b/app/controllers/concerns/verify_setup_completed.rb @@ -29,7 +29,7 @@ module VerifySetupCompleted # This is the only flash in our application layout, don't override it if # there's already another message. return if flash[:global_notice].present? - return if config_path? || setup_completed? || SiteConfig.waiting_on_first_user + return if config_path? || setup_completed? || Settings::General.waiting_on_first_user link = helpers.tag.a("the configuration page", href: admin_config_path, data: { "no-instant" => true }) diff --git a/app/controllers/confirmations_controller.rb b/app/controllers/confirmations_controller.rb index cfda9e7f1..3cf025403 100644 --- a/app/controllers/confirmations_controller.rb +++ b/app/controllers/confirmations_controller.rb @@ -6,7 +6,7 @@ class ConfirmationsController < Devise::ConfirmationsController self.resource = resource_class.send_confirmation_instructions(resource_params) resource.errors.clear # Don't leak user information, like paranoid mode. - message = format(FLASH_MESSAGE, email: SiteConfig.email_addresses[:members]) + message = format(FLASH_MESSAGE, email: Settings::General.email_addresses[:members]) flash.now[:global_notice] = message render :new end diff --git a/app/controllers/credits_controller.rb b/app/controllers/credits_controller.rb index 7a6de018a..23c9d59e5 100644 --- a/app/controllers/credits_controller.rb +++ b/app/controllers/credits_controller.rb @@ -100,7 +100,7 @@ class CreditsController < ApplicationController end def cost_per_credit - prices = SiteConfig.credit_prices_in_cents + prices = Settings::General.credit_prices_in_cents case @number_to_purchase when ..9 diff --git a/app/controllers/deep_links_controller.rb b/app/controllers/deep_links_controller.rb index 6b6848e28..4df329b99 100644 --- a/app/controllers/deep_links_controller.rb +++ b/app/controllers/deep_links_controller.rb @@ -7,7 +7,7 @@ class DeepLinksController < ApplicationController # TODO: [@fdoxyz] Replace these hardcoded identifiers with configurations # creators can use to customize their Forems - `/admin/consumer_apps` supported_apps = ["R9SWHSQNV8.com.forem.app"] - supported_apps << "R9SWHSQNV8.to.dev.ios" if SiteConfig.dev_to? + supported_apps << "R9SWHSQNV8.to.dev.ios" if ForemInstance.dev_to? render json: { applinks: { apps: [], diff --git a/app/controllers/ga_events_controller.rb b/app/controllers/ga_events_controller.rb index 8c5cf80ad..f6bc7e938 100644 --- a/app/controllers/ga_events_controller.rb +++ b/app/controllers/ga_events_controller.rb @@ -9,7 +9,7 @@ class GaEventsController < ApplicationController json = JSON.parse(request.raw_post) user_id = user_signed_in? ? current_user.id : nil client_id = "#{scrambled_ip[0..12]}_#{json['user_agent']}_#{user_id}" - tracker = Staccato.tracker(SiteConfig.ga_tracking_id, client_id) + tracker = Staccato.tracker(Settings::General.ga_tracking_id, client_id) tracker.pageview( path: json["path"], user_id: user_id, diff --git a/app/controllers/incoming_webhooks/mailchimp_unsubscribes_controller.rb b/app/controllers/incoming_webhooks/mailchimp_unsubscribes_controller.rb index 04cd7ad42..e9fe0f523 100644 --- a/app/controllers/incoming_webhooks/mailchimp_unsubscribes_controller.rb +++ b/app/controllers/incoming_webhooks/mailchimp_unsubscribes_controller.rb @@ -24,12 +24,12 @@ module IncomingWebhooks private def valid_secret? - params[:secret] == SiteConfig.mailchimp_incoming_webhook_secret + params[:secret] == Settings::General.mailchimp_incoming_webhook_secret end def email_type list_id = params.dig(:data, :list_id) - key = LIST_MAPPINGS.keys.detect { |k| SiteConfig.public_send(k) == list_id } + key = LIST_MAPPINGS.keys.detect { |k| Settings::General.public_send(k) == list_id } raise InvalidListID unless key LIST_MAPPINGS[key] diff --git a/app/controllers/registrations_controller.rb b/app/controllers/registrations_controller.rb index 3d8e6bb8e..05c0841d7 100644 --- a/app/controllers/registrations_controller.rb +++ b/app/controllers/registrations_controller.rb @@ -16,8 +16,8 @@ class RegistrationsController < Devise::RegistrationsController # rubocop:disable Metrics/PerceivedComplexity def create not_authorized unless Settings::Authentication.allow_email_password_registration || - SiteConfig.waiting_on_first_user - not_authorized if SiteConfig.waiting_on_first_user && ENV["FOREM_OWNER_SECRET"].present? && + Settings::General.waiting_on_first_user + not_authorized if Settings::General.waiting_on_first_user && ENV["FOREM_OWNER_SECRET"].present? && ENV["FOREM_OWNER_SECRET"] != params[:user][:forem_owner_secret] resolve_profile_field_issues @@ -33,7 +33,7 @@ class RegistrationsController < Devise::RegistrationsController yield resource if block_given? if resource.persisted? update_first_user_permissions(resource) - if SiteConfig.smtp_enabled? + if ForemInstance.smtp_enabled? redirect_to confirm_email_path(email: resource.email) else sign_in(resource) @@ -53,11 +53,11 @@ class RegistrationsController < Devise::RegistrationsController private def update_first_user_permissions(resource) - return unless SiteConfig.waiting_on_first_user + return unless Settings::General.waiting_on_first_user resource.add_role(:super_admin) resource.add_role(:trusted) - SiteConfig.waiting_on_first_user = false + Settings::General.waiting_on_first_user = false Users::CreateMascotAccount.call end @@ -79,7 +79,7 @@ class RegistrationsController < Devise::RegistrationsController # Run this data update script when in a state of "first user" in the event # that we are in a state where this was not already run. # This is likely only temporarily needed. - return unless SiteConfig.waiting_on_first_user + return unless Settings::General.waiting_on_first_user csv = Rails.root.join("lib/data/dev_profile_fields.csv") ProfileFields::ImportFromCsv.call(csv) diff --git a/app/controllers/search_controller.rb b/app/controllers/search_controller.rb index 1c52df701..d9a96043f 100644 --- a/app/controllers/search_controller.rb +++ b/app/controllers/search_controller.rb @@ -68,7 +68,7 @@ class SearchController < ApplicationController def chat_channels user_ids = if chat_channel_params[:user_id].present? - [current_user.id, SiteConfig.mascot_user_id, chat_channel_params[:user_id]].reject(&:blank?) + [current_user.id, Settings::General.mascot_user_id, chat_channel_params[:user_id]].reject(&:blank?) else [current_user.id] end diff --git a/app/controllers/stories_controller.rb b/app/controllers/stories_controller.rb index 3dd0ffe63..df135255a 100644 --- a/app/controllers/stories_controller.rb +++ b/app/controllers/stories_controller.rb @@ -414,8 +414,8 @@ class StoriesController < ApplicationController logo: { "@context": "http://schema.org", "@type": "ImageObject", - url: ApplicationController.helpers.optimized_image_url(SiteConfig.logo_png, width: 192, - fetch_format: "png"), + url: ApplicationController.helpers.optimized_image_url(Settings::General.logo_png, width: 192, + fetch_format: "png"), width: "192", height: "192" } diff --git a/app/controllers/tags_controller.rb b/app/controllers/tags_controller.rb index d8ad083a5..7b879aa1f 100644 --- a/app/controllers/tags_controller.rb +++ b/app/controllers/tags_controller.rb @@ -37,7 +37,7 @@ class TagsController < ApplicationController def onboarding skip_authorization - @tags = Tag.where(name: SiteConfig.suggested_tags) + @tags = Tag.where(name: Settings::General.suggested_tags) .select(ATTRIBUTES_FOR_SERIALIZATION) set_surrogate_key_header Tag.table_key, @tags.map(&:record_key) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 6cca5dff3..556f4dd32 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -13,6 +13,8 @@ class UsersController < ApplicationController ALLOWED_USER_PARAMS = %i[last_onboarding_page username].freeze INDEX_ATTRIBUTES_FOR_SERIALIZATION = %i[id name username summary profile_image].freeze private_constant :INDEX_ATTRIBUTES_FOR_SERIALIZATION + REMOVE_IDENTITY_ERROR = "An error occurred. Please try again or send an email to: %s".freeze + private_constant :REMOVE_IDENTITY_ERROR def index @users = @@ -132,7 +134,7 @@ class UsersController < ApplicationController def remove_identity set_current_tab("account") - error_message = "An error occurred. Please try again or send an email to: #{SiteConfig.email_addresses[:contact]}" + error_message = format(REMOVE_IDENTITY_ERROR, email: Settings::General.email_addresses[:contact]) unless Authentication::Providers.enabled?(params[:provider]) flash[:error] = error_message redirect_to user_settings_path(@tab) @@ -296,7 +298,7 @@ class UsersController < ApplicationController end def set_suggested_users - @suggested_users = SiteConfig.suggested_users + @suggested_users = Settings::General.suggested_users end def default_suggested_users @@ -304,7 +306,7 @@ class UsersController < ApplicationController end def determine_follow_suggestions(current_user) - return default_suggested_users if SiteConfig.prefer_manual_suggested_users? && default_suggested_users + return default_suggested_users if Settings::General.prefer_manual_suggested_users? && default_suggested_users recent_suggestions = Users::SuggestRecent.call( current_user, diff --git a/app/controllers/video_states_controller.rb b/app/controllers/video_states_controller.rb index 29477b1e6..2692d599c 100644 --- a/app/controllers/video_states_controller.rb +++ b/app/controllers/video_states_controller.rb @@ -30,6 +30,6 @@ class VideoStatesController < ApplicationController private def valid_key - params[:key] == SiteConfig.video_encoder_key + params[:key] == Settings::General.video_encoder_key end end diff --git a/app/errors/authentication/errors.rb b/app/errors/authentication/errors.rb index 009543bc1..6f54fb1e0 100644 --- a/app/errors/authentication/errors.rb +++ b/app/errors/authentication/errors.rb @@ -19,7 +19,7 @@ module Authentication def message format(PREVIOUSLY_SUSPENDED_MESSAGE, community_name: Settings::Community.community_name, - community_email: SiteConfig.email_addresses[:contact]) + community_email: Settings::General.email_addresses[:contact]) end end end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index fca902445..82464c797 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -156,8 +156,8 @@ module ApplicationHelper end def logo_svg - if SiteConfig.logo_svg.present? - SiteConfig.logo_svg.html_safe # rubocop:disable Rails/OutputSafety + if Settings::General.logo_svg.present? + Settings::General.logo_svg.html_safe # rubocop:disable Rails/OutputSafety else inline_svg_tag("devplain.svg", class: "logo", size: "20% * 20%", aria: true, title: "App logo") end @@ -175,7 +175,7 @@ module ApplicationHelper release_footprint = ForemInstance.deployed_at return path if release_footprint.blank? - "#{path}-#{params[:locale]}-#{release_footprint}-#{SiteConfig.admin_action_taken_at.rfc3339}" + "#{path}-#{params[:locale]}-#{release_footprint}-#{Settings::General.admin_action_taken_at.rfc3339}" end def copyright_notice @@ -195,9 +195,9 @@ module ApplicationHelper end def email_link(type = :contact, text: nil, additional_info: nil) - # The allowed types for type are the keys of `SiteConfig.email_addresses` + # The allowed types for type are the keys of `Settings::General.email_addresses` # :default, :contact, :business, :privacy, :members - email = SiteConfig.email_addresses[type] || SiteConfig.email_addresses[:contact] + email = Settings::General.email_addresses[type] || Settings::General.email_addresses[:contact] mail_to email, text || email, additional_info end @@ -206,27 +206,27 @@ module ApplicationHelper end def meta_keywords_default - return if SiteConfig.meta_keywords[:default].blank? + return if Settings::General.meta_keywords[:default].blank? - tag.meta name: "keywords", content: SiteConfig.meta_keywords[:default] + tag.meta name: "keywords", content: Settings::General.meta_keywords[:default] end def meta_keywords_article(article_tags = nil) - return if SiteConfig.meta_keywords[:article].blank? + return if Settings::General.meta_keywords[:article].blank? content = if article_tags.present? - "#{article_tags}, #{SiteConfig.meta_keywords[:article]}" + "#{article_tags}, #{Settings::General.meta_keywords[:article]}" else - SiteConfig.meta_keywords[:article] + Settings::General.meta_keywords[:article] end tag.meta name: "keywords", content: content end def meta_keywords_tag(tag_name) - return if SiteConfig.meta_keywords[:tag].blank? + return if Settings::General.meta_keywords[:tag].blank? - tag.meta name: "keywords", content: "#{SiteConfig.meta_keywords[:tag]}, #{tag_name}" + tag.meta name: "keywords", content: "#{Settings::General.meta_keywords[:tag]}, #{tag_name}" end def app_url(uri = nil) @@ -270,7 +270,7 @@ module ApplicationHelper estimated_user_count > LARGE_USERBASE_THRESHOLD end - def admin_config_label(method, content = nil, model: SiteConfig) + def admin_config_label(method, content = nil, model: Settings::General) content ||= tag.span(method.to_s.humanize) if method.to_sym.in?(Settings::Mandatory.keys) diff --git a/app/helpers/authentication_helper.rb b/app/helpers/authentication_helper.rb index f04c72a5f..e4ede6f6a 100644 --- a/app/helpers/authentication_helper.rb +++ b/app/helpers/authentication_helper.rb @@ -42,7 +42,7 @@ module AuthenticationHelper end def waiting_on_first_user? - SiteConfig.waiting_on_first_user + Settings::General.waiting_on_first_user end def invite_only_mode_or_no_enabled_auth_options diff --git a/app/javascript/admin/controllers/config_controller.js b/app/javascript/admin/controllers/config_controller.js index e4c7c1b0e..837ee51ce 100644 --- a/app/javascript/admin/controllers/config_controller.js +++ b/app/javascript/admin/controllers/config_controller.js @@ -10,12 +10,11 @@ const emailAuthSettingsSection = document.getElementById( 'email-auth-settings-section', ); const emailAuthModalTitle = 'Disable Email address registration'; -// TODO: Remove the sentence "You must update site config to save this action!" -// once we build more robust flow for Admin/Config +// TODO: Remove the "You mut confirm..." warning once we build more robust flow for Admin/Config const emailAuthModalBody = `

If you disable Email address as a registration option, people cannot create an account with their email address.

However, people who have already created an account using their email address can continue to login.

-

You must confirm and update site config to save below this action.

`; +

You must confirm and update the settings below to complete this action.

`; export default class ConfigController extends Controller { static targets = [ @@ -63,14 +62,14 @@ export default class ConfigController extends Controller { (letter) => `_${letter.toLowerCase()}`, ); document.querySelector( - `button[data-id=site_config_${snakeCaseName}]`, + `button[data-id=settings_${snakeCaseName}]`, ).disabled = newValue; } } closeAdminModal() { // per forem/internalEngineering#336, need to short-circuit the - // "Update Site Configuration" button submit action; chose not to + // "Update Settings" button submit action; chose not to // define Target on actual "Update" button (since it's a partial). // The Target is defined on the Authentication form, and that section's // "Update" button is queried. @@ -159,7 +158,7 @@ export default class ConfigController extends Controller { enableOrEditAuthProvider(event) { event.preventDefault(); - const providerName = event.target.dataset.providerName; + const {providerName} = event.target.dataset; const enabledIndicator = document.getElementById( `${providerName}-enabled-indicator`, ); @@ -178,7 +177,7 @@ export default class ConfigController extends Controller { disableAuthProvider(event) { event.preventDefault(); - const providerName = event.target.dataset.providerName; + const {providerName} = event.target.dataset; const enabledIndicator = document.getElementById( `${providerName}-enabled-indicator`, ); @@ -196,13 +195,13 @@ export default class ConfigController extends Controller { } authProviderModalBody(provider) { - return `

If you disable ${provider} as a login option, people cannot authenticate with ${provider}.

You must update Site Config to save this action!

`; + return `

If you disable ${provider} as a login option, people cannot authenticate with ${provider}.

You must update Settings to save this action!

`; } activateAuthProviderModal(event) { event.preventDefault(); - const providerName = event.target.dataset.providerName; - const providerOfficialName = event.target.dataset.providerOfficialName; + const {providerName} = event.target.dataset; + const {providerOfficialName} = event.target.dataset; this.configModalAnchorTarget.innerHTML = adminModal({ title: this.authProviderModalTitle(providerOfficialName), body: this.authProviderModalBody(providerOfficialName), @@ -219,7 +218,7 @@ export default class ConfigController extends Controller { disableAuthProviderFromModal(event) { event.preventDefault(); - const providerName = event.target.dataset.providerName; + const {providerName} = event.target.dataset; const authEnableButton = document.getElementById( `${providerName}-auth-btn`, ); @@ -255,7 +254,7 @@ export default class ConfigController extends Controller { hideAuthProviderSettings(event) { event.preventDefault(); - const providerName = event.target.dataset.providerName; + const {providerName} = event.target.dataset; document .getElementById(`${providerName}-auth-settings`) .classList.add('hidden'); @@ -271,9 +270,8 @@ export default class ConfigController extends Controller { .forEach((provider) => { enabledProviderArray.push(provider.dataset.providerName); }); - document.getElementById( - 'auth_providers_to_enable', - ).value = enabledProviderArray; + document.getElementById('auth_providers_to_enable').value = + enabledProviderArray; } adjustAuthenticationOptions() { diff --git a/app/javascript/onboarding/components/FollowTags.jsx b/app/javascript/onboarding/components/FollowTags.jsx index dc47070dd..68b6c2f8e 100644 --- a/app/javascript/onboarding/components/FollowTags.jsx +++ b/app/javascript/onboarding/components/FollowTags.jsx @@ -143,6 +143,7 @@ export class FollowTags extends Component { : `inset 0 0 0 2px ${tag.bg_color_hex}`, color: selected ? tag.text_color_hex : '', }} + key={tag.id} >
#{tag.name} @@ -150,7 +151,8 @@ export class FollowTags extends Component { type="button" onClick={() => this.handleClick(tag)} className={`onboarding-tags__button ${ - selected && 'onboarding-tags__button--selected crayons-btn--icon-left' + selected && + 'onboarding-tags__button--selected crayons-btn--icon-left' }`} aria-pressed={selected} aria-label={`Follow ${tag.name}`} @@ -163,14 +165,16 @@ export class FollowTags extends Component { : tag.text_color_hex, }} > - { selected && ( - - )} + {selected && ( + + + + )} {selected ? 'Following' : 'Follow'}
diff --git a/app/lib/constants/settings/campaign.rb b/app/lib/constants/settings/campaign.rb index bbac9dad8..db0d3dce6 100644 --- a/app/lib/constants/settings/campaign.rb +++ b/app/lib/constants/settings/campaign.rb @@ -27,7 +27,7 @@ module Constants placeholder: "Campaign sidebar enabled or not" }, sidebar_image: { - description: ::Constants::SiteConfig::IMAGE_PLACEHOLDER, + description: ::Constants::Settings::General::IMAGE_PLACEHOLDER, placeholder: "Used at the top of the campaign sidebar" }, url: { diff --git a/app/lib/constants/settings/general.rb b/app/lib/constants/settings/general.rb new file mode 100644 index 000000000..83b94c638 --- /dev/null +++ b/app/lib/constants/settings/general.rb @@ -0,0 +1,146 @@ +module Constants + module Settings + module General + IMAGE_PLACEHOLDER = "https://url/image.png".freeze + SVG_PLACEHOLDER = "".freeze + + DETAILS = { + 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: "" + } + }, + email_addresses: { + description: "Email address", + placeholder: "" + }, + favicon_url: { + description: "Used as the site favicon", + placeholder: IMAGE_PLACEHOLDER + }, + ga_tracking_id: { + description: "Google Analytics Tracking ID, e.g. UA-71991000-1", + placeholder: "" + }, + health_check_token: { + description: "Used to authenticate with your health check endpoints.", + placeholder: "a secure token" + }, + logo_png: { + description: "Used as a fallback to the SVG. Recommended minimum of 512x512px for PWA support", + placeholder: IMAGE_PLACEHOLDER + }, + logo_svg: { + description: "Used as the SVG logo of the community", + placeholder: SVG_PLACEHOLDER + }, + main_social_image: { + description: "Used as the main image in social networks and OpenGraph. Recommended aspect ratio " \ + "of 16:9 (600x337px,1200x675px)", + placeholder: IMAGE_PLACEHOLDER + }, + mailchimp_api_key: { + description: "API key used to connect Mailchimp account. Found in Mailchimp backend", + placeholder: "" + }, + mailchimp_newsletter_id: { + description: "Main Newsletter ID, also known as Audience ID", + placeholder: "" + }, + mailchimp_sustaining_members_id: { + description: "Sustaining Members Newsletter ID", + placeholder: "" + }, + mailchimp_tag_moderators_id: { + description: "Tag Moderators Newsletter ID", + placeholder: "" + }, + mailchimp_community_moderators_id: { + description: "Community Moderators Newsletter ID", + placeholder: "" + }, + mascot_image_url: { + description: "Used as the mascot image.", + placeholder: IMAGE_PLACEHOLDER + }, + 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: IMAGE_PLACEHOLDER + }, + 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: { + description: "Determines how often periodic email digests are sent", + placeholder: 2 + }, + sidebar_tags: { + description: "Determines which tags are shown on the homepage righthand sidebar", + placeholder: "List of valid, comma-separated tags 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" + }, + 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)", + placeholder: "List of valid tags: comma separated, letters only e.g. beginners,javascript,ruby,swift,kotlin" + }, + suggested_users: { + description: "Determines which users are suggested to follow to new users during onboarding (comma " \ + "separated, letters only). Please note that these users will be shown as a fallback if no " \ + "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" + }, + prefer_manual_suggested_users: { + description: "Always show suggested users as suggested people to follow even when " \ + "auto-suggestion is available" + }, + twitter_hashtag: { + description: "Used as the twitter hashtag of the community", + placeholder: "#DEVCommunity" + }, + video_encoder_key: { + description: "Secret key used to allow AWS video encoding through the VideoStatesController", + placeholder: "" + } + # Dynamic values ommitted: configurable_rate_limits and social_media_handles + }.freeze + end + end +end diff --git a/app/lib/constants/site_config.rb b/app/lib/constants/site_config.rb deleted file mode 100644 index 90f38c994..000000000 --- a/app/lib/constants/site_config.rb +++ /dev/null @@ -1,142 +0,0 @@ -module Constants - module SiteConfig - IMAGE_PLACEHOLDER = "https://url/image.png".freeze - SVG_PLACEHOLDER = "".freeze - - DETAILS = { - 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: "" - } - }, - email_addresses: { - description: "Email address", - placeholder: "" - }, - favicon_url: { - description: "Used as the site favicon", - placeholder: IMAGE_PLACEHOLDER - }, - ga_tracking_id: { - description: "Google Analytics Tracking ID, e.g. UA-71991000-1", - placeholder: "" - }, - health_check_token: { - description: "Used to authenticate with your health check endpoints.", - placeholder: "a secure token" - }, - logo_png: { - description: "Used as a fallback to the SVG. Recommended minimum of 512x512px for PWA support", - placeholder: IMAGE_PLACEHOLDER - }, - logo_svg: { - description: "Used as the SVG logo of the community", - placeholder: SVG_PLACEHOLDER - }, - main_social_image: { - description: "Used as the main image in social networks and OpenGraph. Recommended aspect ratio of 16:9 (600x337px,1200x675px)", - placeholder: IMAGE_PLACEHOLDER - }, - mailchimp_api_key: { - description: "API key used to connect Mailchimp account. Found in Mailchimp backend", - placeholder: "" - }, - mailchimp_newsletter_id: { - description: "Main Newsletter ID, also known as Audience ID", - placeholder: "" - }, - mailchimp_sustaining_members_id: { - description: "Sustaining Members Newsletter ID", - placeholder: "" - }, - mailchimp_tag_moderators_id: { - description: "Tag Moderators Newsletter ID", - placeholder: "" - }, - mailchimp_community_moderators_id: { - description: "Community Moderators Newsletter ID", - placeholder: "" - }, - mascot_image_url: { - description: "Used as the mascot image.", - placeholder: ::Constants::SiteConfig::IMAGE_PLACEHOLDER - }, - 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: IMAGE_PLACEHOLDER - }, - 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: { - description: "Determines how often periodic email digests are sent", - placeholder: 2 - }, - sidebar_tags: { - description: "Determines which tags are shown on the homepage righthand sidebar", - placeholder: "List of valid, comma-separated tags 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" - }, - 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)", - placeholder: "List of valid tags: comma separated, letters only e.g. beginners,javascript,ruby,swift,kotlin" - }, - suggested_users: { - description: "Determines which users are suggested to follow to new users during onboarding (comma " \ - "separated, letters only). Please note that these users will be shown as a fallback if no " \ - "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" - }, - prefer_manual_suggested_users: { - description: "Always show suggested users as suggested people to follow even when " \ - "auto-suggestion is available" - }, - twitter_hashtag: { - description: "Used as the twitter hashtag of the community", - placeholder: "#DEVCommunity" - }, - video_encoder_key: { - description: "Secret key used to allow AWS video encoding through the VideoStatesController", - placeholder: "" - } - # Dynamic values ommitted: configurable_rate_limits and social_media_handles - }.freeze - end -end diff --git a/app/lib/html_css_to_image.rb b/app/lib/html_css_to_image.rb index 5561ccdf7..d570889c5 100644 --- a/app/lib/html_css_to_image.rb +++ b/app/lib/html_css_to_image.rb @@ -27,6 +27,6 @@ module HtmlCssToImage end def self.fallback_image - SiteConfig.main_social_image.to_s + Settings::General.main_social_image.to_s end end diff --git a/app/lib/middlewares/set_cookie_domain.rb b/app/lib/middlewares/set_cookie_domain.rb index 3e69312cb..c1719930e 100644 --- a/app/lib/middlewares/set_cookie_domain.rb +++ b/app/lib/middlewares/set_cookie_domain.rb @@ -7,7 +7,7 @@ module Middlewares end def call(env) - env["rack.session.options"][:domain] = ".#{SiteConfig.app_domain}" + env["rack.session.options"][:domain] = ".#{Settings::General.app_domain}" @app.call(env) end diff --git a/app/lib/redcarpet/render/html_rouge.rb b/app/lib/redcarpet/render/html_rouge.rb index 4128ddbac..bcc45edf4 100644 --- a/app/lib/redcarpet/render/html_rouge.rb +++ b/app/lib/redcarpet/render/html_rouge.rb @@ -50,7 +50,7 @@ module Redcarpet end def app_domain - SiteConfig.app_domain + Settings::General.app_domain end def slugify(string) diff --git a/app/lib/url.rb b/app/lib/url.rb index 4d00db689..6043dc43f 100644 --- a/app/lib/url.rb +++ b/app/lib/url.rb @@ -5,8 +5,8 @@ module URL end def self.domain - if Rails.application&.initialized? && SiteConfig.respond_to?(:app_domain) - SiteConfig.app_domain + if Rails.application&.initialized? && Settings::General.respond_to?(:app_domain) + Settings::General.app_domain else ApplicationConfig["APP_DOMAIN"] end diff --git a/app/liquid_tags/link_tag.rb b/app/liquid_tags/link_tag.rb index 200aac7f4..11fa0f897 100644 --- a/app/liquid_tags/link_tag.rb +++ b/app/liquid_tags/link_tag.rb @@ -26,7 +26,7 @@ class LinkTag < LiquidTagBase path = url.path # If domain is present in url check if it belongs to the app - unless domain.blank? || domain&.casecmp?(SiteConfig.app_domain) + unless domain.blank? || domain&.casecmp?(Settings::General.app_domain) raise StandardError, "The article you're looking for does not exist: {% link #{slug} %}" end diff --git a/app/liquid_tags/twitch_tag.rb b/app/liquid_tags/twitch_tag.rb index 1be23df5e..91e01e41d 100644 --- a/app/liquid_tags/twitch_tag.rb +++ b/app/liquid_tags/twitch_tag.rb @@ -3,7 +3,7 @@ class TwitchTag < LiquidTagBase def initialize(_tag_name, slug, _parse_context) super - @url = parsed_url(SiteConfig.app_domain) + @url = parsed_url(Settings::General.app_domain) @slug = parsed_slug(slug) @width = 710 @height = 399 diff --git a/app/mailers/application_mailer.rb b/app/mailers/application_mailer.rb index 7b0d4a4e0..6ecebcfa4 100644 --- a/app/mailers/application_mailer.rb +++ b/app/mailers/application_mailer.rb @@ -21,7 +21,7 @@ class ApplicationMailer < ActionMailer::Base Settings::Community.community_name end - "#{community_name} <#{SiteConfig.email_addresses[:default]}>" + "#{community_name} <#{Settings::General.email_addresses[:default]}>" end def generate_unsubscribe_token(id, email_type) @@ -33,6 +33,6 @@ class ApplicationMailer < ActionMailer::Base end def use_custom_host - ActionMailer::Base.default_url_options[:host] = SiteConfig.app_domain + ActionMailer::Base.default_url_options[:host] = Settings::General.app_domain end end diff --git a/app/mailers/devise_mailer.rb b/app/mailers/devise_mailer.rb index 2e9d96546..303fecafa 100644 --- a/app/mailers/devise_mailer.rb +++ b/app/mailers/devise_mailer.rb @@ -1,9 +1,9 @@ class DeviseMailer < Devise::Mailer - before_action :use_site_config_values + before_action :use_settings_general_values - def use_site_config_values + def use_settings_general_values Devise.mailer_sender = - "#{Settings::Community.community_name} <#{SiteConfig.email_addresses[:default]}>" - ActionMailer::Base.default_url_options[:host] = SiteConfig.app_domain + "#{Settings::Community.community_name} <#{Settings::General.email_addresses[:default]}>" + ActionMailer::Base.default_url_options[:host] = Settings::General.app_domain end end diff --git a/app/mailers/verification_mailer.rb b/app/mailers/verification_mailer.rb index 644549122..78eb06b7e 100644 --- a/app/mailers/verification_mailer.rb +++ b/app/mailers/verification_mailer.rb @@ -1,6 +1,6 @@ class VerificationMailer < ApplicationMailer default from: lambda { - "#{Settings::Community.community_name} Email Verification <#{SiteConfig.email_addresses[:default]}>" + "#{Settings::Community.community_name} Email Verification <#{Settings::General.email_addresses[:default]}>" } def account_ownership_verification_email diff --git a/app/models/article.rb b/app/models/article.rb index d674bd2f1..9e0013959 100644 --- a/app/models/article.rb +++ b/app/models/article.rb @@ -176,7 +176,7 @@ class Article < ApplicationRecord .where(user_id: User.with_role(:super_admin) .union(User.with_role(:admin)) .union(id: [Settings::Community.staff_user_id, - SiteConfig.mascot_user_id].compact) + Settings::General.mascot_user_id].compact) .select(:id)).order(published_at: :desc).tagged_with(tag_name) } @@ -788,7 +788,7 @@ class Article < ApplicationRecord end Reaction.create( - user_id: SiteConfig.mascot_user_id, + user_id: Settings::General.mascot_user_id, reactable_id: id, reactable_type: "Article", category: "vomit", @@ -798,7 +798,7 @@ class Article < ApplicationRecord user.add_role(:suspended) Note.create( - author_id: SiteConfig.mascot_user_id, + author_id: Settings::General.mascot_user_id, noteable_id: user_id, noteable_type: "User", reason: "automatic_suspend", diff --git a/app/models/comment.rb b/app/models/comment.rb index dea13c6e8..8c48b2a71 100644 --- a/app/models/comment.rb +++ b/app/models/comment.rb @@ -271,7 +271,7 @@ class Comment < ApplicationRecord user.registered_at > 5.days.ago Reaction.create( - user_id: SiteConfig.mascot_user_id, + user_id: Settings::General.mascot_user_id, reactable_id: id, reactable_type: "Comment", category: "vomit", @@ -281,7 +281,7 @@ class Comment < ApplicationRecord user.add_role(:suspended) Note.create( - author_id: SiteConfig.mascot_user_id, + author_id: Settings::General.mascot_user_id, noteable_id: user_id, noteable_type: "User", reason: "automatic_suspend", diff --git a/app/models/forem_instance.rb b/app/models/forem_instance.rb index dbae3018d..5c9b02545 100644 --- a/app/models/forem_instance.rb +++ b/app/models/forem_instance.rb @@ -8,4 +8,19 @@ class ForemInstance def self.latest_commit_id @latest_commit_id ||= ApplicationConfig["FOREM_BUILD_SHA"].presence || ENV["HEROKU_SLUG_COMMIT"].presence end + + # Return true if we are operating on a local installation, false otherwise + def self.local? + Settings::General.app_domain.include?("localhost") + end + + # Used where we need to keep old DEV features around but don't want to/cannot + # expose them to other communities. + def self.dev_to? + Settings::General.app_domain == "dev.to" + end + + def self.smtp_enabled? + Rails.configuration.action_mailer.perform_deliveries + end end diff --git a/app/models/message.rb b/app/models/message.rb index 6a6848f44..249e154a1 100644 --- a/app/models/message.rb +++ b/app/models/message.rb @@ -193,19 +193,19 @@ class Message < ApplicationRecord end def rich_link_article(link) - return unless link["href"].include?("//#{SiteConfig.app_domain}/") && link["href"].split("/")[4] + return unless link["href"].include?("//#{Settings::General.app_domain}/") && link["href"].split("/")[4] Article.find_by(slug: link["href"].split("/")[4].split("?")[0]) end def rich_link_tag(link) - return unless link["href"].include?("//#{SiteConfig.app_domain}/t/") + return unless link["href"].include?("//#{Settings::General.app_domain}/t/") Tag.find_by(name: link["href"].split("/t/")[1].split("/")[0]) end def rich_user_link(link) - return unless link["href"].include?("//#{SiteConfig.app_domain}/") + return unless link["href"].include?("//#{Settings::General.app_domain}/") User.find_by(username: link["href"].split("/")[3].split("/")[0]) end diff --git a/app/models/reaction.rb b/app/models/reaction.rb index cbba6b6eb..99ec76c2a 100644 --- a/app/models/reaction.rb +++ b/app/models/reaction.rb @@ -130,7 +130,7 @@ class Reaction < ApplicationRecord end def negative_reaction_from_untrusted_user? - return if user&.any_admin? || user&.id == SiteConfig.mascot_user_id + return if user&.any_admin? || user&.id == Settings::General.mascot_user_id negative? && !user.trusted end diff --git a/app/models/settings/general.rb b/app/models/settings/general.rb new file mode 100644 index 000000000..11e01a1db --- /dev/null +++ b/app/models/settings/general.rb @@ -0,0 +1,136 @@ +# Settings based on RailsSettings models, +# see for further info +module Settings + class General < RailsSettings::Base + self.table_name = "site_configs" + + # the configuration is cached, change this if you want to force update + # the cache, or call Settings::General.clear_cache + cache_prefix { "v1" } + + HEX_COLOR_REGEX = /\A#(\h{6}|\h{3})\z/.freeze + LIGHTNING_ICON = File.read(Rails.root.join("app/assets/images/lightning.svg")).freeze + STACK_ICON = File.read(Rails.root.join("app/assets/images/stack.svg")).freeze + + # Forem Team + # [forem-fix] Remove channel name from Settings::General + field :article_published_slack_channel, type: :string, default: "activity" + + # Meta + field :admin_action_taken_at, type: :datetime, default: Time.current + + # Core setup + field :waiting_on_first_user, type: :boolean, default: !User.exists? + field :app_domain, type: :string, default: ApplicationConfig["APP_DOMAIN"] + + # API Tokens + field :health_check_token, type: :string + field :video_encoder_key, type: :string + + # Emails + field :email_addresses, type: :hash, default: { + default: ApplicationConfig["DEFAULT_EMAIL"], + contact: ApplicationConfig["DEFAULT_EMAIL"], + business: ApplicationConfig["DEFAULT_EMAIL"], + privacy: ApplicationConfig["DEFAULT_EMAIL"], + members: ApplicationConfig["DEFAULT_EMAIL"] + } + + # Email digest frequency + field :periodic_email_digest, type: :integer, default: 2 + + # Google Analytics Tracking ID, e.g. UA-71991000-1 + field :ga_tracking_id, type: :string, default: ApplicationConfig["GA_TRACKING_ID"] + + # Images + field :main_social_image, + type: :string, + default: proc { URL.local_image("social-media-cover.png") }, + validates: { url: true } + + field :favicon_url, type: :string, default: proc { URL.local_image("favicon.ico") } + field :logo_png, + type: :string, + default: proc { URL.local_image("icon.png") }, + validates: { url: true } + + field :logo_svg, type: :string + + field :enable_video_upload, type: :boolean, default: false + + # Mascot + field :mascot_user_id, type: :integer, default: nil + field :mascot_image_url, + type: :string, + default: proc { URL.local_image("mascot.png") }, + validates: { url: true } + field :mascot_image_description, type: :string, default: "The community mascot" + field :mascot_footer_image_url, type: :string, validates: { url: true } + field :mascot_footer_image_width, type: :integer, default: 52 + field :mascot_footer_image_height, type: :integer, default: 120 + + # Meta keywords + field :meta_keywords, type: :hash, default: { + default: nil, + article: nil, + tag: nil + } + + # Monetization + field :payment_pointer, type: :string + field :stripe_api_key, type: :string, default: ApplicationConfig["STRIPE_SECRET_KEY"] + field :stripe_publishable_key, type: :string, default: ApplicationConfig["STRIPE_PUBLISHABLE_KEY"] + + # Newsletter + # + field :mailchimp_api_key, type: :string, default: ApplicationConfig["MAILCHIMP_API_KEY"] + field :mailchimp_newsletter_id, type: :string, default: "" + field :mailchimp_sustaining_members_id, type: :string, default: "" + field :mailchimp_tag_moderators_id, type: :string, default: "" + field :mailchimp_community_moderators_id, type: :string, default: "" + # Mailchimp webhook secret. Part of the callback URL in the Mailchimp settings. + # + field :mailchimp_incoming_webhook_secret, type: :string, default: "" + + # Onboarding + field :onboarding_background_image, type: :string, validates: { url: true } + field :suggested_tags, type: :array, default: %w[] + field :suggested_users, type: :array, default: %w[] + field :prefer_manual_suggested_users, type: :boolean, default: false + + # Social Media + field :social_media_handles, type: :hash, default: { + twitter: nil, + facebook: nil, + github: nil, + instagram: nil, + twitch: nil + } + field :twitter_hashtag, type: :string + + # Sponsors + field :sponsor_headline, default: "Community Sponsors" + + # Tags + field :sidebar_tags, type: :array, default: %w[] + + # Broadcast + field :welcome_notifications_live_at, type: :date + + # Credits + field :credit_prices_in_cents, type: :hash, default: { + small: 500, + medium: 400, + large: 300, + xlarge: 250 + } + + # Push Notifications + field :push_notifications_ios_pem, type: :string + + # To get default values + def self.get_default(field) + get_field(field)[:default] + end + end +end diff --git a/app/models/settings/mandatory.rb b/app/models/settings/mandatory.rb index 46381fe52..f1930f44e 100644 --- a/app/models/settings/mandatory.rb +++ b/app/models/settings/mandatory.rb @@ -7,8 +7,8 @@ module Settings community_name: Settings::Community, community_description: Settings::Community, - suggested_tags: SiteConfig, - suggested_users: SiteConfig + suggested_tags: Settings::General, + suggested_users: Settings::General }.freeze MAPPINGS.each do |setting, settings_model| diff --git a/app/models/settings/mascot.rb b/app/models/settings/mascot.rb deleted file mode 100644 index f994ce408..000000000 --- a/app/models/settings/mascot.rb +++ /dev/null @@ -1,21 +0,0 @@ -module Settings - class Mascot < RailsSettings::Base - self.table_name = :settings_mascots - - # The configuration is cached, change this if you want to force update - # the cache, or call Settings::Mascot.clear_cache - cache_prefix { "v1" } - - field :image_url, - type: :string, - default: proc { URL.local_image("mascot.png") }, - validates: { url: true } - field :mascot_user_id, type: :integer, default: nil - - # NOTE: @citizen428 - This is duplicated for now, I will refactor once - # all settings models have been extracted. - def self.get_default(field) - get_field(field)[:default] - end - end -end diff --git a/app/models/site_config.rb b/app/models/site_config.rb deleted file mode 100644 index 46b4556d3..000000000 --- a/app/models/site_config.rb +++ /dev/null @@ -1,146 +0,0 @@ -# Site configuration based on RailsSettings models, -# see for further info - -class SiteConfig < RailsSettings::Base - self.table_name = "site_configs" - - # the site configuration is cached, change this if you want to force update - # the cache, or call SiteConfig.clear_cache - cache_prefix { "v1" } - - HEX_COLOR_REGEX = /\A#(\h{6}|\h{3})\z/.freeze - LIGHTNING_ICON = File.read(Rails.root.join("app/assets/images/lightning.svg")).freeze - STACK_ICON = File.read(Rails.root.join("app/assets/images/stack.svg")).freeze - - # Forem Team - # [forem-fix] Remove channel name from SiteConfig - field :article_published_slack_channel, type: :string, default: "activity" - - # Meta - field :admin_action_taken_at, type: :datetime, default: Time.current - - # Core setup - field :waiting_on_first_user, type: :boolean, default: !User.exists? - field :app_domain, type: :string, default: ApplicationConfig["APP_DOMAIN"] - - # API Tokens - field :health_check_token, type: :string - field :video_encoder_key, type: :string - - # Emails - field :email_addresses, type: :hash, default: { - default: ApplicationConfig["DEFAULT_EMAIL"], - contact: ApplicationConfig["DEFAULT_EMAIL"], - business: ApplicationConfig["DEFAULT_EMAIL"], - privacy: ApplicationConfig["DEFAULT_EMAIL"], - members: ApplicationConfig["DEFAULT_EMAIL"] - } - - # Email digest frequency - field :periodic_email_digest, type: :integer, default: 2 - - # Google Analytics Tracking ID, e.g. UA-71991000-1 - field :ga_tracking_id, type: :string, default: ApplicationConfig["GA_TRACKING_ID"] - - # Images - field :main_social_image, - type: :string, - default: proc { URL.local_image("social-media-cover.png") }, - validates: { url: true } - - field :favicon_url, type: :string, default: proc { URL.local_image("favicon.ico") } - field :logo_png, - type: :string, - default: proc { URL.local_image("icon.png") }, - validates: { url: true } - - field :logo_svg, type: :string - - field :enable_video_upload, type: :boolean, default: false - - # Mascot - field :mascot_user_id, type: :integer, default: nil - field :mascot_image_url, - type: :string, - default: proc { URL.local_image("mascot.png") }, - validates: { url: true } - - # Meta keywords - field :meta_keywords, type: :hash, default: { - default: nil, - article: nil, - tag: nil - } - - # Monetization - field :payment_pointer, type: :string - field :stripe_api_key, type: :string, default: ApplicationConfig["STRIPE_SECRET_KEY"] - field :stripe_publishable_key, type: :string, default: ApplicationConfig["STRIPE_PUBLISHABLE_KEY"] - - # Newsletter - # - field :mailchimp_api_key, type: :string, default: ApplicationConfig["MAILCHIMP_API_KEY"] - field :mailchimp_newsletter_id, type: :string, default: "" - field :mailchimp_sustaining_members_id, type: :string, default: "" - field :mailchimp_tag_moderators_id, type: :string, default: "" - field :mailchimp_community_moderators_id, type: :string, default: "" - # Mailchimp webhook secret. Part of the callback URL in the Mailchimp settings. - # - field :mailchimp_incoming_webhook_secret, type: :string, default: "" - - # Onboarding - field :onboarding_background_image, type: :string, validates: { url: true } - field :suggested_tags, type: :array, default: %w[] - field :suggested_users, type: :array, default: %w[] - field :prefer_manual_suggested_users, type: :boolean, default: false - - # Social Media - field :social_media_handles, type: :hash, default: { - twitter: nil, - facebook: nil, - github: nil, - instagram: nil, - twitch: nil - } - field :twitter_hashtag, type: :string - - # Sponsors - field :sponsor_headline, default: "Community Sponsors" - - # Tags - field :sidebar_tags, type: :array, default: %w[] - - # Broadcast - field :welcome_notifications_live_at, type: :date - - # Credits - field :credit_prices_in_cents, type: :hash, default: { - small: 500, - medium: 400, - large: 300, - xlarge: 250 - } - - # Push Notifications - field :push_notifications_ios_pem, type: :string - - # Returns true if we are operating on a local installation, false otherwise - def self.local? - app_domain.include?("localhost") - end - - # Used where we need to keep old DEV features around but don't want to/cannot - # expose them to other communities. - def self.dev_to? - app_domain == "dev.to" - end - - # To get default values - def self.get_default(field) - get_field(field)[:default] - end - - def self.smtp_enabled? - Rails.configuration.action_mailer.perform_deliveries - end -end diff --git a/app/models/user.rb b/app/models/user.rb index 94027fe58..371af7cc8 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -310,7 +310,7 @@ class User < ApplicationRecord end def self.mascot_account - find_by(id: SiteConfig.mascot_user_id) + find_by(id: Settings::General.mascot_user_id) end def tag_line @@ -498,7 +498,7 @@ class User < ApplicationRecord def subscribe_to_mailchimp_newsletter return unless registered && email.present? - return if SiteConfig.mailchimp_api_key.blank? && SiteConfig.mailchimp_newsletter_id.blank? + return if Settings::General.mailchimp_api_key.blank? && Settings::General.mailchimp_newsletter_id.blank? return if saved_changes.key?(:unconfirmed_email) && saved_changes.key?(:confirmation_sent_at) return unless saved_changes.key?(:email) || saved_changes.key?(:email_newsletter) @@ -526,7 +526,7 @@ class User < ApplicationRecord def unsubscribe_from_newsletters return if email.blank? - return if SiteConfig.mailchimp_api_key.blank? && SiteConfig.mailchimp_newsletter_id.blank? + return if Settings::General.mailchimp_api_key.blank? && Settings::General.mailchimp_newsletter_id.blank? Mailchimp::Bot.new(self).unsubscribe_all_newsletters end @@ -696,6 +696,6 @@ class User < ApplicationRecord end def confirmation_required? - SiteConfig.smtp_enabled? + ForemInstance.smtp_enabled? end end diff --git a/app/policies/video_policy.rb b/app/policies/video_policy.rb index dde78029c..6982371ea 100644 --- a/app/policies/video_policy.rb +++ b/app/policies/video_policy.rb @@ -8,6 +8,6 @@ class VideoPolicy < ApplicationPolicy end def enabled? - SiteConfig.enable_video_upload + Settings::General.enable_video_upload end end diff --git a/app/services/authentication/providers/apple.rb b/app/services/authentication/providers/apple.rb index ea2a05d10..5a3f06115 100644 --- a/app/services/authentication/providers/apple.rb +++ b/app/services/authentication/providers/apple.rb @@ -18,7 +18,7 @@ module Authentication } if Rails.env.test? - user_data[:profile_image] = SiteConfig.mascot_image_url + user_data[:profile_image] = Settings::General.mascot_image_url else user_data[:remote_profile_image_url] = Users::ProfileImageGenerator.call end diff --git a/app/services/email_digest.rb b/app/services/email_digest.rb index f0012c484..02af23dd6 100644 --- a/app/services/email_digest.rb +++ b/app/services/email_digest.rb @@ -13,7 +13,7 @@ class EmailDigest # Temporary # @sre:mstruve This is temporary until we have an efficient way to handle this job # for our large DEV community. Smaller Forems should be able to handle it no problem - if SiteConfig.dev_to? + if ForemInstance.dev_to? Emails::SendUserDigestWorker.new.perform(user.id) else Emails::SendUserDigestWorker.perform_async(user.id) diff --git a/app/services/email_digest_article_collector.rb b/app/services/email_digest_article_collector.rb index 32dae552b..756048d20 100644 --- a/app/services/email_digest_article_collector.rb +++ b/app/services/email_digest_article_collector.rb @@ -50,7 +50,7 @@ class EmailDigestArticleCollector return true unless last_email_sent_at # Has it been at least x days since @user received an email? - Time.current - last_email_sent_at >= SiteConfig.periodic_email_digest + Time.current - last_email_sent_at >= Settings::General.periodic_email_digest end def last_email_sent_at diff --git a/app/services/error_messages/clean.rb b/app/services/error_messages/clean.rb index 31dfbb475..dcf190477 100644 --- a/app/services/error_messages/clean.rb +++ b/app/services/error_messages/clean.rb @@ -9,7 +9,7 @@ module ErrorMessages def self.call(error_message) return error_message unless error_message.match?(FRONTMATTER_ERROR) - format(REPLACEMENT_ERROR, SiteConfig.email_addresses[:contact]) + format(REPLACEMENT_ERROR, Settings::General.email_addresses[:contact]) end end end diff --git a/app/services/html/parser.rb b/app/services/html/parser.rb index 832f58f93..ced1d436a 100644 --- a/app/services/html/parser.rb +++ b/app/services/html/parser.rb @@ -274,7 +274,7 @@ module Html username = mention.delete("@").downcase if User.find_by(username: username) <<~HTML - @#{username} + @#{username} HTML else mention diff --git a/app/services/mailchimp/bot.rb b/app/services/mailchimp/bot.rb index 3c4313df7..26a0e3602 100644 --- a/app/services/mailchimp/bot.rb +++ b/app/services/mailchimp/bot.rb @@ -5,7 +5,7 @@ module Mailchimp def initialize(user) @user = user @saved_changes = user.saved_changes - Gibbon::Request.api_key = SiteConfig.mailchimp_api_key + Gibbon::Request.api_key = Settings::General.mailchimp_api_key Gibbon::Request.timeout = 15 @gibbon = Gibbon::Request.new end @@ -22,7 +22,7 @@ module Mailchimp # attempt to update email if user changed email addresses success = false begin - gibbon.lists(SiteConfig.mailchimp_newsletter_id).members(target_md5_email).upsert( + gibbon.lists(Settings::General.mailchimp_newsletter_id).members(target_md5_email).upsert( body: { email_address: user.email, status: user.email_newsletter ? "subscribed" : "unsubscribed", @@ -54,7 +54,7 @@ module Mailchimp success = false begin - gibbon.lists(SiteConfig.mailchimp_newsletter_id).members(target_md5_email).upsert( + gibbon.lists(Settings::General.mailchimp_newsletter_id).members(target_md5_email).upsert( body: { status: "pending" }, ) success = true @@ -65,12 +65,12 @@ module Mailchimp end def manage_community_moderator_list - return false unless SiteConfig.mailchimp_community_moderators_id.present? && user.has_role?(:trusted) + return false unless Settings::General.mailchimp_community_moderators_id.present? && user.has_role?(:trusted) success = false status = user.email_community_mod_newsletter ? "subscribed" : "unsubscribed" begin - gibbon.lists(SiteConfig.mailchimp_community_moderators_id).members(target_md5_email).upsert( + gibbon.lists(Settings::General.mailchimp_community_moderators_id).members(target_md5_email).upsert( body: { email_address: user.email, status: status, @@ -91,7 +91,7 @@ module Mailchimp end def manage_tag_moderator_list - return false unless SiteConfig.mailchimp_tag_moderators_id.present? && user.tag_moderator? + return false unless Settings::General.mailchimp_tag_moderators_id.present? && user.tag_moderator? success = false @@ -101,7 +101,7 @@ module Mailchimp status = user.email_tag_mod_newsletter ? "subscribed" : "unsubscribed" begin - gibbon.lists(SiteConfig.mailchimp_tag_moderators_id).members(target_md5_email).upsert( + gibbon.lists(Settings::General.mailchimp_tag_moderators_id).members(target_md5_email).upsert( body: { email_address: user.email, status: status, @@ -123,9 +123,9 @@ module Mailchimp end def unsub_sustaining_member - return unless SiteConfig.mailchimp_sustaining_members_id.present? && a_sustaining_member? + return unless Settings::General.mailchimp_sustaining_members_id.present? && a_sustaining_member? - gibbon.lists(SiteConfig.mailchimp_sustaining_members_id).members(target_md5_email).update( + gibbon.lists(Settings::General.mailchimp_sustaining_members_id).members(target_md5_email).update( body: { status: "unsubscribed" }, @@ -133,9 +133,9 @@ module Mailchimp end def unsub_community_mod - return unless SiteConfig.mailchimp_community_moderators_id.present? && user.trusted + return unless Settings::General.mailchimp_community_moderators_id.present? && user.trusted - gibbon.lists(SiteConfig.mailchimp_community_moderators_id).members(target_md5_email).update( + gibbon.lists(Settings::General.mailchimp_community_moderators_id).members(target_md5_email).update( body: { status: "unsubscribed" }, @@ -143,9 +143,9 @@ module Mailchimp end def unsub_tag_mod - return unless SiteConfig.mailchimp_tag_moderators_id.present? && user.tag_moderator? + return unless Settings::General.mailchimp_tag_moderators_id.present? && user.tag_moderator? - gibbon.lists(SiteConfig.mailchimp_tag_moderators_id).members(target_md5_email).update( + gibbon.lists(Settings::General.mailchimp_tag_moderators_id).members(target_md5_email).update( body: { status: "unsubscribed" }, @@ -155,7 +155,7 @@ module Mailchimp def unsubscribe_all_newsletters success = false begin - gibbon.lists(SiteConfig.mailchimp_newsletter_id).members(target_md5_email).update( + gibbon.lists(Settings::General.mailchimp_newsletter_id).members(target_md5_email).update( body: { status: "unsubscribed" }, diff --git a/app/services/re_captcha/check_enabled.rb b/app/services/re_captcha/check_enabled.rb index 03a42e558..35a8d3609 100644 --- a/app/services/re_captcha/check_enabled.rb +++ b/app/services/re_captcha/check_enabled.rb @@ -1,6 +1,6 @@ # This service encapsulates the logic related to validating if reCAPTCHA is # enabled in the current Forem instance. The decision is based on making -# sure the necessary SiteConfig keys are available and also on the user +# sure the necessary Settings::General keys are available and also on the user # object passed in. # # Example use: ReCaptcha::CheckEnabled.call(current_user) => true/false diff --git a/app/services/re_captcha/check_registration_enabled.rb b/app/services/re_captcha/check_registration_enabled.rb index 51a892b5a..330f5657a 100644 --- a/app/services/re_captcha/check_registration_enabled.rb +++ b/app/services/re_captcha/check_registration_enabled.rb @@ -2,7 +2,7 @@ module ReCaptcha class CheckRegistrationEnabled def self.call # ReCaptcha::CheckEnabled.call without a user parameter will return `true` - # if the ReCaptcha SiteConfig keys are configured, and `false` otherwise + # if the ReCaptcha Settings::General keys are configured, and `false` otherwise ReCaptcha::CheckEnabled.call && Settings::Authentication.require_captcha_for_email_password_registration end diff --git a/app/services/settings/upsert.rb b/app/services/settings/upsert.rb index 3ead117c8..cdd44aca8 100644 --- a/app/services/settings/upsert.rb +++ b/app/services/settings/upsert.rb @@ -34,11 +34,11 @@ module Settings def upsert_configs @configs.each do |key, value| if value.is_a?(Array) - SiteConfig.public_send("#{key}=", value.reject(&:blank?)) unless value.empty? + Settings::General.public_send("#{key}=", value.reject(&:blank?)) unless value.empty? elsif value.respond_to?(:to_h) - SiteConfig.public_send("#{key}=", value.to_h) unless value.empty? + Settings::General.public_send("#{key}=", value.to_h) unless value.empty? else - SiteConfig.public_send("#{key}=", value.strip) unless value.nil? + Settings::General.public_send("#{key}=", value.strip) unless value.nil? end rescue ActiveRecord::RecordInvalid => e @errors << e.message @@ -62,7 +62,7 @@ module Settings # This is an acts-as-taggable-on as used on saving of an Article, etc. return unless (@configs.keys & %w[suggested_tags sidebar_tags]).any? - Tag.find_or_create_all_with_like_by_name(SiteConfig.suggested_tags + SiteConfig.sidebar_tags) + Tag.find_or_create_all_with_like_by_name(Settings::General.suggested_tags + Settings::General.sidebar_tags) end end end diff --git a/app/services/slack/messengers/article_published.rb b/app/services/slack/messengers/article_published.rb index 7d0ef3bca..ea7b23b3e 100644 --- a/app/services/slack/messengers/article_published.rb +++ b/app/services/slack/messengers/article_published.rb @@ -23,10 +23,10 @@ module Slack url: URL.article(article), ) - # [forem-fix] Remove channel name from SiteConfig + # [forem-fix] Remove channel name from Settings::General Slack::Messengers::Worker.perform_async( message: message, - channel: SiteConfig.article_published_slack_channel, + channel: Settings::General.article_published_slack_channel, username: "article_bot", icon_emoji: ":writing_hand:", ) diff --git a/app/services/tag_moderators/add.rb b/app/services/tag_moderators/add.rb index c7263852c..8c53f0591 100644 --- a/app/services/tag_moderators/add.rb +++ b/app/services/tag_moderators/add.rb @@ -58,8 +58,8 @@ module TagModerators end def tag_mod_newsletter_enabled? - SiteConfig.mailchimp_api_key.present? && - SiteConfig.mailchimp_tag_moderators_id.present? + Settings::General.mailchimp_api_key.present? && + Settings::General.mailchimp_tag_moderators_id.present? end def chat_channel_slug(tag) diff --git a/app/services/tag_moderators/add_trusted_role.rb b/app/services/tag_moderators/add_trusted_role.rb index 7cb2a8ba3..a1577869b 100644 --- a/app/services/tag_moderators/add_trusted_role.rb +++ b/app/services/tag_moderators/add_trusted_role.rb @@ -13,8 +13,8 @@ module TagModerators end def self.community_mod_newsletter_enabled? - SiteConfig.mailchimp_api_key.present? && - SiteConfig.mailchimp_community_moderators_id.present? + Settings::General.mailchimp_api_key.present? && + Settings::General.mailchimp_community_moderators_id.present? end private_class_method :community_mod_newsletter_enabled? end diff --git a/app/services/tag_moderators/remove.rb b/app/services/tag_moderators/remove.rb index b60d39d33..518b475dd 100644 --- a/app/services/tag_moderators/remove.rb +++ b/app/services/tag_moderators/remove.rb @@ -10,8 +10,8 @@ module TagModerators end def self.tag_mod_newsletter_enabled? - SiteConfig.mailchimp_api_key.present? && - SiteConfig.mailchimp_tag_moderators_id.present? + Settings::General.mailchimp_api_key.present? && + Settings::General.mailchimp_tag_moderators_id.present? end private_class_method :tag_mod_newsletter_enabled? end diff --git a/app/services/users/create_mascot_account.rb b/app/services/users/create_mascot_account.rb index db1c8f701..af78237ae 100644 --- a/app/services/users/create_mascot_account.rb +++ b/app/services/users/create_mascot_account.rb @@ -4,7 +4,7 @@ module Users email: "mascot@forem.com", username: "mascot", name: "Mascot", - profile_image: SiteConfig.mascot_image_url, + profile_image: Settings::General.mascot_image_url, confirmed_at: Time.current, registered_at: Time.current, password: SecureRandom.hex @@ -15,10 +15,10 @@ module Users end def call - raise "Mascot already set" if SiteConfig.mascot_user_id + raise "Mascot already set" if Settings::General.mascot_user_id mascot = User.create!(mascot_params) - SiteConfig.mascot_user_id = mascot.id + Settings::General.mascot_user_id = mascot.id end def mascot_params diff --git a/app/view_objects/articles/social_image.rb b/app/view_objects/articles/social_image.rb index e26f2876f..df007ec88 100644 --- a/app/view_objects/articles/social_image.rb +++ b/app/view_objects/articles/social_image.rb @@ -18,7 +18,7 @@ module Articles end return legacy_article_social_image unless use_new_social_url? - article_social_preview_url(article, format: :png, host: SiteConfig.app_domain) + article_social_preview_url(article, format: :png, host: Settings::General.app_domain) end private diff --git a/app/views/admin/configs/_form_submission.html.erb b/app/views/admin/configs/_form_submission.html.erb index fd5303acf..761f89da4 100644 --- a/app/views/admin/configs/_form_submission.html.erb +++ b/app/views/admin/configs/_form_submission.html.erb @@ -5,7 +5,7 @@

Type the sentence: <%= @confirmation_text %>

<%= text_field_tag :confirmation, nil, class: "crayons-textfield flex-1 mr-2", placeholder: "Confirmation text", autocomplete: "off", required: true, pattern: @confirmation_text %> - <%= f.submit "Update Site Configuration", class: "crayons-btn align-self-start" %> + <%= f.submit "Update Settings", class: "crayons-btn align-self-start" %>
diff --git a/app/views/admin/configs/show.html.erb b/app/views/admin/configs/show.html.erb index 789075cf0..7d9aeb62a 100644 --- a/app/views/admin/configs/show.html.erb +++ b/app/views/admin/configs/show.html.erb @@ -83,7 +83,7 @@

Type the sentence: <%= @confirmation_text %>

<%= text_field_tag :confirmation, nil, class: "crayons-textfield flex-1 mr-2", placeholder: "Confirmation text", autocomplete: "off", required: true, pattern: @confirmation_text %> - <%= f.submit "Update Site Configuration", class: "crayons-btn align-self-start" %> + <%= f.submit "Update Settings", class: "crayons-btn align-self-start" %>
@@ -94,28 +94,28 @@ -
+
+ aria-controls="settingsBodyContainer"> -

All Site Configuration

+

All Settings

-
- <%= form_for(SiteConfig.new, url: admin_config_path) do |f| %> +
+ <%= form_for(Settings::General.new, url: admin_config_path) do |f| %>
<%= render partial: "admin/shared/card_header", locals: { @@ -128,19 +128,19 @@
<%= admin_config_label :health_check_token %> - <%= admin_config_description Constants::SiteConfig::DETAILS[:health_check_token][:description] %> + <%= admin_config_description Constants::Settings::General::DETAILS[:health_check_token][:description] %> <%= f.text_field :health_check_token, class: "crayons-textfield", - value: SiteConfig.health_check_token, - placeholder: Constants::SiteConfig::DETAILS[:health_check_token][:placeholder] %> + value: Settings::General.health_check_token, + placeholder: Constants::Settings::General::DETAILS[:health_check_token][:placeholder] %>
<%= admin_config_label :video_encoder_key %> - <%= admin_config_description Constants::SiteConfig::DETAILS[:video_encoder_key][:description] %> + <%= admin_config_description Constants::Settings::General::DETAILS[:video_encoder_key][:description] %> <%= f.text_field :video_encoder_key, class: "crayons-textfield", - value: SiteConfig.video_encoder_key, - placeholder: Constants::SiteConfig::DETAILS[:video_encoder_key][:placeholder] %> + value: Settings::General.video_encoder_key, + placeholder: Constants::Settings::General::DETAILS[:video_encoder_key][:placeholder] %>
<%= render "form_submission", f: f %>
@@ -533,7 +533,7 @@
<% end %> - <%= form_for(SiteConfig.new, url: admin_config_path) do |f| %> + <%= form_for(Settings::General.new, url: admin_config_path) do |f| %>
<%= render partial: "admin/shared/card_header", locals: { @@ -548,33 +548,33 @@ <%= f.fields_for :credit_prices_in_cents do |price_field| %>
<%= admin_config_label "Credit price in cents (S)" %> - <%= admin_config_description Constants::SiteConfig::DETAILS[:credit_prices_in_cents][:small][:description] %> + <%= admin_config_description Constants::Settings::General::DETAILS[:credit_prices_in_cents][:small][:description] %> <%= price_field.number_field :small, class: "crayons-textfield", - value: SiteConfig.credit_prices_in_cents[:small] %> + value: Settings::General.credit_prices_in_cents[:small] %>
<%= admin_config_label "Credit price in cents (M)" %> - <%= admin_config_description Constants::SiteConfig::DETAILS[:credit_prices_in_cents][:medium][:description] %> + <%= admin_config_description Constants::Settings::General::DETAILS[:credit_prices_in_cents][:medium][:description] %> <%= price_field.number_field :medium, class: "crayons-textfield", - value: SiteConfig.credit_prices_in_cents[:medium] %> + value: Settings::General.credit_prices_in_cents[:medium] %>
<%= admin_config_label "Credit price in cents (L)" %> - <%= admin_config_description Constants::SiteConfig::DETAILS[:credit_prices_in_cents][:large][:description] %> + <%= admin_config_description Constants::Settings::General::DETAILS[:credit_prices_in_cents][:large][:description] %> <%= price_field.number_field :large, class: "crayons-textfield", - value: SiteConfig.credit_prices_in_cents[:large] %> + value: Settings::General.credit_prices_in_cents[:large] %>
<%= admin_config_label "Credit price in cents (XL)" %> - <%= admin_config_description Constants::SiteConfig::DETAILS[:credit_prices_in_cents][:xlarge][:description] %> + <%= admin_config_description Constants::Settings::General::DETAILS[:credit_prices_in_cents][:xlarge][:description] %> <%= price_field.number_field :xlarge, class: "crayons-textfield", - value: SiteConfig.credit_prices_in_cents[:xlarge] %> + value: Settings::General.credit_prices_in_cents[:xlarge] %>
<% end %> @@ -584,7 +584,7 @@
<% end %> - <%= form_for(SiteConfig.new, url: admin_config_path) do |f| %> + <%= form_for(Settings::General.new, url: admin_config_path) do |f| %>
<%= render partial: "admin/shared/card_header", locals: { @@ -596,7 +596,7 @@
-
<% end %> - <%= form_for(SiteConfig.new, url: admin_config_path, html: { data: { testid: "emailDigestSectionForm" } }) do |f| %> + <%= form_for(Settings::General.new, url: admin_config_path, html: { data: { testid: "emailDigestSectionForm" } }) do |f| %>
<%= render partial: "admin/shared/card_header", locals: { @@ -635,11 +635,11 @@
<%= admin_config_label :periodic_email_digest %> - <%= admin_config_description Constants::SiteConfig::DETAILS[:periodic_email_digest][:description] %> + <%= admin_config_description Constants::Settings::General::DETAILS[:periodic_email_digest][:description] %> <%= f.number_field :periodic_email_digest, class: "crayons-textfield", - value: SiteConfig.periodic_email_digest, - placeholder: Constants::SiteConfig::DETAILS[:periodic_email_digest][:placeholder] %> + value: Settings::General.periodic_email_digest, + placeholder: Constants::Settings::General::DETAILS[:periodic_email_digest][:placeholder] %>
<%= render "form_submission", f: f %> @@ -648,7 +648,7 @@
<% end %> - <%= form_for(SiteConfig.new, url: admin_config_path) do |f| %> + <%= form_for(Settings::General.new, url: admin_config_path) do |f| %>
<%= render partial: "admin/shared/card_header", locals: { @@ -661,10 +661,10 @@
<%= admin_config_label :ga_tracking_id, "View ID" %> - <%= admin_config_description Constants::SiteConfig::DETAILS[:ga_tracking_id][:description] %> + <%= admin_config_description Constants::Settings::General::DETAILS[:ga_tracking_id][:description] %> <%= f.text_field :ga_tracking_id, class: "crayons-textfield", - value: SiteConfig.ga_tracking_id %> + value: Settings::General.ga_tracking_id %>
<%= render "form_submission", f: f %> @@ -673,7 +673,7 @@
<% end %> - <%= form_for(SiteConfig.new, url: admin_config_path) do |f| %> + <%= form_for(Settings::General.new, url: admin_config_path) do |f| %>
<%= render partial: "admin/shared/card_header", locals: { @@ -686,49 +686,49 @@
<%= admin_config_label :main_social_image %> - <%= admin_config_description Constants::SiteConfig::DETAILS[:main_social_image][:description] %> + <%= admin_config_description Constants::Settings::General::DETAILS[:main_social_image][:description] %> <%= f.text_field :main_social_image, class: "crayons-textfield", - value: SiteConfig.main_social_image, - placeholder: Constants::SiteConfig::DETAILS[:main_social_image][:placeholder] %> - <% if SiteConfig.main_social_image.present? %> - main social image + value: Settings::General.main_social_image, + placeholder: Constants::Settings::General::DETAILS[:main_social_image][:placeholder] %> + <% if Settings::General.main_social_image.present? %> + main social image <% end %>
<%= admin_config_label :favicon_url, "Favicon URL" %> - <%= admin_config_description Constants::SiteConfig::DETAILS[:favicon_url][:description] %> + <%= admin_config_description Constants::Settings::General::DETAILS[:favicon_url][:description] %> <%= f.text_field :favicon_url, class: "form-control", - value: SiteConfig.favicon_url, - placeholder: Constants::SiteConfig::DETAILS[:favicon_url][:placeholder] %> - favicon + value: Settings::General.favicon_url, + placeholder: Constants::Settings::General::DETAILS[:favicon_url][:placeholder] %> + favicon
<%= admin_config_label :logo_png %> - <%= admin_config_description Constants::SiteConfig::DETAILS[:logo_png][:description] %> + <%= admin_config_description Constants::Settings::General::DETAILS[:logo_png][:description] %> <%= f.text_field :logo_png, class: "crayons-textfield", - value: SiteConfig.logo_png, - placeholder: Constants::SiteConfig::DETAILS[:logo_png][:placeholder] %> - <% if SiteConfig.logo_png.present? %> - + value: Settings::General.logo_png, + placeholder: Constants::Settings::General::DETAILS[:logo_png][:placeholder] %> + <% if Settings::General.logo_png.present? %> + <% end %>
<%= admin_config_label :logo_svg %> - <%= admin_config_description Constants::SiteConfig::DETAILS[:logo_svg][:description] %> + <%= admin_config_description Constants::Settings::General::DETAILS[:logo_svg][:description] %> <%= f.text_area :logo_svg, class: "crayons-textfield", - value: SiteConfig.logo_svg, + value: Settings::General.logo_svg, rows: 6, - placeholder: Constants::SiteConfig::DETAILS[:logo_svg][:placeholder] %> - <% if SiteConfig.logo_svg.present? %> + placeholder: Constants::Settings::General::DETAILS[:logo_svg][:placeholder] %> + <% if Settings::General.logo_svg.present? %> <% end %>
@@ -739,7 +739,7 @@
<% end %> - <%= form_for(SiteConfig.new, url: admin_config_path, html: { data: { testid: "mascotSectionForm" } }) do |f| %> + <%= form_for(Settings::General.new, url: admin_config_path, html: { data: { testid: "mascotSectionForm" } }) do |f| %>
<%= render partial: "admin/shared/card_header", locals: { @@ -752,24 +752,24 @@
<%= admin_config_label :mascot_user_id, "Mascot user ID" %> - <%= admin_config_description Constants::SiteConfig::DETAILS[:mascot_user_id][:description] %> + <%= admin_config_description Constants::Settings::General::DETAILS[:mascot_user_id][:description] %> <%= f.text_field :mascot_user_id, class: "crayons-textfield", - value: SiteConfig.mascot_user_id, + value: Settings::General.mascot_user_id, min: 1, - placeholder: Constants::SiteConfig::DETAILS[:mascot_user_id][:placeholder] %> + placeholder: Constants::Settings::General::DETAILS[:mascot_user_id][:placeholder] %>
<%= admin_config_label :mascot_image_url, "Mascot Image URL" %> - <%= admin_config_description Constants::SiteConfig::DETAILS[:mascot_image_url][:description] %> + <%= admin_config_description Constants::Settings::General::DETAILS[:mascot_image_url][:description] %> <%= f.text_field :mascot_image_url, class: "crayons-textfield", - value: SiteConfig.mascot_image_url, - placeholder: Constants::SiteConfig::DETAILS[:mascot_image_url][:placeholder] %> + value: Settings::General.mascot_image_url, + placeholder: Constants::Settings::General::DETAILS[:mascot_image_url][:placeholder] %>
- Mascot image + Mascot image
@@ -779,7 +779,7 @@
<% end %> - <%= form_for(SiteConfig.new, url: admin_config_path) do |f| %> + <%= form_for(Settings::General.new, url: admin_config_path) do |f| %>
<%= render partial: "admin/shared/card_header", locals: { @@ -791,7 +791,7 @@
<%= f.fields_for :meta_keywords do |meta_keywords_field| %> - <% SiteConfig.meta_keywords.each do |area, keywords| %> + <% Settings::General.meta_keywords.each do |area, keywords| %>
<%= admin_config_label area.to_s %>

@@ -799,8 +799,8 @@

<%= meta_keywords_field.text_field area, class: "crayons-textfield", - value: SiteConfig.meta_keywords[area], - placeholder: Constants::SiteConfig::DETAILS[:meta_keywords][:placeholder] %> + value: Settings::General.meta_keywords[area], + placeholder: Constants::Settings::General::DETAILS[:meta_keywords][:placeholder] %>
<% end %> <% end %> @@ -811,7 +811,7 @@
<% end %> - <%= form_for(SiteConfig.new, url: admin_config_path) do |f| %> + <%= form_for(Settings::General.new, url: admin_config_path) do |f| %>
<%= render partial: "admin/shared/card_header", locals: { @@ -825,29 +825,29 @@
<%= admin_config_label :stripe_api_key, "Stripe API key" %> - <%= admin_config_description Constants::SiteConfig::DETAILS[:stripe_api_key][:description] %> + <%= admin_config_description Constants::Settings::General::DETAILS[:stripe_api_key][:description] %> <%= f.text_field :stripe_api_key, class: "crayons-textfield", - value: SiteConfig.stripe_api_key, - placeholder: Constants::SiteConfig::DETAILS[:stripe_api_key][:placeholder] %> + value: Settings::General.stripe_api_key, + placeholder: Constants::Settings::General::DETAILS[:stripe_api_key][:placeholder] %>
<%= admin_config_label :stripe_publishable_key %> - <%= admin_config_description Constants::SiteConfig::DETAILS[:stripe_publishable_key][:description] %> + <%= admin_config_description Constants::Settings::General::DETAILS[:stripe_publishable_key][:description] %> <%= f.text_field :stripe_publishable_key, class: "crayons-textfield", - value: SiteConfig.stripe_publishable_key, - placeholder: Constants::SiteConfig::DETAILS[:stripe_publishable_key][:placeholder] %> + value: Settings::General.stripe_publishable_key, + placeholder: Constants::Settings::General::DETAILS[:stripe_publishable_key][:placeholder] %>
<%= admin_config_label :payment_pointer %> - <%= admin_config_description Constants::SiteConfig::DETAILS[:payment_pointer][:description] %> + <%= admin_config_description Constants::Settings::General::DETAILS[:payment_pointer][:description] %> <%= f.text_field :payment_pointer, class: "crayons-textfield", - value: SiteConfig.payment_pointer, - placeholder: Constants::SiteConfig::DETAILS[:payment_pointer][:placeholder] %> + value: Settings::General.payment_pointer, + placeholder: Constants::Settings::General::DETAILS[:payment_pointer][:placeholder] %>
<%= render "form_submission", f: f %> @@ -856,7 +856,7 @@
<% end %> - <%= form_for(SiteConfig.new, url: admin_config_path) do |f| %> + <%= form_for(Settings::General.new, url: admin_config_path) do |f| %>
<%= render partial: "admin/shared/card_header", locals: { @@ -869,42 +869,42 @@
<%= admin_config_label :mailchimp_api_key, "Mailchimp API Key" %> - <%= admin_config_description Constants::SiteConfig::DETAILS[:mailchimp_api_key][:description] %> + <%= admin_config_description Constants::Settings::General::DETAILS[:mailchimp_api_key][:description] %> <%= f.text_field :mailchimp_api_key, class: "crayons-textfield", - value: SiteConfig.mailchimp_api_key %> + value: Settings::General.mailchimp_api_key %>
<%= admin_config_label :mailchimp_newsletter_id, "Main Newsletter" %> - <%= admin_config_description Constants::SiteConfig::DETAILS[:mailchimp_newsletter_id][:description] %> + <%= admin_config_description Constants::Settings::General::DETAILS[:mailchimp_newsletter_id][:description] %> <%= f.text_field :mailchimp_newsletter_id, class: "crayons-textfield", - value: SiteConfig.mailchimp_newsletter_id %> + value: Settings::General.mailchimp_newsletter_id %>
<%= admin_config_label :mailchimp_sustaining_members_id, "Sustaining Members Newsletter" %> - <%= admin_config_description Constants::SiteConfig::DETAILS[:mailchimp_sustaining_members_id][:description] %> + <%= admin_config_description Constants::Settings::General::DETAILS[:mailchimp_sustaining_members_id][:description] %> <%= f.text_field :mailchimp_sustaining_members_id, class: "crayons-textfield", - value: SiteConfig.mailchimp_sustaining_members_id %> + value: Settings::General.mailchimp_sustaining_members_id %>
<%= admin_config_label :mailchimp_tag_moderators_id, "Tag Moderators Newsletter" %> - <%= admin_config_description Constants::SiteConfig::DETAILS[:mailchimp_tag_moderators_id][:description] %> + <%= admin_config_description Constants::Settings::General::DETAILS[:mailchimp_tag_moderators_id][:description] %> <%= f.text_field :mailchimp_tag_moderators_id, class: "crayons-textfield", - value: SiteConfig.mailchimp_tag_moderators_id %> + value: Settings::General.mailchimp_tag_moderators_id %>
<%= admin_config_label :mailchimp_community_moderators_id, "Community Moderators Newsletter" %> - <%= admin_config_description Constants::SiteConfig::DETAILS[:mailchimp_community_moderators_id][:description] %> + <%= admin_config_description Constants::Settings::General::DETAILS[:mailchimp_community_moderators_id][:description] %> <%= f.text_field :mailchimp_community_moderators_id, class: "crayons-textfield", - value: SiteConfig.mailchimp_community_moderators_id %> + value: Settings::General.mailchimp_community_moderators_id %>
<%= render "form_submission", f: f %> @@ -913,7 +913,7 @@
<% end %> - <%= form_for(SiteConfig.new, url: admin_config_path) do |f| %> + <%= form_for(Settings::General.new, url: admin_config_path) do |f| %>
<%= render partial: "admin/shared/card_header", locals: { @@ -926,33 +926,33 @@
<%= admin_config_label :onboarding_background_image %> - <%= admin_config_description Constants::SiteConfig::DETAILS[:onboarding_background_image][:description] %> + <%= admin_config_description Constants::Settings::General::DETAILS[:onboarding_background_image][:description] %> <%= f.text_field :onboarding_background_image, class: "crayons-textfield", - value: SiteConfig.onboarding_background_image, - placeholder: Constants::SiteConfig::DETAILS[:onboarding_background_image][:placeholder] %> + value: Settings::General.onboarding_background_image, + placeholder: Constants::Settings::General::DETAILS[:onboarding_background_image][:placeholder] %>
- onboarding background image + onboarding background image
<%= admin_config_label :suggested_users %> - <%= admin_config_description Constants::SiteConfig::DETAILS[:suggested_users][:description] %> + <%= admin_config_description Constants::Settings::General::DETAILS[:suggested_users][:description] %> <%= f.text_field :suggested_users, class: "crayons-textfield", - value: SiteConfig.suggested_users.join(","), - placeholder: Constants::SiteConfig::DETAILS[:suggested_users][:placeholder] %> + value: Settings::General.suggested_users.join(","), + placeholder: Constants::Settings::General::DETAILS[:suggested_users][:placeholder] %>
- <%= f.check_box :prefer_manual_suggested_users, checked: SiteConfig.prefer_manual_suggested_users, class: "crayons-checkbox" %> + <%= f.check_box :prefer_manual_suggested_users, checked: Settings::General.prefer_manual_suggested_users, class: "crayons-checkbox" %>
<%= admin_config_label :prefer_manual_suggested_users %>

- <%= Constants::SiteConfig::DETAILS[:prefer_manual_suggested_users][:description] %> + <%= Constants::Settings::General::DETAILS[:prefer_manual_suggested_users][:description] %>

@@ -1011,7 +1011,7 @@
<% end %> - <%= form_for(SiteConfig.new, url: admin_config_path) do |f| %> + <%= form_for(Settings::General.new, url: admin_config_path) do |f| %>
<%= render partial: "admin/shared/card_header", locals: { @@ -1024,14 +1024,14 @@
<%= admin_config_label :twitter_hashtag %> - <%= admin_config_description Constants::SiteConfig::DETAILS[:twitter_hashtag][:description] %> + <%= admin_config_description Constants::Settings::General::DETAILS[:twitter_hashtag][:description] %> <%= f.text_field :twitter_hashtag, class: "crayons-textfield", - value: SiteConfig.twitter_hashtag.to_s, - placeholder: Constants::SiteConfig::DETAILS[:twitter_hashtag][:placeholder] %> + value: Settings::General.twitter_hashtag.to_s, + placeholder: Constants::Settings::General::DETAILS[:twitter_hashtag][:placeholder] %>
<%= f.fields_for :social_media_handles do |social_media_field| %> - <% SiteConfig.social_media_handles.each do |platform, username| %> + <% Settings::General.social_media_handles.each do |platform, username| %>
<%= admin_config_label platform %>

@@ -1039,7 +1039,7 @@

<%= social_media_field.text_field platform, class: "crayons-textfield", - value: SiteConfig.social_media_handles[platform], + value: Settings::General.social_media_handles[platform], placeholder: "" %>
<% end %> @@ -1051,7 +1051,7 @@
<% end %> - <%= form_for(SiteConfig.new, url: admin_config_path) do |f| %> + <%= form_for(Settings::General.new, url: admin_config_path) do |f| %>
<%= render partial: "admin/shared/card_header", locals: { @@ -1064,11 +1064,11 @@
<%= admin_config_label :sponsor_headline %> - <%= admin_config_description Constants::SiteConfig::DETAILS[:sponsor_headline][:description] %> + <%= admin_config_description Constants::Settings::General::DETAILS[:sponsor_headline][:description] %> <%= f.text_field :sponsor_headline, class: "crayons-textfield", - value: SiteConfig.sponsor_headline, - placeholder: Constants::SiteConfig::DETAILS[:sponsor_headline][:placeholder] %> + value: Settings::General.sponsor_headline, + placeholder: Constants::Settings::General::DETAILS[:sponsor_headline][:placeholder] %>
<%= render "form_submission", f: f %> @@ -1077,7 +1077,7 @@
<% end %> - <%= form_for(SiteConfig.new, url: admin_config_path) do |f| %> + <%= form_for(Settings::General.new, url: admin_config_path) do |f| %>
<%= render partial: "admin/shared/card_header", locals: { @@ -1090,11 +1090,11 @@
<%= admin_config_label :sidebar_tags %> - <%= admin_config_description Constants::SiteConfig::DETAILS[:sidebar_tags][:description] %> + <%= admin_config_description Constants::Settings::General::DETAILS[:sidebar_tags][:description] %> <%= f.text_field :sidebar_tags, class: "crayons-textfield", - value: SiteConfig.sidebar_tags.join(","), - placeholder: Constants::SiteConfig::DETAILS[:sidebar_tags][:placeholder], + value: Settings::General.sidebar_tags.join(","), + placeholder: Constants::Settings::General::DETAILS[:sidebar_tags][:placeholder], pattern: "[a-z0-9,]+" %>
diff --git a/app/views/admin/feedback_messages/_abuse_reports.html.erb b/app/views/admin/feedback_messages/_abuse_reports.html.erb index b3eecf806..956f31abb 100644 --- a/app/views/admin/feedback_messages/_abuse_reports.html.erb +++ b/app/views/admin/feedback_messages/_abuse_reports.html.erb @@ -31,7 +31,7 @@ data-reaction-url-value="<%= admin_reaction_path(reaction.id) %>"> 🤢 @<%= reaction.user.username %> - <% if reaction.user_id == SiteConfig.mascot_user_id %> + <% if reaction.user_id == Settings::General.mascot_user_id %> (auto-generated) <% end %> diff --git a/app/views/admin/users/_data_export.html.erb b/app/views/admin/users/_data_export.html.erb index 316c0f4bc..310bfaeae 100644 --- a/app/views/admin/users/_data_export.html.erb +++ b/app/views/admin/users/_data_export.html.erb @@ -12,7 +12,7 @@

Exporting the data to your admin account will send it to your contact - admin email (<%= SiteConfig.email_addresses[:contact] %>), + admin email (<%= Settings::General.email_addresses[:contact] %>), and exporting to the user will send it to their email (<%= @user.email %>).

diff --git a/app/views/api/v0/admin/configs/show.json.jbuilder b/app/views/api/v0/admin/configs/show.json.jbuilder index b6881c70c..a921d6c70 100644 --- a/app/views/api/v0/admin/configs/show.json.jbuilder +++ b/app/views/api/v0/admin/configs/show.json.jbuilder @@ -1,3 +1,3 @@ -@site_configs.each do |config| +@settings.each do |config| json.set! config.var, config.value end diff --git a/app/views/articles/_actions.html.erb b/app/views/articles/_actions.html.erb index 7e285306f..98cadd074 100644 --- a/app/views/articles/_actions.html.erb +++ b/app/views/articles/_actions.html.erb @@ -45,7 +45,7 @@ target="_blank" class="dropdown-link-row crayons-link crayons-link--block" rel="noopener" - href='https://twitter.com/intent/tweet?text="<%= u @article.title.strip %>" by <%= @article.user.twitter_username ? "@#{@article.user.twitter_username}" : @article.user.name %> <%= u SiteConfig.twitter_hashtag %> <%= article_url(@article) %>'> + href='https://twitter.com/intent/tweet?text="<%= u @article.title.strip %>" by <%= @article.user.twitter_username ? "@#{@article.user.twitter_username}" : @article.user.name %> <%= u Settings::General.twitter_hashtag %> <%= article_url(@article) %>'> Share to Twitter
px-1" id="sponsorship-widget">

- <%= SiteConfig.sponsor_headline %> + <%= Settings::General.sponsor_headline %> <%= inline_svg_tag("twemoji/heart.svg", aria: true, class: "crayons-icon crayons-icon--default ml-1", title: "Love") %>

diff --git a/app/views/articles/index.html.erb b/app/views/articles/index.html.erb index a26d01f83..1d052f6cc 100644 --- a/app/views/articles/index.html.erb +++ b/app/views/articles/index.html.erb @@ -12,14 +12,14 @@ - + - "> + "> - + <%= auto_discovery_link_tag(:rss, app_url("feed"), title: "#{community_name} RSS Feed") %> <% end %> diff --git a/app/views/articles/search/_meta.html.erb b/app/views/articles/search/_meta.html.erb index 4065dd3b1..94606da14 100644 --- a/app/views/articles/search/_meta.html.erb +++ b/app/views/articles/search/_meta.html.erb @@ -6,12 +6,12 @@ - + -"> +"> - + diff --git a/app/views/articles/show.html.erb b/app/views/articles/show.html.erb index 94e360f7c..1d31cfc40 100644 --- a/app/views/articles/show.html.erb +++ b/app/views/articles/show.html.erb @@ -66,7 +66,7 @@ " /> - "> + "> "> diff --git a/app/views/articles/tags/_meta.html.erb b/app/views/articles/tags/_meta.html.erb index 757131ed2..09000b2b7 100644 --- a/app/views/articles/tags/_meta.html.erb +++ b/app/views/articles/tags/_meta.html.erb @@ -14,7 +14,7 @@ -"> +"> @@ -24,7 +24,7 @@ <% else %> - - + + <% end %> diff --git a/app/views/collections/_meta.html.erb b/app/views/collections/_meta.html.erb index 692ce90a7..3c722fc62 100644 --- a/app/views/collections/_meta.html.erb +++ b/app/views/collections/_meta.html.erb @@ -6,12 +6,12 @@ " /> - + -"> +"> - + diff --git a/app/views/comments/_comment_avatar.html.erb b/app/views/comments/_comment_avatar.html.erb index bd9e77d2e..e60fa75ea 100644 --- a/app/views/comments/_comment_avatar.html.erb +++ b/app/views/comments/_comment_avatar.html.erb @@ -1,6 +1,6 @@ <% if comment.deleted %> - <%= image_tag(Images::Optimizer.call(SiteConfig.mascot_image_url, width: 32, height: 32, crop: "imagga_scale"), class: "crayons-avatar__image overflow-hidden", alt: "Sloan, the sloth mascot", loading: "lazy") %> + <%= image_tag(Images::Optimizer.call(Settings::General.mascot_image_url, width: 32, height: 32, crop: "imagga_scale"), class: "crayons-avatar__image overflow-hidden", alt: "Sloan, the sloth mascot", loading: "lazy") %> <% else %> diff --git a/app/views/comments/_form.html.erb b/app/views/comments/_form.html.erb index d279fdaed..9fe814e8f 100644 --- a/app/views/comments/_form.html.erb +++ b/app/views/comments/_form.html.erb @@ -29,7 +29,7 @@ <% end %> - pic + pic
diff --git a/app/views/comments/deleted_commentable_comment.html.erb b/app/views/comments/deleted_commentable_comment.html.erb index 795a9b2a1..210590862 100644 --- a/app/views/comments/deleted_commentable_comment.html.erb +++ b/app/views/comments/deleted_commentable_comment.html.erb @@ -14,7 +14,7 @@ <% if decorated_comment.low_quality %> <% end %> diff --git a/app/views/comments/index.html.erb b/app/views/comments/index.html.erb index 24046ae39..55959613a 100644 --- a/app/views/comments/index.html.erb +++ b/app/views/comments/index.html.erb @@ -13,7 +13,7 @@ " /> - "> + "> "> diff --git a/app/views/credits/new.html.erb b/app/views/credits/new.html.erb index ab3c6c967..54e2abfc5 100644 --- a/app/views/credits/new.html.erb +++ b/app/views/credits/new.html.erb @@ -154,7 +154,7 @@ changeSubmitButton({ text: 'Submitting...', active: false }) } - var stripe = Stripe('<%= SiteConfig.stripe_publishable_key %>'); + var stripe = Stripe('<%= Settings::General.stripe_publishable_key %>'); var elements = stripe.elements(); <% if current_user.decorate.dark_theme? %> diff --git a/app/views/dashboards/show.html.erb b/app/views/dashboards/show.html.erb index 86a642de2..3047a094f 100644 --- a/app/views/dashboards/show.html.erb +++ b/app/views/dashboards/show.html.erb @@ -55,8 +55,8 @@ <% else %>
- <% if SiteConfig.mascot_image_url.present? %> - <% image_url = Images::Optimizer.call(SiteConfig.mascot_image_url, width: 300, crop: "imagga_scale") %> + <% if Settings::General.mascot_image_url.present? %> + <% image_url = Images::Optimizer.call(Settings::General.mascot_image_url, width: 300, crop: "imagga_scale") %> <%= image_tag(image_url, class: "sloan mb-7", alt: "Mascot image") %> <% end %>

This is where you can manage your posts, but you haven't written anything yet.

diff --git a/app/views/deep_links/mobile.html.erb b/app/views/deep_links/mobile.html.erb index 1f8cce0ec..1e5de1e34 100644 --- a/app/views/deep_links/mobile.html.erb +++ b/app/views/deep_links/mobile.html.erb @@ -9,7 +9,7 @@ Whoops! Did you get stuck trying to open the mobile app?

- Make sure it's installed and try again. If the problem persists contact <%= SiteConfig.email_addresses[:contact] %> + Make sure it's installed and try again. If the problem persists contact <%= Settings::General.email_addresses[:contact] %>

diff --git a/app/views/events/_event.html.erb b/app/views/events/_event.html.erb index ca25494b7..08402e330 100644 --- a/app/views/events/_event.html.erb +++ b/app/views/events/_event.html.erb @@ -75,7 +75,7 @@ America/New_York <%= event.title %> <%= community_name %> - <%= SiteConfig.email_addresses[:members] %> + <%= Settings::General.email_addresses[:members] %> dev-event <%= event.location_url %> 15 diff --git a/app/views/events/index.html.erb b/app/views/events/index.html.erb index 645683331..1e78b3e7c 100644 --- a/app/views/events/index.html.erb +++ b/app/views/events/index.html.erb @@ -9,11 +9,11 @@ - + - "> + "> - + <% end %> diff --git a/app/views/events/show.html.erb b/app/views/events/show.html.erb index 57e0560d0..2871a51ca 100644 --- a/app/views/events/show.html.erb +++ b/app/views/events/show.html.erb @@ -10,19 +10,19 @@ <% if @event.cover_image.present? %> <% else %> - + <% end %> - "> + "> <% if @event.cover_image.present? %> <% else %> - + <% end %> <% end %> diff --git a/app/views/layouts/_logo.html.erb b/app/views/layouts/_logo.html.erb index a5484c446..22a1caac2 100644 --- a/app/views/layouts/_logo.html.erb +++ b/app/views/layouts/_logo.html.erb @@ -1,5 +1,5 @@