mirror of
https://github.com/we-promise/sure.git
synced 2026-04-10 15:54:48 +00:00
* pwa(cleanup): enforce LF, head meta + icons, manifest orientation, remove static webmanifest * pwa(cleanup): add gitattributes, head meta/icons, manifest orientation; remove static manifest; small nav & dashboard fixes * pwa(cleanup): improve transaction drawer header layout with inline close button * fix: address PR review feedback - Add dom_id to transaction header for Turbo Stream updates (Codex) - Add pending badge next to date when transaction is pending (CodeRabbit) - Make close button keyboard-focusable by removing tabindex=-1 (CodeRabbit) - Fix settings nav horizontal scroll with flex-nowrap space-x-1 (CodeRabbit) * fix: localize 'Linked with Plaid' tooltip string (CodeRabbit) * Update .gitattributes Better comment smh * fix: align transaction/transfer dialog icons and update transfer drawer pattern - Fix icon alignment in transaction header (items-center instead of items-start) - Make transfer/linked icons consistent size and color - Update transfers/show.html.erb to use frame: drawer with hide_close_icon pattern - Match transfer dialog header layout with transaction details * fix: enhance header layout This in the transaction and transfer views, with consistent icon placement * fix: remove fixed height from HTML document class basically a regression issue pretty sure * fix: update dialog rendering to use 'frame' and hide close icon in headers * fix: update transaction type tabs layout for improved responsiveness * fix: conditionally render transaction type tabs based on account type
103 lines
3.8 KiB
Plaintext
103 lines
3.8 KiB
Plaintext
<%= render DS::Dialog.new(frame: "drawer") do |dialog| %>
|
|
<% dialog.with_header(hide_close_icon: true) do %>
|
|
<%= render "trades/header", entry: @entry %>
|
|
<% end %>
|
|
|
|
<% trade = @entry.trade %>
|
|
|
|
<% dialog.with_body do %>
|
|
<%= render "entries/protection_indicator", entry: @entry, unlock_path: unlock_trade_path(trade) %>
|
|
|
|
<% dialog.with_section(title: t(".details"), open: true) do %>
|
|
<div class="pb-4">
|
|
<%= styled_form_with model: @entry,
|
|
url: trade_path(@entry),
|
|
class: "space-y-2",
|
|
data: { controller: "auto-submit-form" } do |f| %>
|
|
<%= f.date_field :date,
|
|
label: t(".date_label"),
|
|
max: Date.current,
|
|
disabled: @entry.linked?,
|
|
"data-auto-submit-form-target": "auto" %>
|
|
|
|
<div class="flex items-center gap-2">
|
|
<%= f.select :nature,
|
|
[[t(".buy"), "outflow"], [t(".sell"), "inflow"]],
|
|
{ container_class: "w-1/3", label: t(".type_label"), selected: @entry.amount.negative? ? "outflow" : "inflow" },
|
|
{ data: { "auto-submit-form-target": "auto" }, disabled: @entry.linked? } %>
|
|
|
|
<%= f.fields_for :entryable do |ef| %>
|
|
<%= ef.number_field :qty,
|
|
label: t(".quantity_label"),
|
|
step: "any",
|
|
value: trade.qty.abs,
|
|
"data-auto-submit-form-target": "auto",
|
|
disabled: @entry.linked? %>
|
|
<% end %>
|
|
</div>
|
|
|
|
<%= f.fields_for :entryable do |ef| %>
|
|
<%= ef.money_field :price,
|
|
label: t(".cost_per_share_label"),
|
|
disable_currency: true,
|
|
auto_submit: true,
|
|
min: 0,
|
|
step: "any",
|
|
precision: 10,
|
|
disabled: @entry.linked? %>
|
|
<% end %>
|
|
<% end %>
|
|
</div>
|
|
<% end %>
|
|
|
|
<% dialog.with_section(title: t(".additional")) do %>
|
|
<div class="pb-4">
|
|
<%= styled_form_with model: @entry,
|
|
url: trade_path(@entry),
|
|
class: "space-y-2",
|
|
data: { controller: "auto-submit-form" } do |f| %>
|
|
<%= f.text_area :notes,
|
|
label: t(".note_label"),
|
|
placeholder: t(".note_placeholder"),
|
|
rows: 5,
|
|
"data-auto-submit-form-target": "auto" %>
|
|
<% end %>
|
|
</div>
|
|
<% end %>
|
|
|
|
<% dialog.with_section(title: t(".settings")) do %>
|
|
<div class="pb-4">
|
|
<!-- Exclude Trade Form -->
|
|
<%= styled_form_with model: @entry,
|
|
url: trade_path(@entry),
|
|
class: "p-3",
|
|
data: { controller: "auto-submit-form" } do |f| %>
|
|
<div class="flex cursor-pointer items-center gap-2 justify-between">
|
|
<div class="text-sm space-y-1">
|
|
<h4 class="text-primary"><%= t(".exclude_title") %></h4>
|
|
<p class="text-secondary"><%= t(".exclude_subtitle") %></p>
|
|
</div>
|
|
|
|
<%= f.toggle :excluded, { data: { auto_submit_form_target: "auto" } } %>
|
|
</div>
|
|
<% end %>
|
|
|
|
<!-- Delete Trade Form -->
|
|
<div class="flex items-center justify-between gap-2 p-3">
|
|
<div class="text-sm space-y-1">
|
|
<h4 class="text-primary"><%= t(".delete_title") %></h4>
|
|
<p class="text-secondary"><%= t(".delete_subtitle") %></p>
|
|
</div>
|
|
|
|
<%= button_to t(".delete"),
|
|
entry_path(@entry),
|
|
method: :delete,
|
|
class: "rounded-lg px-3 py-2 text-red-500 text-sm
|
|
font-medium border border-secondary",
|
|
data: { turbo_confirm: true } %>
|
|
</div>
|
|
</div>
|
|
<% end %>
|
|
<% end %>
|
|
<% end %>
|