docbrown/app/views/admin/creator_settings/_form.html.erb
Nick Taylor f6f74e47d9
Now radio buttons in creator settings are on the same line in fieldsets (#15574)
Co-authored-by: ludwiczakpawel <ludwiczakpawel@gmail.com>
2021-11-30 14:56:09 -05:00

102 lines
5.1 KiB
Text

<div class="crayons-field mt-6 align-left">
<%= label_tag :community_name, class: "crayons-field__label" do %>
Community name
<span class="crayons-field__required crayons-tooltip" data-tooltip="This will set the primary name for your Forem" aria-describedby="community-name-subtitle"></span>
<p id="community-name-subtitle" class="crayons-field__description">Used as the primary name for your Forem.</p>
<% end %>
<%= text_field_tag :community_name, "", placeholder: "Climbing Life", class: "crayons-textfield fs-italic", required: true %>
</div>
<div class="crayons-field mt-6 align-left">
<%= label_tag :logo_svg, class: "crayons-field__label" do %>
Logo
<span class="crayons-field__required crayons-tooltip" data-tooltip="This will set the logo for your Forem" aria-describedby="logo-subtitle"></span>
<p id="logo-subtitle" class="crayons-field__description">Ideally SVG, but PNG or JPEG will work, too.</p>
<% end %>
<div class="flex flex-1 gap-4">
<%= file_field_tag :logo_svg, required: true, accept: ".svg,.png,.jpg,image/svg+xml,image/png,image/jpg", data: { "max-file-size-mb": "25", action: "change->creator-settings#previewLogo" }, aria: { describedby: "logo-subtitle" } %>
<div data-creator-settings-target="previewLogo">
<% if ::Settings::General.logo_svg.present? %>
<%= ::Settings::General.logo_svg.html_safe %>
<% end %>
</div>
</div>
</div>
<div class="crayons-field mt-6 align-left">
<%= label_tag :primary_brand_color_hex, class: "crayons-field__label" do %>
Brand color
<span class="crayons-field__required crayons-tooltip" data-tooltip="This will set the accent color for buttons, links, etc. on your Forem" aria-describedby="color-selector-subtitle"></span>
<p id="color-selector-subtitle" class="crayons-field__description">This will be the "accent" color used for buttons, links, etc.</p>
<% end %>
<div class="flex w-100 m:w-50 crayons-field">
<div class="flex">
<%= text_field_tag :primary_brand_color_hex,
::Settings::UserExperience.primary_brand_color_hex,
pattern: "^#+([a-fA-F0-9]{6})$",
title: "Provide a valid HEX Color or pick your color from the color picker.",
placeholder: ::Settings::UserExperience.primary_brand_color_hex,
class: "crayons-textfield js-color-field",
"data-action": "change->creator-settings#updateBranding" %>
<%= color_field_tag :primary_brand_color_hex,
::Settings::UserExperience.primary_brand_color_hex,
pattern: "^#+([a-fA-F0-9]{6})$",
placeholder: ::Settings::UserExperience.primary_brand_color_hex,
class: "crayons-color-selector js-color-field ml-2",
"data-action": "change->creator-settings#updateBranding",
required: true %>
</div>
</div>
</div>
<div class="crayons-field mt-6 align-left">
<fieldset aria-describedby="section-description">
<legend class="crayons-field__label mb-2">Who can join this community?</legend>
<div class="flex gap-3">
<div>
<%= radio_button_tag :invite_only_mode, "0", false, class: "crayons-radio" %>
<label for="invite_only_mode_0">Everyone</label>
</div>
<div>
<%= radio_button_tag :invite_only_mode, "1", true, class: "crayons-radio" %>
<label for="invite_only_mode_1">Invite only</label>
</div>
</div>
</fieldset>
</div>
<div class="crayons-field mt-6 align-left">
<fieldset aria-describedby="section-description">
<legend class="crayons-field__label mb-2">Who can view content in this community?</legend>
<div class="flex gap-3">
<div>
<%= radio_button_tag :public, "1", true, class: "crayons-radio" %>
<label for="public_0">Everyone</label>
</div>
<div>
<%= radio_button_tag :public, "0", false, class: "crayons-radio" %>
<label for="public_1">Members only</label>
</div>
</div>
</fieldset>
</div>
<div class="crayons-field mt-6 align-left">
<fieldset aria-describedby="section-description">
<legend class="crayons-field__label">Finally, please agree to the following:</legend>
<div>
<p class="crayons-field__description">You will have the opportunity to establish the Code of Conduct and Terms and Conditions for the users of your Forem during the setup process.</p>
<div class="mb-2">
<%= hidden_field_tag :checked_code_of_conduct, "0" %>
<%= check_box_tag :checked_code_of_conduct, "1", false, class: "crayons-checkbox", required: true %>
<label for="checked_code_of_conduct">I agree to uphold our <a href="/code-of-conduct">Code of Conduct</a>.</label>
</div>
<div>
<%= hidden_field_tag :checked_terms_and_conditions, "0" %>
<%= check_box_tag :checked_terms_and_conditions, "1", false, class: "crayons-checkbox", required: true %>
<label for="checked_terms_and_conditions">I agree to our <a href="/terms">Terms and Conditions</a>.</label>
</div>
</div>
</fieldset>
</div>