<!-- SPDX-License-Identifier: MIT
     SPDX-FileCopyrightText: 2025 Soren Stoutner <soren@stoutner.com>

     This file is part of Redmine Simple Captcha.  <https://github.com/sorenstoutner/redmine_simple_captcha>
     See LICENSE for more information. -->

<h2><%=l(:label_register)%></h2>

<%= labelled_form_for @user, :url => register_path do |f| %>
<%= error_messages_for 'user' %>

<div class="box tabular">
<% if @user.auth_source_id.nil? %>
  <p><%= f.text_field :login, :size => 25, :required => true %></p>

  <p><%= f.password_field :password, :size => 25, :required => true %>
  <em class="info"><%= l(:text_caracters_minimum, :count => Setting.password_min_length) %></em></p>

  <p><%= f.password_field :password_confirmation, :size => 25, :required => true %></p>
<% end %>

<p><%= f.text_field :firstname, :required => true %></p>
<p><%= f.text_field :lastname, :required => true %></p>
<p><%= f.text_field :mail, :required => true %></p>
<p><%= f.select :language, lang_options_for_select %></p>

<% @user.custom_field_values.select {|v| v.editable? || v.required?}.each do |value| %>
  <p><%= custom_field_tag_with_label :user, value %></p>
<% end %>

<p><label for="simple_captcha_question"><%= t('field_simple_captcha_question') %></label><span id="simple_captcha_question"><%= Setting.plugin_redmine_simple_captcha['simple_captcha_question'] %></span></p>
<p><%= f.text_field :simple_captcha_answer, :required => true %></p>
</div>

<%= submit_tag l(:button_submit) %>
<% end %>
