%= form_with(url: url, model: donation, local: true) do |form| %> <% if donation.errors.any? %> <%= pluralize(donation.errors.count, "error") %> prohibited this donation from being saved: <% donation.errors.full_messages.each do |message| %> <%= message %> <% end %> <% end %> <%= form.label :user_id %> <%= form.collection_select :user_id, User.where(ou: Setting.primary_domain).order(:cn), :id, :cn, {} %> <%= form.label :donation_method, "Donation method" %> <%= form.select :donation_method, options_for_select([ ["Custom (manual)", "custom"], ["BTCPay", "btcpay"], ["LndHub account", "lndhub"], ["OpenCollective", "opencollective"] ], selected: (donation.donation_method || "custom")) %> <%= form.label :amount_sats, "Amount BTC (sats)" %> <%= form.number_field :amount_sats %> <%= form.label :fiat_amount, "Fiat Amount (cents)" %> <%= form.number_field :fiat_amount %> <%= form.label :fiat_currency, "Fiat Currency" %> <%= form.select :fiat_currency, options_for_select([ ["EUR", "EUR"], ["USD", "USD"], ["sats", "sats"] ], selected: donation.fiat_currency) %> <%= form.label :public_name %> <%= form.text_field :public_name %> <%= form.label :paid_at %> <%= form.text_field :paid_at %> <%= link_to 'Cancel', @donation.id.present? ? admin_donation_path(@donation) : admin_donations_path, class: 'btn-md btn-gray' %> <%= form.submit class: 'ml-2 btn-md btn-blue' %> <% end %>
<%= link_to 'Cancel', @donation.id.present? ? admin_donation_path(@donation) : admin_donations_path, class: 'btn-md btn-gray' %> <%= form.submit class: 'ml-2 btn-md btn-blue' %>