<% current_credits = @organization.unspent_credits_count %>
Credits (currrent: <%= current_credits %>)
<%= form_tag update_org_credits_admin_organization_path(@organization), method: :patch, class: "form-inline justify-content-between mb-2" do %>
<%= hidden_field_tag :credit_action, :add %>
<%= number_field_tag :credits, nil, in: 1...100_000, required: true, class: "form-control mr-3", size: 5, aria: { label: "Credits" } %>
<%= text_field_tag :note, "", placeholder: "Why are you adding these credits?", size: 50, required: true, class: "form-control mr-3", aria: { label: "Reason" } %>
<%= submit_tag "Add Org Credits", class: "btn btn-primary" %>
<% end %>
<% if current_credits.positive? %>
<%= form_tag update_org_credits_admin_organization_path(@organization), method: :patch, class: "form-inline justify-content-between mb-2" do %>
<%= hidden_field_tag :credit_action, :remove %>
<%= number_field_tag :credits, nil, in: 1..current_credits, required: true, class: "form-control mr-3", size: 5, aria: { label: "Credits" } %>
<%= text_field_tag :note, "", placeholder: "Why are you removing these credits?", size: 50, required: true, class: "form-control mr-3", aria: { label: "Reason" } %>
<%= submit_tag "Remove Org Credits", class: "btn btn-danger" %>
<% end %>
<% end %>
<%= render "activity" %>