mirror of
https://github.com/we-promise/sure.git
synced 2026-04-11 16:24:51 +00:00
* Move Transfer to Account namespace * Fix partial resolution due to namespacing plurality * Make category and tag controllers consistent with namespacing convention * Update stale partial reference
25 lines
1.6 KiB
Plaintext
25 lines
1.6 KiB
Plaintext
<%= form_with model: @transaction, data: { turbo_frame: "_top" } do |f| %>
|
|
<section>
|
|
<fieldset class="bg-gray-50 rounded-lg p-1 grid grid-flow-col justify-stretch gap-x-2">
|
|
<%= radio_tab_tag form: f, name: :nature, value: :expense, label: t(".expense"), icon: "minus-circle", checked: params[:nature] == "expense" || params[:nature].nil? %>
|
|
<%= radio_tab_tag form: f, name: :nature, value: :income, label: t(".income"), icon: "plus-circle", checked: params[:nature] == "income" %>
|
|
<%= link_to new_account_transfer_path, data: { turbo_frame: :modal }, class: "flex px-4 py-1 rounded-lg items-center space-x-2 justify-center text-gray-400 group-has-[:checked]:bg-white group-has-[:checked]:text-gray-800 group-has-[:checked]:shadow-sm" do %>
|
|
<%= lucide_icon "arrow-right-left", class: "w-5 h-5" %>
|
|
<%= tag.span t(".transfer") %>
|
|
<% end %>
|
|
</fieldset>
|
|
</section>
|
|
|
|
<section class="space-y-2">
|
|
<%= f.text_field :name, label: t(".description"), placeholder: t(".description_placeholder"), required: true %>
|
|
<%= f.collection_select :account_id, Current.family.accounts.alphabetically, :id, :name, { prompt: t(".account_prompt"), label: t(".account") }, required: true %>
|
|
<%= f.money_field :amount_money, label: t(".amount"), required: true %>
|
|
<%= f.collection_select :category_id, Current.family.categories.alphabetically, :id, :name, { prompt: t(".category_prompt"), label: t(".category") } %>
|
|
<%= f.date_field :date, label: t(".date"), required: true, max: Date.today %>
|
|
</section>
|
|
|
|
<section>
|
|
<%= f.submit t(".submit") %>
|
|
</section>
|
|
<% end %>
|