<% title _('Create an account to view the plan') %>
<div class="row">
  <div class="col-md-12">
    <h1><%= _("Create an account to view the plan") %></h1>
    <p><%= _("You will need to create an account in order to accept your invitation to view the data management plan (DMP).") %></p>
  </div>
</div>

<div class="row">
  <div class="col-md-12">
    <%= form_for resource, as: resource_name, url: invitation_path(resource_name), html: {method: :put, id: "invitation_create_account_form"} do |f| %>
      <%= devise_error_messages! %>
      <%= f.hidden_field :invitation_token %>
      <div class="form-group">
        <%= f.label(:password, _('New password'), class: 'control-label') %>
        <%= f.password_field(:password, class: 'form-control', "aria-required": true) %>
      </div>
      <div class="form-group">
        <%= f.label(:password_confirmation, _('Password confirmation'), class: 'control-label') %>
        <%= f.password_field(:password_confirmation, class: 'form-control', "aria-required": true) %>
      </div>
      <div class="form-group">
        <%= f.label(:firstname, _('First name'), class: 'control-label') %>
        <%= f.text_field(:firstname, class: "form-control", "aria-required": true, value: @user.firstname) %>
      </div>
      <div class="form-group">
        <%= f.label(:surname, _('Last name'), class: 'control-label') %>
        <%= f.text_field(:surname, class: "form-control", "aria-required": true, value: @user.surname) %>
      </div>
      <div class="form-group" id="org-controls">
        <%= render partial: "shared/my_org", locals: {f: f, default_org: @user.org, orgs: Org.all, allow_other_orgs: true, required: true} %>
      </div>
      <%= f.button(_('Create account'), class: "btn btn-default", type: "submit") %>
    <% end %>
  </div>
</div>
