<h1>Sign up</h1>

<div class="notice is-info">
  <i class="fas fa-info-circle"></i> If you have an account on another <a href="https://codidact.com/">Codidact site</a>,
  don't create a new account here - <%= link_to 'sign in', new_user_session_path %> with your existing details instead.
</div>

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

  <div class="form-group">
    <%= f.label :email, class: "form-element" %>
    <%= f.email_field :email, class: 'form-element', autofocus: true, autocomplete: "email" %>
  </div>

  <div class="form-group">
    <%= f.label :username, class: "form-element" %>
    <%= f.text_field :username, class: 'form-element', autocomplete: 'off' %>
  </div>

  <div class="form-group">
    <%= f.label :password, class: "form-element" %>
    <% if @minimum_password_length %>
    <div class="form-caption">(<%= @minimum_password_length %> characters minimum)</div>
    <% end %>
    <%= f.password_field :password, class: 'form-element', autocomplete: "new-password" %>
  </div>

  <div class="form-group">
    <%= f.label :password_confirmation, class: "form-element" %>
    <%= f.password_field :password_confirmation, class: 'form-element', autocomplete: "new-password" %>
  </div>

  <div class="notice has-margin-top-4">
    <p>
      <i class="fas fa-exclamation-circle"></i> By signing up, you're agreeing to the
      <%= link_to 'terms of service', '/policy/tos' %>.
    </p>
    <p>
      <i class="fas fa-info-circle"></i> Signing up creates an account for you across our network of sites.
      When you visit any of our sites, your profile will automatically be ready and waiting for you.
    </p>
  </div>

  <div class="js-errors has-color-red-600 has-font-size-caption has-padding-2"></div>
  <%= f.submit "Sign up", class: "button is-filled is-very-large" %>

<% end %><br/>

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