From 0d193ab75c6fefdab31dbfd820846ffacb230941 Mon Sep 17 00:00:00 2001 From: Michael Kohl Date: Tue, 15 Jun 2021 10:30:24 +0700 Subject: [PATCH] Refactor admin settings view into partials (#13950) * Reactor admin settings view into partials * Fix Stimulus problem * Add SMTP partial --- app/controllers/admin/settings_controller.rb | 4 + .../admin/settings/forms/_api_tokens.html.erb | 32 + .../settings/forms/_authentication.html.erb | 216 +++ .../admin/settings/forms/_campaign.html.erb | 89 ++ .../admin/settings/forms/_community.html.erb | 78 ++ .../admin/settings/forms/_credits.html.erb | 50 + .../forms/_email_digest_frequency.html.erb | 25 + .../admin/settings/forms/_emails.html.erb | 22 + .../settings/forms/_google_analytics.html.erb | 24 + .../admin/settings/forms/_images.html.erb | 65 + .../admin/settings/forms/_mandatory.html.erb | 57 + .../admin/settings/forms/_mascot.html.erb | 39 + .../settings/forms/_meta_keywords.html.erb | 31 + .../settings/forms/_monetization.html.erb | 44 + .../admin/settings/forms/_newsletter.html.erb | 56 + .../admin/settings/forms/_onboarding.html.erb | 49 + .../admin/settings/forms/_rate_limit.html.erb | 87 ++ app/views/admin/settings/forms/_smtp.html.erb | 22 + .../admin/settings/forms/_sponsors.html.erb | 25 + app/views/admin/settings/forms/_tags.html.erb | 26 + .../settings/forms/_user_experience.html.erb | 79 ++ .../_apple_auth_provider_settings.html.erb | 0 .../_auth_provider_settings.html.erb | 0 app/views/admin/settings/show.html.erb | 1154 +---------------- app/views/comments/_form.html.erb | 2 +- 25 files changed, 1141 insertions(+), 1135 deletions(-) create mode 100644 app/views/admin/settings/forms/_api_tokens.html.erb create mode 100644 app/views/admin/settings/forms/_authentication.html.erb create mode 100644 app/views/admin/settings/forms/_campaign.html.erb create mode 100644 app/views/admin/settings/forms/_community.html.erb create mode 100644 app/views/admin/settings/forms/_credits.html.erb create mode 100644 app/views/admin/settings/forms/_email_digest_frequency.html.erb create mode 100644 app/views/admin/settings/forms/_emails.html.erb create mode 100644 app/views/admin/settings/forms/_google_analytics.html.erb create mode 100644 app/views/admin/settings/forms/_images.html.erb create mode 100644 app/views/admin/settings/forms/_mandatory.html.erb create mode 100644 app/views/admin/settings/forms/_mascot.html.erb create mode 100644 app/views/admin/settings/forms/_meta_keywords.html.erb create mode 100644 app/views/admin/settings/forms/_monetization.html.erb create mode 100644 app/views/admin/settings/forms/_newsletter.html.erb create mode 100644 app/views/admin/settings/forms/_onboarding.html.erb create mode 100644 app/views/admin/settings/forms/_rate_limit.html.erb create mode 100644 app/views/admin/settings/forms/_smtp.html.erb create mode 100644 app/views/admin/settings/forms/_sponsors.html.erb create mode 100644 app/views/admin/settings/forms/_tags.html.erb create mode 100644 app/views/admin/settings/forms/_user_experience.html.erb rename app/views/admin/settings/{ => forms/authentication}/_apple_auth_provider_settings.html.erb (100%) rename app/views/admin/settings/{ => forms/authentication}/_auth_provider_settings.html.erb (100%) diff --git a/app/controllers/admin/settings_controller.rb b/app/controllers/admin/settings_controller.rb index b4bb604ae..e319e49ce 100644 --- a/app/controllers/admin/settings_controller.rb +++ b/app/controllers/admin/settings_controller.rb @@ -3,6 +3,10 @@ module Admin # /admin/customization/config. The actual updates get handled by the settings # controllers in the Admin::Settings namespace. class SettingsController < Admin::ApplicationController + # NOTE: The "show" action uses a lot of partials, this makes it easier to + # reference them. + prepend_view_path("app/views/admin/settings") + layout "admin" def show diff --git a/app/views/admin/settings/forms/_api_tokens.html.erb b/app/views/admin/settings/forms/_api_tokens.html.erb new file mode 100644 index 000000000..9a1cc2264 --- /dev/null +++ b/app/views/admin/settings/forms/_api_tokens.html.erb @@ -0,0 +1,32 @@ +<%= form_for(Settings::General.new, url: admin_settings_general_settings_path) do |f| %> +
+ <%= render partial: "admin/shared/card_header", + locals: { + header: "API Tokens", + state: "collapse", + target: "apiBodyContainer", + expanded: false + } %> +
+
+
+ <%= admin_config_label :health_check_token %> + <%= admin_config_description Constants::Settings::General::DETAILS[:health_check_token][:description] %> + <%= f.text_field :health_check_token, + class: "crayons-textfield", + 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::Settings::General::DETAILS[:video_encoder_key][:description] %> + <%= f.text_field :video_encoder_key, + class: "crayons-textfield", + value: Settings::General.video_encoder_key, + placeholder: Constants::Settings::General::DETAILS[:video_encoder_key][:placeholder] %> +
+ <%= render "form_submission", f: f %> +
+
+
+<% end %> diff --git a/app/views/admin/settings/forms/_authentication.html.erb b/app/views/admin/settings/forms/_authentication.html.erb new file mode 100644 index 000000000..073ac74bf --- /dev/null +++ b/app/views/admin/settings/forms/_authentication.html.erb @@ -0,0 +1,216 @@ +<%= form_for(Settings::Authentication.new, url: admin_settings_authentications_path, html: { data: { action: "submit->config#configUpdatePrecheck", "config-target": "authSectionForm", testid: "authSectionForm" } }) do |f| %> +
+ <%= render partial: "admin/shared/card_header", + locals: { + header: "Authentication", + state: "collapse", + target: "authenticationBodyContainer", + expanded: false + } %> +
+
+

+ General settings +

+
" + data-tooltip="Unchecking this will enable Email Registration"> + <%= f.check_box :invite_only_mode, + checked: invite_only_mode_or_no_enabled_auth_options, + data: { action: "config#adjustAuthenticationOptions", "config-target": "inviteOnlyMode" }, + class: "crayons-checkbox" %> +
+ <%= admin_config_label :invite_only_mode, "Invite-only mode", model: Settings::Authentication %> + <%= admin_config_description Constants::Settings::Authentication::DETAILS[:invite_only_mode][:description] %> +
+
+
+
+
+

+ Registration options +

+

+ How can people create an account on your community? +

+
+ +
+
+ <%= inline_svg_tag("email.svg", class: "crayons-icon", aria: true, title: "Email icon") %> +
+
+
+ +
+

"> + Email address +

+
" + data-config-target="enabledIndicator"> + <%= inline_svg_tag("checkmark.svg", aria: true, class: "crayons-icon admin-config-checkmark", title: "Email enabled") %> + Enabled +
+
+ + + +
+ +
+
+
+ +
+
+ <%= f.text_field :auth_providers_to_enable, + id: "auth_providers_to_enable", + class: "form-control hidden", + value: Settings::Authentication.providers.join(","), + readonly: true %> +
+ <% authentication_available_providers.each do |provider| %> + <% next if provider.provider_name == :apple && !Flipper.enabled?(:apple_auth) %> +
+
+ <%= inline_svg_tag("#{provider.provider_name}.svg", class: "crayons-icon", aria: true, title: "#{provider.official_name} logo") %> +
+
+
+
+

"> + <%= provider.official_name %> +

+
"> + <%= inline_svg_tag("checkmark.svg", aria: true, class: "crayons-icon admin-config-checkmark", title: "#{provider.official_name} enabled") %> + Enabled +
+
+ +
+ +
+
+
+ <% end %> +
+
+
+ Changing authentication keys will not take effect until this Forem instance is restarted. +
+ + <%= render "form_submission", f: f %> +
+
+<% end %> +
diff --git a/app/views/admin/settings/forms/_campaign.html.erb b/app/views/admin/settings/forms/_campaign.html.erb new file mode 100644 index 000000000..531067860 --- /dev/null +++ b/app/views/admin/settings/forms/_campaign.html.erb @@ -0,0 +1,89 @@ +<%= form_for(Settings::Campaign.new, url: admin_settings_campaigns_path) do |f| %> +
+ <%= render partial: "admin/shared/card_header", + locals: { + header: "Campaign", + state: "collapse", + target: "campaignBodyContainer", + expanded: false + } %> +
+
+
+ <%= admin_config_label :hero_html_variant_name, "Campaign hero HTML variant name" %> + <%= admin_config_description Constants::Settings::Campaign::DETAILS[:hero_html_variant_name][:description] %> + <%= f.text_field :hero_html_variant_name, + class: "crayons-textfield", + value: Settings::Campaign.hero_html_variant_name, + placeholder: Constants::Settings::Campaign::DETAILS[:hero_html_variant_name][:placeholder] %> +
+ +
+ <%= f.check_box :articles_require_approval, checked: Settings::Campaign.articles_require_approval, class: "crayons-checkbox" %> + <%= admin_config_label :articles_require_approval %> + <%= admin_config_description Constants::Settings::Campaign::DETAILS[:articles_require_approval][:description] %> +
+ +
+ <%= f.check_box :sidebar_enabled, checked: Settings::Campaign.sidebar_enabled, class: "crayons-checkbox" %> + <%= admin_config_label :sidebar_enabled %> + <%= admin_config_description Constants::Settings::Campaign::DETAILS[:sidebar_enabled][:description] %> +
+ +
+ <%= admin_config_label :sidebar_image %> + <%= admin_config_description Constants::Settings::Campaign::DETAILS[:sidebar_image][:description] %> + <% if Settings::Campaign.sidebar_image.present? %> +
+
+ Campaign sidebar image +
+
+ <% end %> + <%= f.text_field :sidebar_image, + class: "crayons-textfield", + value: Settings::Campaign.sidebar_image, + placeholder: Constants::Settings::Campaign::DETAILS[:sidebar_image][:placeholder] %> +
+ +
+ <%= admin_config_label :url, "Campaign URL" %> + <%= admin_config_description Constants::Settings::Campaign::DETAILS[:url][:description] %> + <%= f.text_field :url, + class: "crayons-textfield", + value: Settings::Campaign.url, + placeholder: Constants::Settings::Campaign::DETAILS[:url][:placeholder] %> +
+ +
+ <%= admin_config_label :featured_tags %> + <%= admin_config_description Constants::Settings::Campaign::DETAILS[:featured_tags][:description] %> + <%= f.text_field :featured_tags, + class: "crayons-textfield", + value: Settings::Campaign.featured_tags.join(","), + placeholder: Constants::Settings::Campaign::DETAILS[:featured_tags][:placeholder] %> +
+ +
+ <%= admin_config_label :call_to_action, "Campaign Call to Action" %> + <%= admin_config_description Constants::Settings::Campaign::DETAILS[:call_to_action][:description] %> + <%= f.text_field :call_to_action, + class: "crayons-textfield", + value: Settings::Campaign.call_to_action, + placeholder: Constants::Settings::Campaign::DETAILS[:call_to_action][:placeholder] %> +
+ +
+ <%= admin_config_label :articles_expiry_time, "Campaign article expiry time" %> + <%= admin_config_description Constants::Settings::Campaign::DETAILS[:articles_expiry_time][:description] %> + <%= f.number_field :articles_expiry_time, + class: "crayons-textfield", + value: Settings::Campaign.articles_expiry_time, + placeholder: Constants::Settings::Campaign::DETAILS[:articles_expiry_time][:placeholder] %> +
+ + <%= render "form_submission", f: f %> +
+
+
+<% end %> diff --git a/app/views/admin/settings/forms/_community.html.erb b/app/views/admin/settings/forms/_community.html.erb new file mode 100644 index 000000000..1d1253ad5 --- /dev/null +++ b/app/views/admin/settings/forms/_community.html.erb @@ -0,0 +1,78 @@ +<%= form_for(Settings::Community.new, url: admin_settings_communities_path) do |f| %> +
+ <%= render partial: "admin/shared/card_header", + locals: { + header: "Community Content", + state: "collapse", + target: "contentBodyContainer", + expanded: false + } %> +
+
+
+ <%= admin_config_label :community_name, model: Settings::Community %> + <%= admin_config_description Constants::Settings::Community::DETAILS[:community_name][:description] %> + <%= f.text_field :community_name, + class: "crayons-textfield", + value: Settings::Community.community_name, + placeholder: Constants::Settings::Community::DETAILS[:community_name][:placeholder] %> +
+ +
+ <%= admin_config_label :community_emoji, model: Settings::Community %> + <%= admin_config_description Constants::Settings::Community::DETAILS[:community_emoji][:description] %> + <%= f.text_field :community_emoji, + class: "crayons-textfield", + value: Settings::Community.community_emoji, + placeholder: Constants::Settings::Community::DETAILS[:community_emoji][:placeholder] %> +
+ +
+ <%= admin_config_label :tagline, model: Settings::Community %> + <%= admin_config_description Constants::Settings::Community::DETAILS[:tagline][:description] %> + <%= f.text_field :tagline, + class: "crayons-textfield", + value: Settings::Community.tagline, + placeholder: Constants::Settings::Community::DETAILS[:tagline][:placeholder] %> +
+ +
+ <%= admin_config_label :community_description, model: Settings::Community %> + <%= admin_config_description Constants::Settings::Community::DETAILS[:community_description][:description] %> + <%= f.text_field :community_description, + class: "crayons-textfield", + value: Settings::Community.community_description, + placeholder: Constants::Settings::Community::DETAILS[:community_description][:placeholder] %> +
+ +
+ <%= admin_config_label :member_label, model: Settings::Community %> + <%= admin_config_description Constants::Settings::Community::DETAILS[:member_label][:description] %> + <%= f.text_field :member_label, + class: "crayons-textfield", + value: Settings::Community.member_label, + placeholder: Constants::Settings::Community::DETAILS[:member_label][:placeholder] %> +
+ +
+ <%= admin_config_label :copyright_start_year, model: Settings::Community %> + <%= admin_config_description Constants::Settings::Community::DETAILS[:copyright_start_year][:description] %> + <%= f.text_field :copyright_start_year, + class: "crayons-textfield", + value: Settings::Community.copyright_start_year, + placeholder: Constants::Settings::Community::DETAILS[:copyright_start_year][:placeholder] %> +
+ +
+ <%= admin_config_label :staff_user_id, model: Settings::Community %> + <%= admin_config_description Constants::Settings::Community::DETAILS[:staff_user_id][:description] %> + <%= f.text_field :staff_user_id, + class: "crayons-textfield", + value: Settings::Community.staff_user_id, + placeholder: Constants::Settings::Community::DETAILS[:staff_user_id][:placeholder] %> +
+ <%= render "form_submission", f: f %> +
+
+
+<% end %> diff --git a/app/views/admin/settings/forms/_credits.html.erb b/app/views/admin/settings/forms/_credits.html.erb new file mode 100644 index 000000000..531b948a7 --- /dev/null +++ b/app/views/admin/settings/forms/_credits.html.erb @@ -0,0 +1,50 @@ +<%= form_for(Settings::General.new, url: admin_settings_general_settings_path) do |f| %> +
+ <%= render partial: "admin/shared/card_header", + locals: { + header: "Credits", + state: "collapse", + target: "creditsBodyContainer", + expanded: false + } %> + +
+
+ <%= f.fields_for :credit_prices_in_cents do |price_field| %> +
+ <%= admin_config_label "Credit price in cents (S)" %> + <%= admin_config_description Constants::Settings::General::DETAILS[:credit_prices_in_cents][:small][:description] %> + <%= price_field.number_field :small, + class: "crayons-textfield", + value: Settings::General.credit_prices_in_cents[:small] %> +
+ +
+ <%= admin_config_label "Credit price in cents (M)" %> + <%= admin_config_description Constants::Settings::General::DETAILS[:credit_prices_in_cents][:medium][:description] %> + <%= price_field.number_field :medium, + class: "crayons-textfield", + value: Settings::General.credit_prices_in_cents[:medium] %> +
+
+ <%= admin_config_label "Credit price in cents (L)" %> + <%= admin_config_description Constants::Settings::General::DETAILS[:credit_prices_in_cents][:large][:description] %> + <%= price_field.number_field :large, + class: "crayons-textfield", + value: Settings::General.credit_prices_in_cents[:large] %> +
+ +
+ <%= admin_config_label "Credit price in cents (XL)" %> + <%= admin_config_description Constants::Settings::General::DETAILS[:credit_prices_in_cents][:xlarge][:description] %> + <%= price_field.number_field :xlarge, + class: "crayons-textfield", + value: Settings::General.credit_prices_in_cents[:xlarge] %> +
+ <% end %> + + <%= render "form_submission", f: f %> +
+
+
+<% end %> diff --git a/app/views/admin/settings/forms/_email_digest_frequency.html.erb b/app/views/admin/settings/forms/_email_digest_frequency.html.erb new file mode 100644 index 000000000..780616d28 --- /dev/null +++ b/app/views/admin/settings/forms/_email_digest_frequency.html.erb @@ -0,0 +1,25 @@ +<%= form_for(Settings::General.new, url: admin_settings_general_settings_path, html: { data: { testid: "emailDigestSectionForm" } }) do |f| %> +
+ <%= render partial: "admin/shared/card_header", + locals: { + header: "Email digest frequency", + state: "collapse", + target: "emailDigestBodyContainer", + expanded: false + } %> +
+
+
+ <%= admin_config_label :periodic_email_digest %> + <%= admin_config_description Constants::Settings::General::DETAILS[:periodic_email_digest][:description] %> + <%= f.number_field :periodic_email_digest, + class: "crayons-textfield", + value: Settings::General.periodic_email_digest, + placeholder: Constants::Settings::General::DETAILS[:periodic_email_digest][:placeholder] %> +
+ + <%= render "form_submission", f: f %> +
+
+
+<% end %> diff --git a/app/views/admin/settings/forms/_emails.html.erb b/app/views/admin/settings/forms/_emails.html.erb new file mode 100644 index 000000000..aef8a2398 --- /dev/null +++ b/app/views/admin/settings/forms/_emails.html.erb @@ -0,0 +1,22 @@ +
+ <%= render partial: "admin/shared/card_header", + locals: { + header: "Emails", + state: "collapse", + target: "emailBodyContainer", + expanded: false + } %> +
+
+
+ +
+ Default (set via default_email environment variable) +
+ +
+
+
+
diff --git a/app/views/admin/settings/forms/_google_analytics.html.erb b/app/views/admin/settings/forms/_google_analytics.html.erb new file mode 100644 index 000000000..dae0d53d4 --- /dev/null +++ b/app/views/admin/settings/forms/_google_analytics.html.erb @@ -0,0 +1,24 @@ +<%= form_for(Settings::General.new, url: admin_settings_general_settings_path) do |f| %> +
+ <%= render partial: "admin/shared/card_header", + locals: { + header: "Google Analytics", + state: "collapse", + target: "gaBodyContainer", + expanded: false + } %> +
+
+
+ <%= admin_config_label :ga_tracking_id, "View ID" %> + <%= admin_config_description Constants::Settings::General::DETAILS[:ga_tracking_id][:description] %> + <%= f.text_field :ga_tracking_id, + class: "crayons-textfield", + value: Settings::General.ga_tracking_id %> +
+ + <%= render "form_submission", f: f %> +
+
+
+<% end %> diff --git a/app/views/admin/settings/forms/_images.html.erb b/app/views/admin/settings/forms/_images.html.erb new file mode 100644 index 000000000..b7ea21091 --- /dev/null +++ b/app/views/admin/settings/forms/_images.html.erb @@ -0,0 +1,65 @@ +<%= form_for(Settings::General.new, url: admin_settings_general_settings_path) do |f| %> +
+ <%= render partial: "admin/shared/card_header", + locals: { + header: "Images", + state: "collapse", + target: "imagesBodyContainer", + expanded: false + } %> +
+
+
+ <%= admin_config_label :main_social_image %> + <%= admin_config_description Constants::Settings::General::DETAILS[:main_social_image][:description] %> + <%= f.text_field :main_social_image, + class: "crayons-textfield", + 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::Settings::General::DETAILS[:favicon_url][:description] %> + <%= f.text_field :favicon_url, + class: "form-control", + value: Settings::General.favicon_url, + placeholder: Constants::Settings::General::DETAILS[:favicon_url][:placeholder] %> + favicon +
+ +
+ <%= admin_config_label :logo_png %> + <%= admin_config_description Constants::Settings::General::DETAILS[:logo_png][:description] %> + <%= f.text_field :logo_png, + class: "crayons-textfield", + 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::Settings::General::DETAILS[:logo_svg][:description] %> + <%= f.text_area :logo_svg, + class: "crayons-textfield", + value: Settings::General.logo_svg, + rows: 6, + placeholder: Constants::Settings::General::DETAILS[:logo_svg][:placeholder] %> + <% if Settings::General.logo_svg.present? %> + + <% end %> +
+ + <%= render "form_submission", f: f %> +
+
+
+<% end %> diff --git a/app/views/admin/settings/forms/_mandatory.html.erb b/app/views/admin/settings/forms/_mandatory.html.erb new file mode 100644 index 000000000..1b7a370cb --- /dev/null +++ b/app/views/admin/settings/forms/_mandatory.html.erb @@ -0,0 +1,57 @@ +<%= form_with(url: admin_settings_mandatory_settings_path, local: true, data: { testid: "getStartedSectionForm" }) do |f| %> +
+ + <% Settings::Mandatory::MAPPINGS.each do |config_key, settings_model| %> + <%# we need to list the config as separate fields if the data structure is a Hash %> + <% placeholder_module = Constants.const_get(settings_model.name) %> + <% if settings_model.public_send(config_key).is_a?(Hash) %> + <%= admin_config_label config_key.to_s %> +
+ <%= f.fields_for config_key do |a_field| %> + <% settings_model.public_send(config_key).each do |key, value| %> +
+ <%= admin_config_label key.to_s %> + <%= admin_config_description "#{key} #{config_key.to_s.tr! '_', ' '}" %> + <%= a_field.text_field key, + class: "crayons-textfield", + value: settings_model.public_send(config_key)[key], + placeholder: placeholder_module::DETAILS[config_key][:placeholder] %> +
+ <% end %> + <% end %> +
+ <% elsif settings_model.public_send(config_key).is_a?(Array) %> +
+ <%= admin_config_label config_key %> + <%= admin_config_description placeholder_module::DETAILS[config_key][:description] %> + <%= f.text_field config_key, + class: "crayons-textfield", + value: settings_model.public_send(config_key).join(","), + placeholder: placeholder_module::DETAILS[config_key][:placeholder] %> +
+ <% else %> +
+ <%= admin_config_label config_key %> + <%= admin_config_description placeholder_module::DETAILS[config_key][:description] %> + <%= f.text_field config_key, + class: "form-control", + value: settings_model.public_send(config_key), + placeholder: placeholder_module::DETAILS[config_key][:placeholder] %> +
+ <% end %> + <% end %> + + <% if current_user.has_role?(:super_admin) %> +
+
+ <%= label_tag :confirmation_update, "Confirmation update", class: "crayons-field__label" %> +

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 Settings", class: "crayons-btn align-self-start" %> +
+
+
+ <% end %> +
+<% end %> diff --git a/app/views/admin/settings/forms/_mascot.html.erb b/app/views/admin/settings/forms/_mascot.html.erb new file mode 100644 index 000000000..7269d63fa --- /dev/null +++ b/app/views/admin/settings/forms/_mascot.html.erb @@ -0,0 +1,39 @@ +<%= form_for(Settings::General.new, url: admin_settings_general_settings_path, html: { data: { testid: "mascotSectionForm" } }) do |f| %> +
+ <%= render partial: "admin/shared/card_header", + locals: { + header: "Mascot", + state: "collapse", + target: "mascotBodyContainer", + expanded: false + } %> +
+
+
+ <%= admin_config_label :mascot_user_id, "Mascot user ID" %> + <%= admin_config_description Constants::Settings::General::DETAILS[:mascot_user_id][:description] %> + <%= f.text_field :mascot_user_id, + class: "crayons-textfield", + value: Settings::General.mascot_user_id, + min: 1, + placeholder: Constants::Settings::General::DETAILS[:mascot_user_id][:placeholder] %> +
+ +
+ <%= admin_config_label :mascot_image_url, "Mascot Image URL" %> + <%= admin_config_description Constants::Settings::General::DETAILS[:mascot_image_url][:description] %> + <%= f.text_field :mascot_image_url, + class: "crayons-textfield", + value: Settings::General.mascot_image_url, + placeholder: Constants::Settings::General::DETAILS[:mascot_image_url][:placeholder] %> + +
+ Mascot image +
+ +
+ <%= render "form_submission", f: f %> +
+
+
+<% end %> diff --git a/app/views/admin/settings/forms/_meta_keywords.html.erb b/app/views/admin/settings/forms/_meta_keywords.html.erb new file mode 100644 index 000000000..3d56f6a8d --- /dev/null +++ b/app/views/admin/settings/forms/_meta_keywords.html.erb @@ -0,0 +1,31 @@ +<%= form_for(Settings::General.new, url: admin_settings_general_settings_path) do |f| %> +
+ <%= render partial: "admin/shared/card_header", + locals: { + header: "Meta Keywords", + state: "collapse", + target: "metaKeywordsBodyContainer", + expanded: false + } %> +
+
+ <%= f.fields_for :meta_keywords do |meta_keywords_field| %> + <% Settings::General.meta_keywords.each do |area, keywords| %> +
+ <%= admin_config_label area.to_s %> +

+ <%= area.capitalize %><%= "page" unless area == "default" %> keywords +

+ <%= meta_keywords_field.text_field area, + class: "crayons-textfield", + value: Settings::General.meta_keywords[area], + placeholder: Constants::Settings::General::DETAILS[:meta_keywords][:placeholder] %> +
+ <% end %> + <% end %> + + <%= render "form_submission", f: f %> +
+
+
+<% end %> diff --git a/app/views/admin/settings/forms/_monetization.html.erb b/app/views/admin/settings/forms/_monetization.html.erb new file mode 100644 index 000000000..8d8545fdd --- /dev/null +++ b/app/views/admin/settings/forms/_monetization.html.erb @@ -0,0 +1,44 @@ +<%= form_for(Settings::General.new, url: admin_settings_general_settings_path) do |f| %> +
+ <%= render partial: "admin/shared/card_header", + locals: { + header: "Monetization", + state: "collapse", + target: "monetizationBodyContainer", + expanded: false + } %> +
+
+ +
+ <%= admin_config_label :stripe_api_key, "Stripe API key" %> + <%= admin_config_description Constants::Settings::General::DETAILS[:stripe_api_key][:description] %> + <%= f.text_field :stripe_api_key, + class: "crayons-textfield", + 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::Settings::General::DETAILS[:stripe_publishable_key][:description] %> + <%= f.text_field :stripe_publishable_key, + class: "crayons-textfield", + value: Settings::General.stripe_publishable_key, + placeholder: Constants::Settings::General::DETAILS[:stripe_publishable_key][:placeholder] %> +
+ +
+ <%= admin_config_label :payment_pointer %> + <%= admin_config_description Constants::Settings::General::DETAILS[:payment_pointer][:description] %> + <%= f.text_field :payment_pointer, + class: "crayons-textfield", + value: Settings::General.payment_pointer, + placeholder: Constants::Settings::General::DETAILS[:payment_pointer][:placeholder] %> +
+ + <%= render "form_submission", f: f %> +
+
+
+<% end %> diff --git a/app/views/admin/settings/forms/_newsletter.html.erb b/app/views/admin/settings/forms/_newsletter.html.erb new file mode 100644 index 000000000..efa6e3769 --- /dev/null +++ b/app/views/admin/settings/forms/_newsletter.html.erb @@ -0,0 +1,56 @@ +<%= form_for(Settings::General.new, url: admin_settings_general_settings_path) do |f| %> +
+ <%= render partial: "admin/shared/card_header", + locals: { + header: "Newsletter", + state: "collapse", + target: "newsletterBodyContainer", + expanded: false + } %> +
+
+
+ <%= admin_config_label :mailchimp_api_key, "Mailchimp API Key" %> + <%= admin_config_description Constants::Settings::General::DETAILS[:mailchimp_api_key][:description] %> + <%= f.text_field :mailchimp_api_key, + class: "crayons-textfield", + value: Settings::General.mailchimp_api_key %> +
+ +
+ <%= admin_config_label :mailchimp_newsletter_id, "Main Newsletter" %> + <%= admin_config_description Constants::Settings::General::DETAILS[:mailchimp_newsletter_id][:description] %> + <%= f.text_field :mailchimp_newsletter_id, + class: "crayons-textfield", + value: Settings::General.mailchimp_newsletter_id %> +
+ +
+ <%= admin_config_label :mailchimp_sustaining_members_id, "Sustaining Members Newsletter" %> + <%= admin_config_description Constants::Settings::General::DETAILS[:mailchimp_sustaining_members_id][:description] %> + <%= f.text_field :mailchimp_sustaining_members_id, + class: "crayons-textfield", + value: Settings::General.mailchimp_sustaining_members_id %> +
+ +
+ <%= admin_config_label :mailchimp_tag_moderators_id, "Tag Moderators Newsletter" %> + <%= admin_config_description Constants::Settings::General::DETAILS[:mailchimp_tag_moderators_id][:description] %> + <%= f.text_field :mailchimp_tag_moderators_id, + class: "crayons-textfield", + value: Settings::General.mailchimp_tag_moderators_id %> +
+ +
+ <%= admin_config_label :mailchimp_community_moderators_id, "Community Moderators Newsletter" %> + <%= admin_config_description Constants::Settings::General::DETAILS[:mailchimp_community_moderators_id][:description] %> + <%= f.text_field :mailchimp_community_moderators_id, + class: "crayons-textfield", + value: Settings::General.mailchimp_community_moderators_id %> +
+ + <%= render "form_submission", f: f %> +
+
+
+<% end %> diff --git a/app/views/admin/settings/forms/_onboarding.html.erb b/app/views/admin/settings/forms/_onboarding.html.erb new file mode 100644 index 000000000..fa2747bd5 --- /dev/null +++ b/app/views/admin/settings/forms/_onboarding.html.erb @@ -0,0 +1,49 @@ +<%= form_for(Settings::General.new, url: admin_settings_general_settings_path) do |f| %> +
+ <%= render partial: "admin/shared/card_header", + locals: { + header: "Onboarding", + state: "collapse", + target: "onboardingBodyContainer", + expanded: false + } %> +
+
+
+ <%= admin_config_label :onboarding_background_image %> + <%= admin_config_description Constants::Settings::General::DETAILS[:onboarding_background_image][:description] %> + <%= f.text_field :onboarding_background_image, + class: "crayons-textfield", + value: Settings::General.onboarding_background_image, + placeholder: Constants::Settings::General::DETAILS[:onboarding_background_image][:placeholder] %> +
+
+ onboarding background image +
+
+
+ +
+ <%= admin_config_label :suggested_users %> + <%= admin_config_description Constants::Settings::General::DETAILS[:suggested_users][:description] %> + <%= f.text_field :suggested_users, + class: "crayons-textfield", + value: Settings::General.suggested_users.join(","), + placeholder: Constants::Settings::General::DETAILS[:suggested_users][:placeholder] %> +
+ +
+ <%= 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::Settings::General::DETAILS[:prefer_manual_suggested_users][:description] %> +

+
+
+ + <%= render "form_submission", f: f %> +
+
+
+<% end %> diff --git a/app/views/admin/settings/forms/_rate_limit.html.erb b/app/views/admin/settings/forms/_rate_limit.html.erb new file mode 100644 index 000000000..c3f925e36 --- /dev/null +++ b/app/views/admin/settings/forms/_rate_limit.html.erb @@ -0,0 +1,87 @@ +<%= form_for(Settings::RateLimit.new, url: admin_settings_rate_limits_path) do |f| %> +
+ <%= render partial: "admin/shared/card_header", + locals: { + header: "Rate limits and anti-spam", + state: "collapse", + target: "rateLimitsBodyContainer", + expanded: false + } %> +
+
+
+ <%= admin_config_label :user_considered_new_days, model: Settings::RateLimit %> + <%= admin_config_description Constants::Settings::RateLimit::DETAILS[:user_considered_new_days][:description] %> + <%= f.number_field :user_considered_new_days, + class: "crayons-textfield", + value: Settings::RateLimit.user_considered_new_days, + placeholder: Constants::Settings::RateLimit::DETAILS[:user_considered_new_days][:placeholder] %> +
+ + <% configurable_rate_limits.each do |key, field_hash| %> +
+ <%= admin_config_label field_hash[:title], model: Settings::RateLimit %> +

+ <%= field_hash[:description] %> +

+ <%= f.number_field key, + class: "crayons-textfield", + value: Settings::RateLimit.public_send(key), + min: field_hash[:min], + placeholder: field_hash[:placeholder] %> +
+ <% end %> + +
+ <%= admin_config_label :spam_trigger_terms, model: Settings::RateLimit %> + <%= admin_config_description Constants::Settings::RateLimit::DETAILS[:spam_trigger_terms][:description] %> + <%= f.text_area :spam_trigger_terms, + class: "crayons-textfield", + value: Settings::RateLimit.spam_trigger_terms.join(","), + placeholder: Constants::Settings::RateLimit::DETAILS[:spam_trigger_terms][:placeholder] %> +
+ <%= render "form_submission", f: f %> +
+
+
+<% end %> + +<%= form_for(Settings::General.new, url: admin_settings_general_settings_path) do |f| %> +
+ <%= render partial: "admin/shared/card_header", + locals: { + header: "Social Media", + state: "collapse", + target: "socialMediaBodyContainer", + expanded: false + } %> +
+
+
+ <%= admin_config_label :twitter_hashtag %> + <%= admin_config_description Constants::Settings::General::DETAILS[:twitter_hashtag][:description] %> + <%= f.text_field :twitter_hashtag, + class: "crayons-textfield", + 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| %> + <% Settings::General.social_media_handles.each do |platform, username| %> +
+ <%= admin_config_label platform %> +

+ <%= platform.capitalize %> username +

+ <%= social_media_field.text_field platform, + class: "crayons-textfield", + value: Settings::General.social_media_handles[platform], + placeholder: "" %> +
+ <% end %> + <% end %> + + <%= render "form_submission", f: f %> +
+
+
+<% end %> diff --git a/app/views/admin/settings/forms/_smtp.html.erb b/app/views/admin/settings/forms/_smtp.html.erb new file mode 100644 index 000000000..ba642444b --- /dev/null +++ b/app/views/admin/settings/forms/_smtp.html.erb @@ -0,0 +1,22 @@ +<%= form_for(Settings::SMTP.new, url: admin_settings_smtp_settings_path) do |f| %> +
+ <%= render partial: "admin/shared/card_header", + locals: { header: "SMTP Settings", state: "collapse", target: "smtpSettingsBodyContainer", expanded: false } %> +
+
+ <% Settings::SMTP::OPTIONS.each do |config_key| %> +
+ <%= admin_config_label config_key %> + <%= admin_config_description Constants::Settings::SMTP::DETAILS[config_key][:description] %> + <%= f.text_field config_key, + class: "crayons-textfield", + value: Settings::SMTP.public_send(config_key), + placeholder: Constants::Settings::SMTP::DETAILS[config_key][:placeholder] %> + +
+ <% end %> + <%= render "form_submission", f: f %> +
+
+
+<% end %> diff --git a/app/views/admin/settings/forms/_sponsors.html.erb b/app/views/admin/settings/forms/_sponsors.html.erb new file mode 100644 index 000000000..286e2c621 --- /dev/null +++ b/app/views/admin/settings/forms/_sponsors.html.erb @@ -0,0 +1,25 @@ +<%= form_for(Settings::General.new, url: admin_settings_general_settings_path) do |f| %> +
+ <%= render partial: "admin/shared/card_header", + locals: { + header: "Sponsors", + state: "collapse", + target: "sponsorsContainer", + expanded: false + } %> +
+
+
+ <%= admin_config_label :sponsor_headline %> + <%= admin_config_description Constants::Settings::General::DETAILS[:sponsor_headline][:description] %> + <%= f.text_field :sponsor_headline, + class: "crayons-textfield", + value: Settings::General.sponsor_headline, + placeholder: Constants::Settings::General::DETAILS[:sponsor_headline][:placeholder] %> +
+ + <%= render "form_submission", f: f %> +
+
+
+<% end %> diff --git a/app/views/admin/settings/forms/_tags.html.erb b/app/views/admin/settings/forms/_tags.html.erb new file mode 100644 index 000000000..47ce0be73 --- /dev/null +++ b/app/views/admin/settings/forms/_tags.html.erb @@ -0,0 +1,26 @@ +<%= form_for(Settings::General.new, url: admin_settings_general_settings_path) do |f| %> +
+ <%= render partial: "admin/shared/card_header", + locals: { + header: "Tags", + state: "collapse", + target: "tagsBodyContainer", + expanded: false + } %> +
+
+
+ <%= admin_config_label :sidebar_tags %> + <%= admin_config_description Constants::Settings::General::DETAILS[:sidebar_tags][:description] %> + <%= f.text_field :sidebar_tags, + class: "crayons-textfield", + value: Settings::General.sidebar_tags.join(","), + placeholder: Constants::Settings::General::DETAILS[:sidebar_tags][:placeholder], + pattern: "[a-z0-9,]+" %> +
+ + <%= render "form_submission", f: f %> +
+
+
+<% end %> diff --git a/app/views/admin/settings/forms/_user_experience.html.erb b/app/views/admin/settings/forms/_user_experience.html.erb new file mode 100644 index 000000000..5c0549da2 --- /dev/null +++ b/app/views/admin/settings/forms/_user_experience.html.erb @@ -0,0 +1,79 @@ +<%= form_for(Settings::UserExperience.new, url: admin_settings_user_experiences_path) do |f| %> +
+ <%= render partial: "admin/shared/card_header", + locals: { + header: "User Experience and Brand", + state: "collapse", + target: "uxBodyContainer", + expanded: false + } %> +
+
+
+ <%= admin_config_label :feed_style, model: Settings::UserExperience %> + <%= admin_config_description Constants::Settings::UserExperience::DETAILS[:feed_style][:description] %> + <%= f.text_field :feed_style, + class: "crayons-textfield", + value: Settings::UserExperience.feed_style, + placeholder: Constants::Settings::UserExperience::DETAILS[:feed_style][:placeholder] %> +
+
+ <%= admin_config_label :feed_strategy, model: Settings::UserExperience %> + <%= admin_config_description Constants::Settings::UserExperience::DETAILS[:feed_strategy][:description] %> + <%= f.text_field :feed_strategy, + class: "crayons-textfield", + value: Settings::UserExperience.feed_strategy, + placeholder: Constants::Settings::UserExperience::DETAILS[:feed_strategy][:placeholder] %> +
+
+ <%= admin_config_label :tag_feed_minimum_score, model: Settings::UserExperience %> + <%= admin_config_description Constants::Settings::UserExperience::DETAILS[:tag_feed_minimum_score][:description] %> + <%= f.number_field :tag_feed_minimum_score, + class: "crayons-textfield", + value: Settings::UserExperience.tag_feed_minimum_score, + placeholder: Constants::Settings::UserExperience::DETAILS[:tag_feed_minimum_score][:placeholder] %> +
+
+ <%= admin_config_label :home_feed_minimum_score, model: Settings::UserExperience %> + <%= admin_config_description Constants::Settings::UserExperience::DETAILS[:home_feed_minimum_score][:description] %> + <%= f.number_field :home_feed_minimum_score, + class: "crayons-textfield", + value: Settings::UserExperience.home_feed_minimum_score, + placeholder: Constants::Settings::UserExperience::DETAILS[:home_feed_minimum_score][:placeholder] %> +
+
+ <%= admin_config_label :default_font, model: Settings::UserExperience %> + <%= admin_config_description Constants::Settings::UserExperience::DETAILS[:default_font][:description] %> + <%= select_tag "settings_user_experience[default_font]", + options_for_select( + [%w[sans-serif sans_serif], %w[serif serif], %w[open-dyslexic open_dyslexic]], + Settings::UserExperience.default_font, + ), + multiple: false, + class: "selectpicker" %> +
+
+ <%= admin_config_label :primary_brand_color_hex, model: Settings::UserExperience %> + <%= admin_config_description Constants::Settings::UserExperience::DETAILS[:primary_brand_color_hex][:description] %> + <%= f.color_field :primary_brand_color_hex, + class: "crayons-color-selector", + value: Settings::UserExperience.primary_brand_color_hex, + pattern: "^#+([a-fA-F0-9]{6})$", + placeholder: Constants::Settings::UserExperience::DETAILS[:primary_brand_color_hex][:placeholder] %> +
+
+ <%= f.check_box :public, checked: Settings::UserExperience.public, class: "crayons-checkbox" %> +
+ <%= admin_config_label :public, model: Settings::UserExperience %> +

+ Are most of the site pages (e.g. posts, profiles) public? Please take precaution when changing this setting. +

+
+
+ + <%= render "form_submission", f: f %> +
+
+
+<% end %> + diff --git a/app/views/admin/settings/_apple_auth_provider_settings.html.erb b/app/views/admin/settings/forms/authentication/_apple_auth_provider_settings.html.erb similarity index 100% rename from app/views/admin/settings/_apple_auth_provider_settings.html.erb rename to app/views/admin/settings/forms/authentication/_apple_auth_provider_settings.html.erb diff --git a/app/views/admin/settings/_auth_provider_settings.html.erb b/app/views/admin/settings/forms/authentication/_auth_provider_settings.html.erb similarity index 100% rename from app/views/admin/settings/_auth_provider_settings.html.erb rename to app/views/admin/settings/forms/authentication/_auth_provider_settings.html.erb diff --git a/app/views/admin/settings/show.html.erb b/app/views/admin/settings/show.html.erb index 533ac029f..daca45c81 100644 --- a/app/views/admin/settings/show.html.erb +++ b/app/views/admin/settings/show.html.erb @@ -32,64 +32,7 @@ id="getStartedBodyContainer" class="<%= VerifySetupCompleted.setup_completed? ? "hide collapse" : "show expand" %> p-3" aria-labelledby="getStartedHeader"> - - <%= form_with(url: admin_settings_mandatory_settings_path, local: true, data: { testid: "getStartedSectionForm" }) do |f| %> -
- - <% Settings::Mandatory::MAPPINGS.each do |config_key, settings_model| %> - <%# we need to list the config as separate fields if the data structure is a Hash %> - <% placeholder_module = Constants.const_get(settings_model.name) %> - <% if settings_model.public_send(config_key).is_a?(Hash) %> - <%= admin_config_label config_key.to_s %> -
- <%= f.fields_for config_key do |a_field| %> - <% settings_model.public_send(config_key).each do |key, value| %> -
- <%= admin_config_label key.to_s %> - <%= admin_config_description "#{key} #{config_key.to_s.tr! '_', ' '}" %> - <%= a_field.text_field key, - class: "crayons-textfield", - value: settings_model.public_send(config_key)[key], - placeholder: placeholder_module::DETAILS[config_key][:placeholder] %> -
- <% end %> - <% end %> -
- <% elsif settings_model.public_send(config_key).is_a?(Array) %> -
- <%= admin_config_label config_key %> - <%= admin_config_description placeholder_module::DETAILS[config_key][:description] %> - <%= f.text_field config_key, - class: "crayons-textfield", - value: settings_model.public_send(config_key).join(","), - placeholder: placeholder_module::DETAILS[config_key][:placeholder] %> -
- <% else %> -
- <%= admin_config_label config_key %> - <%= admin_config_description placeholder_module::DETAILS[config_key][:description] %> - <%= f.text_field config_key, - class: "form-control", - value: settings_model.public_send(config_key), - placeholder: placeholder_module::DETAILS[config_key][:placeholder] %> -
- <% end %> - <% end %> - - <% if current_user.has_role?(:super_admin) %> -
-
- <%= label_tag :confirmation_update, "Confirmation update", class: "crayons-field__label" %> -

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 Settings", class: "crayons-btn align-self-start" %> -
-
-
- <% end %> -
- <% end %> + <%= render partial: "forms/mandatory" %> @@ -115,1083 +58,26 @@
- <%= form_for(Settings::General.new, url: admin_settings_general_settings_path) do |f| %> -
- <%= render partial: "admin/shared/card_header", - locals: { - header: "API Tokens", - state: "collapse", - target: "apiBodyContainer", - expanded: false - } %> -
-
-
- <%= admin_config_label :health_check_token %> - <%= admin_config_description Constants::Settings::General::DETAILS[:health_check_token][:description] %> - <%= f.text_field :health_check_token, - class: "crayons-textfield", - 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::Settings::General::DETAILS[:video_encoder_key][:description] %> - <%= f.text_field :video_encoder_key, - class: "crayons-textfield", - value: Settings::General.video_encoder_key, - placeholder: Constants::Settings::General::DETAILS[:video_encoder_key][:placeholder] %> -
- <%= render "form_submission", f: f %> -
-
-
- <% end %> - - <%= form_for(Settings::Authentication.new, url: admin_settings_authentications_path, html: { data: { action: "submit->config#configUpdatePrecheck", "config-target": "authSectionForm", testid: "authSectionForm" } }) do |f| %> -
- <%= render partial: "admin/shared/card_header", - locals: { - header: "Authentication", - state: "collapse", - target: "authenticationBodyContainer", - expanded: false - } %> -
-
-

- General settings -

-
" - data-tooltip="Unchecking this will enable Email Registration"> - <%= f.check_box :invite_only_mode, - checked: invite_only_mode_or_no_enabled_auth_options, - data: { action: "config#adjustAuthenticationOptions", "config-target": "inviteOnlyMode" }, - class: "crayons-checkbox" %> -
- <%= admin_config_label :invite_only_mode, "Invite-only mode", model: Settings::Authentication %> - <%= admin_config_description Constants::Settings::Authentication::DETAILS[:invite_only_mode][:description] %> -
-
-
-
-
-

- Registration options -

-

- How can people create an account on your community? -

-
- -
-
- <%= inline_svg_tag("email.svg", class: "crayons-icon", aria: true, title: "Email icon") %> -
-
-
- -
-

"> - Email address -

-
" - data-config-target="enabledIndicator"> - <%= inline_svg_tag("checkmark.svg", aria: true, class: "crayons-icon admin-config-checkmark", title: "Email enabled") %> - Enabled -
-
- - - -
- -
-
-
- -
-
- <%= f.text_field :auth_providers_to_enable, - id: "auth_providers_to_enable", - class: "form-control hidden", - value: Settings::Authentication.providers.join(","), - readonly: true %> -
- <% authentication_available_providers.each do |provider| %> - <% next if provider.provider_name == :apple && !Flipper.enabled?(:apple_auth) %> -
-
- <%= inline_svg_tag("#{provider.provider_name}.svg", class: "crayons-icon", aria: true, title: "#{provider.official_name} logo") %> -
-
-
-
-

"> - <%= provider.official_name %> -

-
"> - <%= inline_svg_tag("checkmark.svg", aria: true, class: "crayons-icon admin-config-checkmark", title: "#{provider.official_name} enabled") %> - Enabled -
-
- -
- -
-
-
- <% end %> -
-
-
- Changing authentication keys will not take effect until this Forem instance is restarted. -
- - <%= render "form_submission", f: f %> -
-
- <% end %> - - <%= form_for(Settings::Campaign.new, url: admin_settings_campaigns_path) do |f| %> -
- <%= render partial: "admin/shared/card_header", - locals: { - header: "Campaign", - state: "collapse", - target: "campaignBodyContainer", - expanded: false - } %> -
-
-
- <%= admin_config_label :hero_html_variant_name, "Campaign hero HTML variant name" %> - <%= admin_config_description Constants::Settings::Campaign::DETAILS[:hero_html_variant_name][:description] %> - <%= f.text_field :hero_html_variant_name, - class: "crayons-textfield", - value: Settings::Campaign.hero_html_variant_name, - placeholder: Constants::Settings::Campaign::DETAILS[:hero_html_variant_name][:placeholder] %> -
- -
- <%= f.check_box :articles_require_approval, checked: Settings::Campaign.articles_require_approval, class: "crayons-checkbox" %> - <%= admin_config_label :articles_require_approval %> - <%= admin_config_description Constants::Settings::Campaign::DETAILS[:articles_require_approval][:description] %> -
- -
- <%= f.check_box :sidebar_enabled, checked: Settings::Campaign.sidebar_enabled, class: "crayons-checkbox" %> - <%= admin_config_label :sidebar_enabled %> - <%= admin_config_description Constants::Settings::Campaign::DETAILS[:sidebar_enabled][:description] %> -
- -
- <%= admin_config_label :sidebar_image %> - <%= admin_config_description Constants::Settings::Campaign::DETAILS[:sidebar_image][:description] %> - <% if Settings::Campaign.sidebar_image.present? %> -
-
- Campaign sidebar image -
-
- <% end %> - <%= f.text_field :sidebar_image, - class: "crayons-textfield", - value: Settings::Campaign.sidebar_image, - placeholder: Constants::Settings::Campaign::DETAILS[:sidebar_image][:placeholder] %> -
- -
- <%= admin_config_label :url, "Campaign URL" %> - <%= admin_config_description Constants::Settings::Campaign::DETAILS[:url][:description] %> - <%= f.text_field :url, - class: "crayons-textfield", - value: Settings::Campaign.url, - placeholder: Constants::Settings::Campaign::DETAILS[:url][:placeholder] %> -
- -
- <%= admin_config_label :featured_tags %> - <%= admin_config_description Constants::Settings::Campaign::DETAILS[:featured_tags][:description] %> - <%= f.text_field :featured_tags, - class: "crayons-textfield", - value: Settings::Campaign.featured_tags.join(","), - placeholder: Constants::Settings::Campaign::DETAILS[:featured_tags][:placeholder] %> -
- -
- <%= admin_config_label :call_to_action, "Campaign Call to Action" %> - <%= admin_config_description Constants::Settings::Campaign::DETAILS[:call_to_action][:description] %> - <%= f.text_field :call_to_action, - class: "crayons-textfield", - value: Settings::Campaign.call_to_action, - placeholder: Constants::Settings::Campaign::DETAILS[:call_to_action][:placeholder] %> -
- -
- <%= admin_config_label :articles_expiry_time, "Campaign article expiry time" %> - <%= admin_config_description Constants::Settings::Campaign::DETAILS[:articles_expiry_time][:description] %> - <%= f.number_field :articles_expiry_time, - class: "crayons-textfield", - value: Settings::Campaign.articles_expiry_time, - placeholder: Constants::Settings::Campaign::DETAILS[:articles_expiry_time][:placeholder] %> -
- - <%= render "form_submission", f: f %> -
-
-
- <% end %> - - <%= form_for(Settings::Community.new, url: admin_settings_communities_path) do |f| %> -
- <%= render partial: "admin/shared/card_header", - locals: { - header: "Community Content", - state: "collapse", - target: "contentBodyContainer", - expanded: false - } %> -
-
-
- <%= admin_config_label :community_name, model: Settings::Community %> - <%= admin_config_description Constants::Settings::Community::DETAILS[:community_name][:description] %> - <%= f.text_field :community_name, - class: "crayons-textfield", - value: Settings::Community.community_name, - placeholder: Constants::Settings::Community::DETAILS[:community_name][:placeholder] %> -
- -
- <%= admin_config_label :community_emoji, model: Settings::Community %> - <%= admin_config_description Constants::Settings::Community::DETAILS[:community_emoji][:description] %> - <%= f.text_field :community_emoji, - class: "crayons-textfield", - value: Settings::Community.community_emoji, - placeholder: Constants::Settings::Community::DETAILS[:community_emoji][:placeholder] %> -
- -
- <%= admin_config_label :tagline, model: Settings::Community %> - <%= admin_config_description Constants::Settings::Community::DETAILS[:tagline][:description] %> - <%= f.text_field :tagline, - class: "crayons-textfield", - value: Settings::Community.tagline, - placeholder: Constants::Settings::Community::DETAILS[:tagline][:placeholder] %> -
- -
- <%= admin_config_label :community_description, model: Settings::Community %> - <%= admin_config_description Constants::Settings::Community::DETAILS[:community_description][:description] %> - <%= f.text_field :community_description, - class: "crayons-textfield", - value: Settings::Community.community_description, - placeholder: Constants::Settings::Community::DETAILS[:community_description][:placeholder] %> -
- -
- <%= admin_config_label :member_label, model: Settings::Community %> - <%= admin_config_description Constants::Settings::Community::DETAILS[:member_label][:description] %> - <%= f.text_field :member_label, - class: "crayons-textfield", - value: Settings::Community.member_label, - placeholder: Constants::Settings::Community::DETAILS[:member_label][:placeholder] %> -
- -
- <%= admin_config_label :copyright_start_year, model: Settings::Community %> - <%= admin_config_description Constants::Settings::Community::DETAILS[:copyright_start_year][:description] %> - <%= f.text_field :copyright_start_year, - class: "crayons-textfield", - value: Settings::Community.copyright_start_year, - placeholder: Constants::Settings::Community::DETAILS[:copyright_start_year][:placeholder] %> -
- -
- <%= admin_config_label :staff_user_id, model: Settings::Community %> - <%= admin_config_description Constants::Settings::Community::DETAILS[:staff_user_id][:description] %> - <%= f.text_field :staff_user_id, - class: "crayons-textfield", - value: Settings::Community.staff_user_id, - placeholder: Constants::Settings::Community::DETAILS[:staff_user_id][:placeholder] %> -
- <%= render "form_submission", f: f %> -
-
-
- <% end %> - - <%= form_for(Settings::General.new, url: admin_settings_general_settings_path) do |f| %> -
- <%= render partial: "admin/shared/card_header", - locals: { - header: "Credits", - state: "collapse", - target: "creditsBodyContainer", - expanded: false - } %> - -
-
- <%= f.fields_for :credit_prices_in_cents do |price_field| %> -
- <%= admin_config_label "Credit price in cents (S)" %> - <%= admin_config_description Constants::Settings::General::DETAILS[:credit_prices_in_cents][:small][:description] %> - <%= price_field.number_field :small, - class: "crayons-textfield", - value: Settings::General.credit_prices_in_cents[:small] %> -
- -
- <%= admin_config_label "Credit price in cents (M)" %> - <%= admin_config_description Constants::Settings::General::DETAILS[:credit_prices_in_cents][:medium][:description] %> - <%= price_field.number_field :medium, - class: "crayons-textfield", - value: Settings::General.credit_prices_in_cents[:medium] %> -
-
- <%= admin_config_label "Credit price in cents (L)" %> - <%= admin_config_description Constants::Settings::General::DETAILS[:credit_prices_in_cents][:large][:description] %> - <%= price_field.number_field :large, - class: "crayons-textfield", - value: Settings::General.credit_prices_in_cents[:large] %> -
- -
- <%= admin_config_label "Credit price in cents (XL)" %> - <%= admin_config_description Constants::Settings::General::DETAILS[:credit_prices_in_cents][:xlarge][:description] %> - <%= price_field.number_field :xlarge, - class: "crayons-textfield", - value: Settings::General.credit_prices_in_cents[:xlarge] %> -
- <% end %> - - <%= render "form_submission", f: f %> -
-
-
- <% end %> - -
- <%= render partial: "admin/shared/card_header", - locals: { - header: "Emails", - state: "collapse", - target: "emailBodyContainer", - expanded: false - } %> -
-
-
- -
- Default (set via default_email environment variable) -
- -
-
-
-
- - <%= form_for(Settings::General.new, url: admin_settings_general_settings_path, html: { data: { testid: "emailDigestSectionForm" } }) do |f| %> -
- <%= render partial: "admin/shared/card_header", - locals: { - header: "Email digest frequency", - state: "collapse", - target: "emailDigestBodyContainer", - expanded: false - } %> -
-
-
- <%= admin_config_label :periodic_email_digest %> - <%= admin_config_description Constants::Settings::General::DETAILS[:periodic_email_digest][:description] %> - <%= f.number_field :periodic_email_digest, - class: "crayons-textfield", - value: Settings::General.periodic_email_digest, - placeholder: Constants::Settings::General::DETAILS[:periodic_email_digest][:placeholder] %> -
- - <%= render "form_submission", f: f %> -
-
-
- <% end %> - - <%= form_for(Settings::General.new, url: admin_settings_general_settings_path) do |f| %> -
- <%= render partial: "admin/shared/card_header", - locals: { - header: "Google Analytics", - state: "collapse", - target: "gaBodyContainer", - expanded: false - } %> -
-
-
- <%= admin_config_label :ga_tracking_id, "View ID" %> - <%= admin_config_description Constants::Settings::General::DETAILS[:ga_tracking_id][:description] %> - <%= f.text_field :ga_tracking_id, - class: "crayons-textfield", - value: Settings::General.ga_tracking_id %> -
- - <%= render "form_submission", f: f %> -
-
-
- <% end %> - - <%= form_for(Settings::General.new, url: admin_settings_general_settings_path) do |f| %> -
- <%= render partial: "admin/shared/card_header", - locals: { - header: "Images", - state: "collapse", - target: "imagesBodyContainer", - expanded: false - } %> -
-
-
- <%= admin_config_label :main_social_image %> - <%= admin_config_description Constants::Settings::General::DETAILS[:main_social_image][:description] %> - <%= f.text_field :main_social_image, - class: "crayons-textfield", - 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::Settings::General::DETAILS[:favicon_url][:description] %> - <%= f.text_field :favicon_url, - class: "form-control", - value: Settings::General.favicon_url, - placeholder: Constants::Settings::General::DETAILS[:favicon_url][:placeholder] %> - favicon -
- -
- <%= admin_config_label :logo_png %> - <%= admin_config_description Constants::Settings::General::DETAILS[:logo_png][:description] %> - <%= f.text_field :logo_png, - class: "crayons-textfield", - 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::Settings::General::DETAILS[:logo_svg][:description] %> - <%= f.text_area :logo_svg, - class: "crayons-textfield", - value: Settings::General.logo_svg, - rows: 6, - placeholder: Constants::Settings::General::DETAILS[:logo_svg][:placeholder] %> - <% if Settings::General.logo_svg.present? %> - - <% end %> -
- - <%= render "form_submission", f: f %> -
-
-
- <% end %> - - <%= form_for(Settings::General.new, url: admin_settings_general_settings_path, html: { data: { testid: "mascotSectionForm" } }) do |f| %> -
- <%= render partial: "admin/shared/card_header", - locals: { - header: "Mascot", - state: "collapse", - target: "mascotBodyContainer", - expanded: false - } %> -
-
-
- <%= admin_config_label :mascot_user_id, "Mascot user ID" %> - <%= admin_config_description Constants::Settings::General::DETAILS[:mascot_user_id][:description] %> - <%= f.text_field :mascot_user_id, - class: "crayons-textfield", - value: Settings::General.mascot_user_id, - min: 1, - placeholder: Constants::Settings::General::DETAILS[:mascot_user_id][:placeholder] %> -
- -
- <%= admin_config_label :mascot_image_url, "Mascot Image URL" %> - <%= admin_config_description Constants::Settings::General::DETAILS[:mascot_image_url][:description] %> - <%= f.text_field :mascot_image_url, - class: "crayons-textfield", - value: Settings::General.mascot_image_url, - placeholder: Constants::Settings::General::DETAILS[:mascot_image_url][:placeholder] %> - -
- Mascot image -
- -
- <%= render "form_submission", f: f %> -
-
-
- <% end %> - - <%= form_for(Settings::General.new, url: admin_settings_general_settings_path) do |f| %> -
- <%= render partial: "admin/shared/card_header", - locals: { - header: "Meta Keywords", - state: "collapse", - target: "metaKeywordsBodyContainer", - expanded: false - } %> -
-
- <%= f.fields_for :meta_keywords do |meta_keywords_field| %> - <% Settings::General.meta_keywords.each do |area, keywords| %> -
- <%= admin_config_label area.to_s %> -

- <%= area.capitalize %><%= "page" unless area == "default" %> keywords -

- <%= meta_keywords_field.text_field area, - class: "crayons-textfield", - value: Settings::General.meta_keywords[area], - placeholder: Constants::Settings::General::DETAILS[:meta_keywords][:placeholder] %> -
- <% end %> - <% end %> - - <%= render "form_submission", f: f %> -
-
-
- <% end %> - - <%= form_for(Settings::General.new, url: admin_settings_general_settings_path) do |f| %> -
- <%= render partial: "admin/shared/card_header", - locals: { - header: "Monetization", - state: "collapse", - target: "monetizationBodyContainer", - expanded: false - } %> -
-
- -
- <%= admin_config_label :stripe_api_key, "Stripe API key" %> - <%= admin_config_description Constants::Settings::General::DETAILS[:stripe_api_key][:description] %> - <%= f.text_field :stripe_api_key, - class: "crayons-textfield", - 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::Settings::General::DETAILS[:stripe_publishable_key][:description] %> - <%= f.text_field :stripe_publishable_key, - class: "crayons-textfield", - value: Settings::General.stripe_publishable_key, - placeholder: Constants::Settings::General::DETAILS[:stripe_publishable_key][:placeholder] %> -
- -
- <%= admin_config_label :payment_pointer %> - <%= admin_config_description Constants::Settings::General::DETAILS[:payment_pointer][:description] %> - <%= f.text_field :payment_pointer, - class: "crayons-textfield", - value: Settings::General.payment_pointer, - placeholder: Constants::Settings::General::DETAILS[:payment_pointer][:placeholder] %> -
- - <%= render "form_submission", f: f %> -
-
-
- <% end %> - - <%= form_for(Settings::General.new, url: admin_settings_general_settings_path) do |f| %> -
- <%= render partial: "admin/shared/card_header", - locals: { - header: "Newsletter", - state: "collapse", - target: "newsletterBodyContainer", - expanded: false - } %> -
-
-
- <%= admin_config_label :mailchimp_api_key, "Mailchimp API Key" %> - <%= admin_config_description Constants::Settings::General::DETAILS[:mailchimp_api_key][:description] %> - <%= f.text_field :mailchimp_api_key, - class: "crayons-textfield", - value: Settings::General.mailchimp_api_key %> -
- -
- <%= admin_config_label :mailchimp_newsletter_id, "Main Newsletter" %> - <%= admin_config_description Constants::Settings::General::DETAILS[:mailchimp_newsletter_id][:description] %> - <%= f.text_field :mailchimp_newsletter_id, - class: "crayons-textfield", - value: Settings::General.mailchimp_newsletter_id %> -
- -
- <%= admin_config_label :mailchimp_sustaining_members_id, "Sustaining Members Newsletter" %> - <%= admin_config_description Constants::Settings::General::DETAILS[:mailchimp_sustaining_members_id][:description] %> - <%= f.text_field :mailchimp_sustaining_members_id, - class: "crayons-textfield", - value: Settings::General.mailchimp_sustaining_members_id %> -
- -
- <%= admin_config_label :mailchimp_tag_moderators_id, "Tag Moderators Newsletter" %> - <%= admin_config_description Constants::Settings::General::DETAILS[:mailchimp_tag_moderators_id][:description] %> - <%= f.text_field :mailchimp_tag_moderators_id, - class: "crayons-textfield", - value: Settings::General.mailchimp_tag_moderators_id %> -
- -
- <%= admin_config_label :mailchimp_community_moderators_id, "Community Moderators Newsletter" %> - <%= admin_config_description Constants::Settings::General::DETAILS[:mailchimp_community_moderators_id][:description] %> - <%= f.text_field :mailchimp_community_moderators_id, - class: "crayons-textfield", - value: Settings::General.mailchimp_community_moderators_id %> -
- - <%= render "form_submission", f: f %> -
-
-
- <% end %> - - <%= form_for(Settings::General.new, url: admin_settings_general_settings_path) do |f| %> -
- <%= render partial: "admin/shared/card_header", - locals: { - header: "Onboarding", - state: "collapse", - target: "onboardingBodyContainer", - expanded: false - } %> -
-
-
- <%= admin_config_label :onboarding_background_image %> - <%= admin_config_description Constants::Settings::General::DETAILS[:onboarding_background_image][:description] %> - <%= f.text_field :onboarding_background_image, - class: "crayons-textfield", - value: Settings::General.onboarding_background_image, - placeholder: Constants::Settings::General::DETAILS[:onboarding_background_image][:placeholder] %> -
-
- onboarding background image -
-
-
- -
- <%= admin_config_label :suggested_users %> - <%= admin_config_description Constants::Settings::General::DETAILS[:suggested_users][:description] %> - <%= f.text_field :suggested_users, - class: "crayons-textfield", - value: Settings::General.suggested_users.join(","), - placeholder: Constants::Settings::General::DETAILS[:suggested_users][:placeholder] %> -
- -
- <%= 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::Settings::General::DETAILS[:prefer_manual_suggested_users][:description] %> -

-
-
- - <%= render "form_submission", f: f %> -
-
-
- <% end %> - - <%= form_for(Settings::RateLimit.new, url: admin_settings_rate_limits_path) do |f| %> -
- <%= render partial: "admin/shared/card_header", - locals: { - header: "Rate limits and anti-spam", - state: "collapse", - target: "rateLimitsBodyContainer", - expanded: false - } %> -
-
-
- <%= admin_config_label :user_considered_new_days, model: Settings::RateLimit %> - <%= admin_config_description Constants::Settings::RateLimit::DETAILS[:user_considered_new_days][:description] %> - <%= f.number_field :user_considered_new_days, - class: "crayons-textfield", - value: Settings::RateLimit.user_considered_new_days, - placeholder: Constants::Settings::RateLimit::DETAILS[:user_considered_new_days][:placeholder] %> -
- - <% configurable_rate_limits.each do |key, field_hash| %> -
- <%= admin_config_label field_hash[:title], model: Settings::RateLimit %> -

- <%= field_hash[:description] %> -

- <%= f.number_field key, - class: "crayons-textfield", - value: Settings::RateLimit.public_send(key), - min: field_hash[:min], - placeholder: field_hash[:placeholder] %> -
- <% end %> - -
- <%= admin_config_label :spam_trigger_terms, model: Settings::RateLimit %> - <%= admin_config_description Constants::Settings::RateLimit::DETAILS[:spam_trigger_terms][:description] %> - <%= f.text_area :spam_trigger_terms, - class: "crayons-textfield", - value: Settings::RateLimit.spam_trigger_terms.join(","), - placeholder: Constants::Settings::RateLimit::DETAILS[:spam_trigger_terms][:placeholder] %> -
- <%= render "form_submission", f: f %> -
-
-
- <% end %> - - <%= form_for(Settings::General.new, url: admin_settings_general_settings_path) do |f| %> -
- <%= render partial: "admin/shared/card_header", - locals: { - header: "Social Media", - state: "collapse", - target: "socialMediaBodyContainer", - expanded: false - } %> -
-
-
- <%= admin_config_label :twitter_hashtag %> - <%= admin_config_description Constants::Settings::General::DETAILS[:twitter_hashtag][:description] %> - <%= f.text_field :twitter_hashtag, - class: "crayons-textfield", - 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| %> - <% Settings::General.social_media_handles.each do |platform, username| %> -
- <%= admin_config_label platform %> -

- <%= platform.capitalize %> username -

- <%= social_media_field.text_field platform, - class: "crayons-textfield", - value: Settings::General.social_media_handles[platform], - placeholder: "" %> -
- <% end %> - <% end %> - - <%= render "form_submission", f: f %> -
-
-
- <% end %> - - <%= form_for(Settings::SMTP.new, url: admin_settings_smtp_settings_path) do |f| %> -
- <%= render partial: "admin/shared/card_header", - locals: { header: "SMTP Settings", state: "collapse", target: "smtpSettingsBodyContainer", expanded: false } %> -
-
- <% Settings::SMTP::OPTIONS.each do |config_key| %> -
- <%= admin_config_label config_key %> - <%= admin_config_description Constants::Settings::SMTP::DETAILS[config_key][:description] %> - <%= f.text_field config_key, - class: "crayons-textfield", - value: Settings::SMTP.public_send(config_key), - placeholder: Constants::Settings::SMTP::DETAILS[config_key][:placeholder] %> - -
- <% end %> - <%= render "form_submission", f: f %> -
-
-
- <% end %> - - <%= form_for(Settings::General.new, url: admin_settings_general_settings_path) do |f| %> -
- <%= render partial: "admin/shared/card_header", - locals: { - header: "Sponsors", - state: "collapse", - target: "sponsorsContainer", - expanded: false - } %> -
-
-
- <%= admin_config_label :sponsor_headline %> - <%= admin_config_description Constants::Settings::General::DETAILS[:sponsor_headline][:description] %> - <%= f.text_field :sponsor_headline, - class: "crayons-textfield", - value: Settings::General.sponsor_headline, - placeholder: Constants::Settings::General::DETAILS[:sponsor_headline][:placeholder] %> -
- - <%= render "form_submission", f: f %> -
-
-
- <% end %> - - <%= form_for(Settings::General.new, url: admin_settings_general_settings_path) do |f| %> -
- <%= render partial: "admin/shared/card_header", - locals: { - header: "Tags", - state: "collapse", - target: "tagsBodyContainer", - expanded: false - } %> -
-
-
- <%= admin_config_label :sidebar_tags %> - <%= admin_config_description Constants::Settings::General::DETAILS[:sidebar_tags][:description] %> - <%= f.text_field :sidebar_tags, - class: "crayons-textfield", - value: Settings::General.sidebar_tags.join(","), - placeholder: Constants::Settings::General::DETAILS[:sidebar_tags][:placeholder], - pattern: "[a-z0-9,]+" %> -
- - <%= render "form_submission", f: f %> -
-
-
- <% end %> - - <%= form_for(Settings::UserExperience.new, url: admin_settings_user_experiences_path) do |f| %> -
- <%= render partial: "admin/shared/card_header", - locals: { - header: "User Experience and Brand", - state: "collapse", - target: "uxBodyContainer", - expanded: false - } %> -
-
-
- <%= admin_config_label :feed_style, model: Settings::UserExperience %> - <%= admin_config_description Constants::Settings::UserExperience::DETAILS[:feed_style][:description] %> - <%= f.text_field :feed_style, - class: "crayons-textfield", - value: Settings::UserExperience.feed_style, - placeholder: Constants::Settings::UserExperience::DETAILS[:feed_style][:placeholder] %> -
-
- <%= admin_config_label :feed_strategy, model: Settings::UserExperience %> - <%= admin_config_description Constants::Settings::UserExperience::DETAILS[:feed_strategy][:description] %> - <%= f.text_field :feed_strategy, - class: "crayons-textfield", - value: Settings::UserExperience.feed_strategy, - placeholder: Constants::Settings::UserExperience::DETAILS[:feed_strategy][:placeholder] %> -
-
- <%= admin_config_label :tag_feed_minimum_score, model: Settings::UserExperience %> - <%= admin_config_description Constants::Settings::UserExperience::DETAILS[:tag_feed_minimum_score][:description] %> - <%= f.number_field :tag_feed_minimum_score, - class: "crayons-textfield", - value: Settings::UserExperience.tag_feed_minimum_score, - placeholder: Constants::Settings::UserExperience::DETAILS[:tag_feed_minimum_score][:placeholder] %> -
-
- <%= admin_config_label :home_feed_minimum_score, model: Settings::UserExperience %> - <%= admin_config_description Constants::Settings::UserExperience::DETAILS[:home_feed_minimum_score][:description] %> - <%= f.number_field :home_feed_minimum_score, - class: "crayons-textfield", - value: Settings::UserExperience.home_feed_minimum_score, - placeholder: Constants::Settings::UserExperience::DETAILS[:home_feed_minimum_score][:placeholder] %> -
-
- <%= admin_config_label :default_font, model: Settings::UserExperience %> - <%= admin_config_description Constants::Settings::UserExperience::DETAILS[:default_font][:description] %> - <%= select_tag "settings_user_experience[default_font]", - options_for_select( - [%w[sans-serif sans_serif], %w[serif serif], %w[open-dyslexic open_dyslexic]], - Settings::UserExperience.default_font, - ), - multiple: false, - class: "selectpicker" %> -
-
- <%= admin_config_label :primary_brand_color_hex, model: Settings::UserExperience %> - <%= admin_config_description Constants::Settings::UserExperience::DETAILS[:primary_brand_color_hex][:description] %> - <%= f.color_field :primary_brand_color_hex, - class: "crayons-color-selector", - value: Settings::UserExperience.primary_brand_color_hex, - pattern: "^#+([a-fA-F0-9]{6})$", - placeholder: Constants::Settings::UserExperience::DETAILS[:primary_brand_color_hex][:placeholder] %> -
-
- <%= f.check_box :public, checked: Settings::UserExperience.public, class: "crayons-checkbox" %> -
- <%= admin_config_label :public, model: Settings::UserExperience %> -

- Are most of the site pages (e.g. posts, profiles) public? Please take precaution when changing this setting. -

-
-
- - <%= render "form_submission", f: f %> -
-
-
- <% end %> + <%= render partial: "forms/api_tokens" %> + <%= render partial: "forms/authentication" %> + <%= render partial: "forms/campaign" %> + <%= render partial: "forms/community" %> + <%= render partial: "forms/credits" %> + <%= render partial: "forms/emails" %> + <%= render partial: "forms/email_digest_frequency" %> + <%= render partial: "forms/google_analytics" %> + <%= render partial: "forms/images" %> + <%= render partial: "forms/mascot" %> + <%= render partial: "forms/meta_keywords" %> + <%= render partial: "forms/monetization" %> + <%= render partial: "forms/newsletter" %> + <%= render partial: "forms/onboarding" %> + <%= render partial: "forms/rate_limit" %> + <%= render partial: "forms/smtp" %> + <%= render partial: "forms/sponsors" %> + <%= render partial: "forms/tags" %> + <%= render partial: "forms/user_experience" %>
-
diff --git a/app/views/comments/_form.html.erb b/app/views/comments/_form.html.erb index f48a2c69e..3353f6d24 100644 --- a/app/views/comments/_form.html.erb +++ b/app/views/comments/_form.html.erb @@ -42,7 +42,7 @@ id: "text-area", required: true, class: "crayons-textfield comment-textarea crayons-textfield--ghost", - 'aria-label': "Add a comment to the discussion" %> + "aria-label": "Add a comment to the discussion" %>