mirror of
https://github.com/we-promise/sure.git
synced 2026-04-19 03:54:08 +00:00
* Remove balance mode, sketch out refactor * Activity view checkpoint * Entry partials, checkpoint * Finish txn partial * Give entries context when editing for different turbo responses * Calculate change of balance for each entry * Account tabs consolidation * Translations, linting, brakeman updates * Account actions concern * Finalize forms, get account system tests passing * Get tests passing * Lint, rubocop, schema updates * Improve routing and stream responses * Fix broken routes * Add import option for adding accounts * Fix system test * Fix test specificity * Fix sparklines * Improve account redirects
40 lines
1.5 KiB
Plaintext
40 lines
1.5 KiB
Plaintext
<%# locals: (entry:, selectable: true, show_balance: false, origin: nil) %>
|
|
|
|
<% account = entry.account %>
|
|
<% valuation = entry.account_valuation %>
|
|
|
|
<div class="p-4 grid grid-cols-12 items-center text-gray-900 text-sm font-medium">
|
|
<div class="col-span-8 flex items-center gap-4">
|
|
<% if selectable %>
|
|
<%= check_box_tag dom_id(entry, "selection"),
|
|
class: "maybe-checkbox maybe-checkbox--light",
|
|
data: { id: entry.id, "bulk-select-target": "row", action: "bulk-select#toggleRowSelection" } %>
|
|
<% end %>
|
|
|
|
<div class="flex items-center gap-3">
|
|
<%= tag.div class: "w-8 h-8 rounded-full p-1.5 flex items-center justify-center", style: mixed_hex_styles(valuation.color) do %>
|
|
<%= lucide_icon valuation.icon, class: "w-4 h-4" %>
|
|
<% end %>
|
|
|
|
<div class="truncate text-gray-900">
|
|
<% if entry.new_record? %>
|
|
<%= content_tag :p, entry.name %>
|
|
<% else %>
|
|
<%= link_to valuation.name,
|
|
account_entry_path(account, entry),
|
|
data: { turbo_frame: "drawer", turbo_prefetch: false },
|
|
class: "hover:underline hover:text-gray-800" %>
|
|
<% end %>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-span-2 justify-self-end font-medium text-sm" style="color: <%= valuation.color %>">
|
|
<%= tag.span format_money(entry.trend.value) %>
|
|
</div>
|
|
|
|
<div class="col-span-2 justify-self-end">
|
|
<%= tag.p format_money(entry.amount_money), class: "font-medium text-sm text-gray-900" %>
|
|
</div>
|
|
</div>
|