mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-27 09:09:41 +02:00
Add merchant select when editing transaction (#885)
This commit is contained in:
parent
73ecf0b912
commit
b462bc8f8c
3 changed files with 28 additions and 20 deletions
|
@ -27,9 +27,9 @@
|
||||||
</summary>
|
</summary>
|
||||||
|
|
||||||
<div class="pb-6 space-y-2">
|
<div class="pb-6 space-y-2">
|
||||||
<%= form.date_field :date, label: t(".date"), max: Date.current %>
|
<%= form.date_field :date, label: t(".date_label"), max: Date.current %>
|
||||||
<%= form.collection_select :category_id, Current.family.transaction_categories, :id, :name, { prompt: t(".select_category"), label: t(".category"), class: "text-gray-400" } %>
|
<%= form.collection_select :category_id, Current.family.transaction_categories.alphabetically, :id, :name, { prompt: t(".category_placeholder"), label: t(".category_label"), class: "text-gray-400" } %>
|
||||||
<%= form.collection_select :merchant_id, Current.family.transaction_merchants, :id, :name, { prompt: t(".select_merchant"), label: t(".merchant"), class: "text-gray-400" } %>
|
<%= form.collection_select :merchant_id, Current.family.transaction_merchants.alphabetically, :id, :name, { prompt: t(".merchant_placeholder"), label: t(".merchant_label"), class: "text-gray-400" } %>
|
||||||
</div>
|
</div>
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@
|
||||||
</summary>
|
</summary>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<%= form.text_area :notes, label: t(".note"), placeholder: t(".note_placeholder"), rows: 5 %>
|
<%= form.text_area :notes, label: t(".note_label"), placeholder: t(".note_placeholder"), rows: 5 %>
|
||||||
</div>
|
</div>
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
|
|
|
@ -19,9 +19,10 @@
|
||||||
<div class="pb-6">
|
<div class="pb-6">
|
||||||
<%= form_with model: @transaction, html: { data: { controller: "auto-submit-form" } } do |f| %>
|
<%= form_with model: @transaction, html: { data: { controller: "auto-submit-form" } } do |f| %>
|
||||||
<div class="space-y-2">
|
<div class="space-y-2">
|
||||||
<%= f.date_field :date, label: "Date", max: Date.today, "data-auto-submit-form-target": "auto" %>
|
<%= f.date_field :date, label: t(".date_label"), max: Date.today, "data-auto-submit-form-target": "auto" %>
|
||||||
<%= f.collection_select :category_id, Current.family.transaction_categories, :id, :name, { prompt: "Select a category", label: "Category", class: "text-gray-400" }, "data-auto-submit-form-target": "auto" %>
|
<%= f.collection_select :category_id, Current.family.transaction_categories.alphabetically, :id, :name, { prompt: t(".category_placeholder"), label: t(".category_label"), class: "text-gray-400" }, "data-auto-submit-form-target": "auto" %>
|
||||||
<%= f.collection_select :account_id, Current.family.accounts, :id, :name, { prompt: "Select an Account", label: "Account", class: "text-gray-500" }, { class: "form-field__input cursor-not-allowed text-gray-400", disabled: "disabled" } %>
|
<%= f.collection_select :merchant_id, Current.family.transaction_merchants.alphabetically, :id, :name, { prompt: t(".merchant_placeholder"), label: t(".merchant_label"), class: "text-gray-400" }, "data-auto-submit-form-target": "auto" %>
|
||||||
|
<%= f.collection_select :account_id, Current.family.accounts.alphabetically, :id, :name, { prompt: t(".account_placeholder"), label: t(".account_label"), class: "text-gray-500" }, { class: "form-field__input cursor-not-allowed text-gray-400", disabled: "disabled" } %>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
@ -35,7 +36,7 @@
|
||||||
|
|
||||||
<div class="pb-6">
|
<div class="pb-6">
|
||||||
<%= form_with model: @transaction, html: { data: { controller: "auto-submit-form" } } do |f| %>
|
<%= form_with model: @transaction, html: { data: { controller: "auto-submit-form" } } do |f| %>
|
||||||
<%= f.text_field :name, label: "Name", "data-auto-submit-form-target": "auto" %>
|
<%= f.text_field :name, label: t(".name_label"), "data-auto-submit-form-target": "auto" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
</details>
|
</details>
|
||||||
|
@ -52,14 +53,11 @@
|
||||||
options_for_select(Current.family.tags.alphabetically.pluck(:name, :id), @transaction.tag_ids),
|
options_for_select(Current.family.tags.alphabetically.pluck(:name, :id), @transaction.tag_ids),
|
||||||
{
|
{
|
||||||
multiple: true,
|
multiple: true,
|
||||||
label: t(".select_tags"),
|
label: t(".tags_label"),
|
||||||
class: "placeholder:text-gray-500"
|
class: "placeholder:text-gray-500"
|
||||||
},
|
},
|
||||||
"data-auto-submit-form-target": "auto" %>
|
"data-auto-submit-form-target": "auto" %>
|
||||||
<% end %>
|
<%= f.text_area :notes, label: t(".note_label"), placeholder: t(".note_placeholder"), "data-auto-submit-form-target": "auto" %>
|
||||||
|
|
||||||
<%= form_with model: @transaction, html: { data: { controller: "auto-submit-form" } } do |f| %>
|
|
||||||
<%= f.text_area :notes, label: "Notes", placeholder: "Enter a note", "data-auto-submit-form-target": "auto" %>
|
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
</details>
|
</details>
|
||||||
|
|
|
@ -6,18 +6,18 @@ en:
|
||||||
bulk_edit:
|
bulk_edit:
|
||||||
additional: Additional
|
additional: Additional
|
||||||
cancel: Cancel
|
cancel: Cancel
|
||||||
category: Category
|
category_label: Category
|
||||||
date: Date
|
category_placeholder: Select a category
|
||||||
|
date_label: Date
|
||||||
exclude_subtitle: This excludes the transaction from any in-app features or
|
exclude_subtitle: This excludes the transaction from any in-app features or
|
||||||
analytics.
|
analytics.
|
||||||
exclude_title: Exclude transaction
|
exclude_title: Exclude transaction
|
||||||
merchant: Merchant
|
merchant_label: Merchant
|
||||||
note: Notes
|
merchant_placeholder: Select a merchant
|
||||||
|
note_label: Notes
|
||||||
note_placeholder: Enter a note that will be applied to selected transactions
|
note_placeholder: Enter a note that will be applied to selected transactions
|
||||||
overview: Overview
|
overview: Overview
|
||||||
save: Save
|
save: Save
|
||||||
select_category: Select a category
|
|
||||||
select_merchant: Select a merchant
|
|
||||||
settings: Settings
|
settings: Settings
|
||||||
bulk_update:
|
bulk_update:
|
||||||
failure: Could not update transactions
|
failure: Could not update transactions
|
||||||
|
@ -117,7 +117,12 @@ en:
|
||||||
update:
|
update:
|
||||||
success: Merchant updated successfully
|
success: Merchant updated successfully
|
||||||
show:
|
show:
|
||||||
|
account_label: Account
|
||||||
|
account_placeholder: Select an account
|
||||||
additional: Additional
|
additional: Additional
|
||||||
|
category_label: Category
|
||||||
|
category_placeholder: Select a category
|
||||||
|
date_label: Date
|
||||||
delete: Delete
|
delete: Delete
|
||||||
delete_subtitle: This permanently deletes the transaction, affects your historical
|
delete_subtitle: This permanently deletes the transaction, affects your historical
|
||||||
balances, and cannot be undone.
|
balances, and cannot be undone.
|
||||||
|
@ -126,8 +131,13 @@ en:
|
||||||
exclude_subtitle: This excludes the transaction from any in-app features or
|
exclude_subtitle: This excludes the transaction from any in-app features or
|
||||||
analytics.
|
analytics.
|
||||||
exclude_title: Exclude transaction
|
exclude_title: Exclude transaction
|
||||||
|
merchant_label: Merchant
|
||||||
|
merchant_placeholder: Select a merchant
|
||||||
|
name_label: Name
|
||||||
|
note_label: Notes
|
||||||
|
note_placeholder: Enter a note
|
||||||
overview: Overview
|
overview: Overview
|
||||||
select_tags: Select one or more tags
|
|
||||||
settings: Settings
|
settings: Settings
|
||||||
|
tags_label: Select one or more tags
|
||||||
update:
|
update:
|
||||||
success: Transaction updated successfully
|
success: Transaction updated successfully
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue