- @wide = true
- page_title << "Signup"
.subPageBox__title
  Join the #{@user_invite.organizations.first.name} organization
= display_flash

.subPageBox__content
  %p.subPageBox__text
    If you don't already have an account on this system, you can create one below. Otherwise, you should
    #{link_to "login to your existing account", login_path(:return_to => join_path(@user_invite.uuid)), :class => 'u-link'}
    and add this organization to that.

  .signupForm
    = form_for @user, :url => signup_path do |f|
      = hidden_field_tag 'return_to', params[:return_to]
      = hidden_field_tag 'invite_token', params[:invite_token]
      = f.error_messages
      .fieldSet.fieldSet--compact.u-margin
        .fieldSet__fieldPair
          .fieldSet__field
            = f.label :first_name, :class => 'fieldSet__label'
            .fieldSet__input= f.text_field :first_name, :class => 'input input--text input--onWhite', :autofocus => true
          .fieldSet__field
            = f.label :last_name, :class => 'fieldSet__label'
            .fieldSet__input= f.text_field :last_name, :class => 'input input--text input--onWhite'
        .fieldSet__field
          = f.label :email_address, :class => 'fieldSet__label'
          .fieldSet__input= f.text_field :email_address, :class => 'input input--text input--onWhite'
        .fieldSet__fieldPair
          .fieldSet__field
            = f.label :password, :class => 'fieldSet__label'
            .fieldSet__input= f.password_field :password, :class => 'input input--text input--onWhite', :placeholder => '•••••••••••'
          .fieldSet__field
            = f.label :password_confirmation, "&nbsp;".html_safe, :class => 'fieldSet__label'
            .fieldSet__input= f.password_field :password_confirmation, :class => 'input input--text input--onWhite', :placeholder => '•••••••••••'

      .loginForm__submit
        %ul.loginForm__links
          %li= link_to "Back to login", login_path(:return_to => params[:return_to])
        %p= submit_tag "Create Account", :class => 'button button--positive', :tabindex => 3

