mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-07 06:25:19 +02:00
Create shared ruler and standardize across views (#2240)
* Create shared ruler view * Use collection rendering/spacer templates for rules, and new shared_ruler * Use shared ruler for all the places a ruler is used * Use shared ruler for imports and balance sheet * Fix brakeman by using a static partial with a defined collection * Update balance sheet
This commit is contained in:
parent
868d4ede6e
commit
443b834b46
30 changed files with 35 additions and 68 deletions
|
@ -1,5 +1,6 @@
|
|||
<%# locals: (rule:) %>
|
||||
<div class="flex justify-between items-center p-4 <%= rule.active? ? "text-primary" : "text-secondary" %>">
|
||||
<div id="<%= dom_id(rule) %>" class="flex justify-between items-center p-4 <%= rule.active? ? 'text-primary' : 'text-secondary' %>">
|
||||
|
||||
<div class="text-sm space-y-1.5">
|
||||
<% if rule.name.present? %>
|
||||
<h3 class="font-medium text-md"><%= rule.name %></h3>
|
||||
|
|
|
@ -59,12 +59,7 @@
|
|||
</div>
|
||||
<div class="p-1">
|
||||
<div class="flex flex-col bg-container rounded-xl shadow-border-xs first_child:rounded-t-xl last_child:rounded-b-xl">
|
||||
<% @rules.each_with_index do |rule, idx| %>
|
||||
<%= render "rule", rule: rule %>
|
||||
<% unless idx == @rules.size - 1 %>
|
||||
<div class="h-px bg-divider ml-4 mr-6"></div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<%= render partial: "rule", collection: @rules, spacer_template: "shared/ruler" %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue