<commit_before><% content_for :title, "Edit #{@organization.name}" %>

<% content_for :content_size, "col-sm-9 col-md-10" %>

<% content_for :content do %>
  <%= form_for @organization, data: { live_guarded: true } do |f| %>
    <div>
      <% if current_user.can_update_organization_name? %>
        <div class="form-group">
          <%= f.label :name %>
          <div>
            <%= f.text_field :name, class: "form-control", data: { guard: "required" } %>
          </div>
        </div>
      <% end %>

      <div class="form-group">
        <%= f.label :email %>
        <div>
          <%= f.text_field :email, class: "form-control", data: { guard: "required email" } %>
        </div>
      </div>

      <div class="form-group">
        <%= f.label :phone_number, t(:organization_phone) %>
        <div>
          <%= f.telephone_field :phone_number, class: "form-control", data: { guard: "required phoneUS" } %>
        </div>
      </div>

      <div class="form-group">
        <%= f.label :address, "Mailing Address" %>
        <div>
          <%= f.text_field :address, class: "form-control", data: { guard: "required" } %>
        </div>
      </div>

      <% if current_user.can_update_organization_county? %>
        <div class="form-group">
          <%= f.label :county %>
          <div>
            <%= f.text_field :county, class: "form-control" %>
          </div>
        </div>
      <% end %>
    </div>

    <div>
      <input type="submit" class="btn btn-primary" value="Save" />
      <%= link_to "Cancel", cancel_edit_organization_path, type: "button", class: "btn btn-default" %>
      <%= link_to "Delete", organization_path(@organization), method: :delete, class: "btn btn-danger pull-right", data: confirm(title: "Deleting Organization: #{@organization.name}") %>
    </div>
  <% end %>
<% end %>
<commit_msg>Update edit org to accept new address functionality<commit_after><% content_for :title, "Edit #{@organization.name}" %>

<% content_for :content_size, "col-sm-9 col-md-10" %>

<% content_for :content do %>
  <%= form_for @organization, data: { live_guarded: true } do |f| %>
    <div id="organization_edit">
      <% if current_user.can_update_organization_name? %>
        <div class="form-group">
          <%= f.label :name %>
          <div>
            <%= f.text_field :name, class: "form-control", data: { guard: "required" } %>
          </div>
        </div>
      <% end %>

      <% if current_user.can_update_organization_county? %>
        <div class="form-group">
          <%= f.label :county %>
          <div>
            <%= f.text_field :county, class: "form-control" %>
          </div>
        </div>
      <% end %>

      <div class="form-group">
        <%= f.label :email %>
        <div>
          <%= f.text_field :email, class: "form-control", data: { guard: "required email" } %>
        </div>
      </div>

      <div class="form-group">
        <%= f.label :phone_number, t(:organization_phone) %>
        <div>
          <%= f.telephone_field :phone_number, class: "form-control", data: { guard: "required phoneUS" } %>
        </div>
      </div>

      <%= f.fields_for :addresses do |address| %>
        <div class="form-group">
          <%= address.label :address, "Mailing Address" %>
          <div>
            <%= address.text_field :address, class: "form-control", data: { guard: "different" } %>
          </div>
          Delete: <%= address.check_box :_destroy %>
        </div>
      <% end %>
    </div>

    <div class="form-group">
      <button id="add-new-address" type="button" class="btn btn-default">
        <span class="glyphicon glyphicon-plus" aria-hidden="true"></span> Add Mailing Address
      </button>
    </div>

    <div>
      <input type="submit" class="btn btn-primary" value="Save" />
      <%= link_to "Cancel", cancel_edit_organization_path, type: "button", class: "btn btn-default" %>
      <%= link_to "Delete", organization_path(@organization), method: :delete, class: "btn btn-danger pull-right", data: confirm(title: "Deleting Organization: #{@organization.name}") %>
    </div>
  <% end %>
<% end %>

{'fraction_non_alphanumeric': 0.18347067377605428, 'fraction_numerical': 0.001454192922927775, 'mean_word_length': 2.391125718981101, 'pattern_counts': {'":': 0, '<': 106, '<?xml version=': 0, '>': 106, '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': '3852736', 'n_tokens_mistral': 1435, 'n_tokens_neox': 1308, 'n_words': 292}