<% provide :title, t("devise_views.users.registrations.new.title") %>
<h2><%= t("devise_views.users.registrations.new.title") %></h2>

<%= render "devise/omniauth_form", action: "sign_up" %>

<%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %>
  <%= render "shared/errors", resource: resource %>

  <p>
    <%= sanitize(t("devise_views.users.registrations.new.organization_signup",
                   signup_link: link_to(t("devise_views.users.registrations.new.organization_signup_link"),
                                        new_organization_registration_path))) %>
  </p>

  <div class="row">
    <div class="small-12 column">

      <%= f.hidden_field :use_redeemable_code %>
      <%= f.hidden_field :locale, value: I18n.locale %>

      <%= f.text_field :username,  autofocus: true, maxlength: User.username_max_length,
                                   hint: t("devise_views.users.registrations.new.username_note") %>

      <%= f.invisible_captcha :address %>

      <%= f.email_field :email %>

      <%= f.password_field :password, autocomplete: "off" %>

      <%= f.password_field :password_confirmation, autocomplete: "off",
                                                   label: t("devise_views.users.registrations.new.password_confirmation_label") %>

      <% if resource.use_redeemable_code %>
        <%= f.text_field :redeemable_code %>
      <% end %>

      <%= f.check_box :terms_of_service,
                      label: t("devise_views.users.registrations.new.terms",
                               terms: new_window_link_to(t("devise_views.users.registrations.new.terms_link"),
                                                         "/conditions")) %>

      <div class="small-12 medium-6 small-centered">
        <%= f.submit t("devise_views.users.registrations.new.submit"), class: "button expanded" %>
      </div>
    </div>
  </div>
<% end %>

<%= render "devise/shared/links" %>
