<% if flash[:notice] %>
<%= flash[:notice] %>
<% end %>
<%= form_for(User.new, as: :user, data: { testid: "registration-form" }, url: registration_path(:user)) do |f| %>
<% if defined?(resource) && resource&.errors&.any? %>
<% resource.errors.full_messages.each do |message| %>
- <%= message %>
<% end %>
<% elsif forem_creator_flow_enabled? %>
<%# TODO: Vaidehi Joshi - Extract this into its own form %>
Almost there!
Let's create an admin account for your community.
<% else %>
Create your account
<% end %>
<% if Settings::Authentication.display_email_domain_allow_list_publicly &&
Settings::Authentication.allowed_registration_email_domains.any? %>
<% if Settings::Authentication.allowed_registration_email_domains.one? %>
Registration restricted to
@<%= Settings::Authentication.allowed_registration_email_domains.first %> emails.
<% else %>
Registration restricted to the following emails
<% Settings::Authentication.allowed_registration_email_domains.each do |domain| %>
-
@<%= domain %>
<% end %>
<% end %>
<% end %>
<%= f.label :profile_image, class: "crayons-field__label" %>
<%= f.file_field :profile_image, accept: "image/*", class: "crayons-card crayons-card--secondary p-3 flex items-center flex-1 w-100", required: true %>
<%= f.label :name, class: "crayons-field__label" %>
<%= f.text_field :name, class: "crayons-textfield", required: true %>
<%= f.label :username, class: "crayons-field__label" %>
<%= f.text_field :username, class: "crayons-textfield", required: true %>
<%= f.label :email, class: "crayons-field__label" %>
<%= f.email_field :email, autocomplete: "email", class: "crayons-textfield", required: true %>
<%= f.label :password, class: "crayons-field__label" %>
<%= f.password_field :password, autocomplete: "current-password", class: "crayons-textfield", required: true %>
<%= f.label :password_confirmation, class: "crayons-field__label" %>
<%= f.password_field :password_confirmation, autocomplete: "current-password", class: "crayons-textfield", required: true %>
<% if ENV["FOREM_OWNER_SECRET"].present? && SiteConfig.waiting_on_first_user %>
<% if params[:forem_owner_secret].present? %>
<%= f.hidden_field :forem_owner_secret, value: params[:forem_owner_secret] %>
<% else %>
<%= f.label :forem_owner_secret, "New Forem Secret", class: "crayons-field__label" %>
<%= f.password_field :forem_owner_secret, class: "crayons-textfield", required: true, placeholder: "As provided by your Forem host" %>
<% end %>
<% end %>
<% if ReCaptcha::CheckRegistrationEnabled.call %>
<%= recaptcha_tags site_key: Settings::Authentication.recaptcha_site_key %>
<% end %>
<% if forem_creator_flow_enabled? %>
<%# TODO: Vaidehi Joshi - Extract this into its own form %>
<%= f.submit "Create admin account", class: "crayons-btn" %>
<% else %>
<%= f.submit "Sign up", class: "crayons-btn" %>
<% end %>
<% end %>