<div class="row">
  <div class="col-12">
    <h2>Credits</h2>
    <hr>
    <h4 class="mt-3"><%= @user.username %></h4>
    <p>Available User Credits: <%= @user.unspent_credits_count %></p>
    <%= form_with scope: :user, url: internal_user_path(@user), method: :patch, local: true, html: { class: "form-inline justify-content-between mb-2" } do |f| %>
      <div class="form-group">
        <%= f.text_field :add_credits, placeholder: "#", size: 5, class: "form-control mr-3" %>
        <%= f.text_field :new_note, placeholder: "Why are you adding these credits?", size: 50, required: true, class: "form-control" %>
      </div>
      <%= f.submit "Add Credits", class: "btn btn-primary" %>
    <% end %>
    <%= form_with scope: :user, url: internal_user_path(@user), method: :patch, local: true, html: { class: "form-inline justify-content-between mb-2" } do |f| %>
      <div class="form-group">
        <%= f.text_field :remove_credits, placeholder: "#", size: 5, class: "form-control mr-3" %>
        <%= f.text_field :new_note, placeholder: "Why are you removing these credits?", size: 50, required: true, class: "form-control" %>
      </div>
      <%= f.submit "Remove Credits", class: "btn btn-danger" %>
    <% end %>
    <hr>
  </div>
  <div class="col-12">
    <h4>Organizations</h4>
    <%= form_with scope: :user, url: internal_user_path(@user), method: :patch, local: true, html: { class: "form-inline justify-content-between mb-2" } do |f| %>
      <div class="form-group">
        <%= f.text_field :add_org_credits, placeholder: "#", size: 5, class: "form-control mr-3" %>
        <%= f.text_field :new_note, placeholder: "Why are you adding these credits?", size: 50, required: true, class: "form-control mr-3" %>
        <%= f.collection_select :organization_id, @organizations, :id, :name, {}, { class: 'form-control' } %>
      </div>
      <%= f.submit "Add Org Credits", class: "btn btn-primary" %>
    <% end %> 
    <%= form_with scope: :user, url: internal_user_path(@user), method: :patch, local: true, html: { class: "form-inline justify-content-between mb-2" } do |f| %>
      <div class="form-group">
        <%= f.text_field :remove_org_credits, placeholder: "#", size: 5, class: "form-control mr-3" %>
        <%= f.text_field :new_note, placeholder: "Why are you removing these credits?", size: 50, required: true, class: "form-control mr-3" %>
        <%= f.collection_select :organization_id, @organizations, :id, :name, {}, { class: 'form-control' } %>
      </div>
      <%= f.submit "Remove Org Credits", class: "btn btn-danger" %>
    <% end %>
    <hr>
  </div>
</div>
