<commit_before><% if user_signed_in? %>
  Please sign out first
<% elsif @invite.expired? %>
  This invitation is expired
<% else %>
  TODO: Show user invitation form
  NOTE: Make sure to show how long before it expires
<% end %><commit_msg>Flesh out invitation confirmation page<commit_after><h4>Create Account</h4>

<% if user_signed_in? %>
  <p>
    Please sign out before completing your invitation.
  </p>
<% elsif @invite.expired? %>
  <p>
    This invitation has expired. Please request a new invitation.
  </p>
<% else %>
  <p>
    <em>
      This invitation expires in
      <strong><%= distance_of_time_in_words(Time.zone.now, @invite.expires_at) %></strong>
    </em>
  </p>

  <div class="well">
    <%= form_tag user_invitation_path(@invite), method: :put, data: { live_guarded: true } do %>
      <input name="auth_token" type="hidden" value="<%= @invite.auth_token %>" />

      <fieldset>
        <div class="form-group">
          <label class="control-label" for="user-organization">Organization</label>
          <div>
            <p class="form-control-static" id="user-organization">
              <%= @invite.organization.name %>
            </p>
          </div>
        </div>

        <div class="form-group">
          <label class="control-label" for="user-email">Email</label>
          <div>
            <p class="form-control-static" id="user-email">
              <%= @invite.email %>
            </p>
            <input name="email" type="hidden" value="<%= @invite.email %>" />
          </div>
        </div>

        <div class="form-group">
          <label class="control-label" for="user-name">Name</label>
          <div>
            <input id="user-name" name="name" type="text" class="form-control input-md" data-guard="required" value="<%= @invite.name %>" />
          </div>
        </div>

        <div class="form-group">
          <label class="control-label" for="user-phone">Phone Number</label>
          <div>
            <input id="user-phone" name="phone_number" type="text" class="form-control input-md" data-guard="required phoneUS" />
          </div>
        </div>

        <div class="form-group">
          <label class="control-label" for="user-address">Address</label>
          <div>
            <input id="user-address" name="address" type="text" class="form-control input-md" data-guard="required" value="<%= @invite.organization.address %>" />
          </div>
        </div>

        <div class="form-group">
          <label class="control-label" for="user-password">Password</label>
          <div>
            <input id="user-password" name="password" type="password" class="form-control input-md" data-guard="required same" />
          </div>
        </div>

        <div class="form-group">
          <label class="control-label" for="user-password-confirmation">Password Confirmation</label>
          <div>
            <input id="user-password-confirmation" name="password_confirmation" type="password" class="form-control input-md" data-guard="required same" />
          </div>
        </div>
      </fieldset>

      <div>
        <input type="submit" class="btn btn-primary" value="Save" />
      </div>
    <% end %>
  </div>
<% end %>
{'fraction_non_alphanumeric': 0.17013996889580094, 'fraction_numerical': 0.0006220839813374805, 'mean_word_length': 2.439572192513369, 'pattern_counts': {'":': 0, '<': 92, '<?xml version=': 0, '>': 92, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6633071', 'n_tokens_mistral': 1015, 'n_tokens_neox': 973, 'n_words': 215}