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

<%= render 'devise/omniauth_form' %>

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

  <p>
    <%= 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)).html_safe %>
  </p>

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

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

      <%= f.label :username %>
      <p class="note"><%= t("devise_views.users.registrations.new.username_note") %></p>
      <%= f.text_field  :username, maxlength: User.username_max_length, placeholder: t("devise_views.users.registrations.new.username_label"), label: false %>

      <%= f.invisible_captcha :family_name %>

      <%= f.email_field :email,     placeholder: t("devise_views.users.registrations.new.email_label") %>


      <%= f.password_field :password, autocomplete: "off",
                           placeholder: t("devise_views.users.registrations.new.password_label") %>

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

      <% if resource.use_redeemable_code %>
        <%= f.text_field :redeemable_code, placeholder: t("devise_views.users.registrations.new.redeemable_code") %>
      <% end %>

      <%= f.label :terms_of_service do %>
        <%= f.check_box :terms_of_service, title: t('devise_views.users.registrations.new.terms_title'), label: false %>
        <span class="checkbox">
          <%= t("devise_views.users.registrations.new.terms",
              terms: link_to(t("devise_views.users.registrations.new.terms_link"), "/conditions",
              title: t('shared.target_blank_html'),
              target: "_blank")).html_safe %>
        </span>
      <% end %>

      <%= f.submit t("devise_views.users.registrations.new.submit"), class: "button expanded" %>
    </div>
  </div>
<% end %>

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