mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-19 13:19:39 +02:00
Fix transaction form account pre-filling and form styles
This commit is contained in:
parent
a1d64d6c2e
commit
752835f492
3 changed files with 9 additions and 9 deletions
|
@ -330,7 +330,7 @@
|
|||
}
|
||||
|
||||
.form-field__input {
|
||||
@apply border-none bg-transparent text-sm opacity-100 w-full p-0;
|
||||
@apply text-primary border-none bg-transparent text-sm opacity-100 w-full p-0;
|
||||
@apply focus:opacity-100 focus:outline-hidden focus:ring-0;
|
||||
@apply placeholder-shown:opacity-50;
|
||||
@apply disabled:text-subdued;
|
||||
|
|
|
@ -1,23 +1,23 @@
|
|||
<fieldset class="bg-gray-50 rounded-lg p-1 grid grid-flow-col justify-stretch gap-x-2">
|
||||
<% active_tab = local_assigns[:active_tab] || "expense" %>
|
||||
<%# locals: (active_tab:, account_id: nil) %>
|
||||
|
||||
<%= link_to new_transaction_path(nature: "outflow"),
|
||||
<fieldset class="bg-surface-inset rounded-lg p-1 grid grid-flow-col justify-stretch gap-x-2">
|
||||
<%= link_to new_transaction_path(nature: "outflow", account_id: account_id),
|
||||
data: { turbo_frame: :modal },
|
||||
class: "flex px-4 py-1 rounded-lg items-center space-x-2 justify-center text-sm md:text-normal text-subdued #{active_tab == 'expense' ? 'bg-container text-gray-800 shadow-sm' : 'hover:bg-container hover:text-gray-800 hover:shadow-sm'}" do %>
|
||||
class: "flex px-4 py-1 rounded-lg items-center space-x-2 justify-center text-sm #{active_tab == 'expense' ? 'bg-container text-primary shadow-sm' : 'hover:bg-container text-subdued hover:text-primary hover:shadow-sm'}" do %>
|
||||
<%= icon "minus-circle" %>
|
||||
<%= tag.span t("shared.transaction_tabs.expense") %>
|
||||
<% end %>
|
||||
|
||||
<%= link_to new_transaction_path(nature: "inflow"),
|
||||
<%= link_to new_transaction_path(nature: "inflow", account_id: account_id),
|
||||
data: { turbo_frame: :modal },
|
||||
class: "flex px-4 py-1 rounded-lg items-center space-x-2 justify-center text-sm md:text-normal text-subdued #{active_tab == 'income' ? 'bg-container text-gray-800 shadow-sm' : 'hover:bg-container hover:text-gray-800 hover:shadow-sm'}" do %>
|
||||
class: "flex px-4 py-1 rounded-lg items-center space-x-2 justify-center text-sm #{active_tab == 'income' ? 'bg-container text-primary shadow-sm' : 'hover:bg-container text-subdued hover:text-primary hover:shadow-sm'}" do %>
|
||||
<%= icon "plus-circle" %>
|
||||
<%= tag.span t("shared.transaction_tabs.income") %>
|
||||
<% end %>
|
||||
|
||||
<%= link_to new_transfer_path,
|
||||
data: { turbo_frame: :modal },
|
||||
class: "flex px-4 py-1 rounded-lg items-center space-x-2 justify-center text-sm md:text-normal text-subdued #{active_tab == 'transfer' ? 'bg-container text-gray-800 shadow-sm' : 'hover:bg-container hover:text-gray-800 hover:shadow-sm'}" do %>
|
||||
class: "flex px-4 py-1 rounded-lg items-center space-x-2 justify-center text-sm #{active_tab == 'transfer' ? 'bg-container text-primary shadow-sm' : 'hover:bg-container text-subdued hover:text-primary hover:shadow-sm'}" do %>
|
||||
<%= icon "arrow-right-left" %>
|
||||
<%= tag.span t("shared.transaction_tabs.transfer") %>
|
||||
<% end %>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<% end %>
|
||||
|
||||
<section>
|
||||
<%= render "shared/transaction_type_tabs", active_tab: params[:nature] == "inflow" ? "income" : "expense" %>
|
||||
<%= render "shared/transaction_type_tabs", active_tab: params[:nature] == "inflow" ? "income" : "expense", account_id: params[:account_id] %>
|
||||
|
||||
<%= f.hidden_field :nature, value: params[:nature] || "outflow", data: { "transaction-form-target": "natureField" } %>
|
||||
<%= f.hidden_field :entryable_type, value: "Transaction" %>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue