mirror of
https://github.com/we-promise/sure.git
synced 2026-04-17 19:14:11 +00:00
* Add lookbook + viewcomponent, organize design system file * Build menu component * Button updates * More button fixes * Replace all menus with new ViewComponent * Checkpoint: fix tests, all buttons and menus converted * Split into Link and Button components for clarity * Button cleanup * Simplify custom confirmation configuration in views * Finalize button, link component API * Add toggle field to custom form builder + Component * Basic tabs component * Custom tabs, convert all menu / tab instances in app * Gem updates * Centralized icon helper * Update all icon usage to central helper * Lint fixes * Centralize all disclosure instances * Dialog replacements * Consolidation of all dialog styles * Test fixes * Fix app layout issues, move to component with slots * Layout simplification * Flakey test fix * Fix dashboard mobile issues * Finalize homepage * Lint fixes * Fix shadows and borders in dark mode * Fix tests * Remove stale class * Fix filled icon logic * Move transparent? to public interface
64 lines
2.2 KiB
Plaintext
64 lines
2.2 KiB
Plaintext
<%= render DialogComponent.new do |dialog| %>
|
|
<% dialog.with_header(title: "Match transfer or payment") %>
|
|
<% dialog.with_body do %>
|
|
<%= styled_form_with(
|
|
url: transaction_transfer_match_path(@entry),
|
|
scope: :transfer_match,
|
|
class: "space-y-8",
|
|
data: { turbo_frame: :_top }
|
|
) do |f| %>
|
|
<section class="space-y-4">
|
|
<div class="space-y-2">
|
|
<h2 class="text-sm font-medium text-gray-700">
|
|
<%= @entry.amount.positive? ? "From account: #{@entry.account.name}" : "From account" %>
|
|
</h2>
|
|
|
|
<% if @entry.amount.positive? %>
|
|
<%= f.select(
|
|
:entry_id,
|
|
[[entry_name_detailed(@entry), @entry.id]],
|
|
{
|
|
label: "Outflow transaction",
|
|
selected: @entry.id,
|
|
},
|
|
disabled: true
|
|
) %>
|
|
<% else %>
|
|
<%= render "transfer_matches/matching_fields",
|
|
form: f, entry: @entry, candidates: @transfer_match_candidates.map { |pm| pm.outflow_transaction.entry }, accounts: @accounts %>
|
|
<% end %>
|
|
</div>
|
|
</section>
|
|
|
|
<div class="flex justify-center py-2">
|
|
<%= icon "arrow-down" %>
|
|
</div>
|
|
|
|
<section class="space-y-4">
|
|
<div class="space-y-2">
|
|
<h2 class="text-sm font-medium text-gray-700">
|
|
<%= @entry.amount.negative? ? "To account: #{@entry.account.name}" : "To account" %>
|
|
</h2>
|
|
|
|
<% if @entry.amount.negative? %>
|
|
<%= f.select(
|
|
:entry_id,
|
|
[[entry_name_detailed(@entry), @entry.id]],
|
|
{
|
|
label: "Inflow transaction",
|
|
selected: @entry.id,
|
|
},
|
|
disabled: true
|
|
) %>
|
|
<% else %>
|
|
<%= render "transfer_matches/matching_fields",
|
|
form: f, entry: @entry, candidates: @transfer_match_candidates.map { |pm| pm.inflow_transaction.entry }, accounts: @accounts %>
|
|
<% end %>
|
|
</div>
|
|
</section>
|
|
|
|
<%= f.submit "Create transfer match" %>
|
|
<% end %>
|
|
<% end %>
|
|
<% end %>
|