1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-08-06 22:15:20 +02:00

Finish remaining transaction filters (#1189)

* Add type filters to transaction search

* Add amount filter
This commit is contained in:
Zach Gollwitzer 2024-09-17 10:38:02 -04:00 committed by GitHub
parent e06f0c76f9
commit 730e58d763
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 164 additions and 30 deletions

View file

@ -1,3 +1,5 @@
<%# locals: (form:) %>
<div
id="transaction-filters-menu"
data-menu-target="content"
@ -14,24 +16,33 @@
data-tabs-target="btn"
data-action="tabs#select">
<%= lucide_icon(filter[:icon], class: "w-5 h-5") %>
<span class="text-sm font-medium"><%= filter[:name] %></span>
<span class="text-sm font-medium"><%= t(".#{filter[:key]}") %></span>
</button>
<% end %>
</div>
<div class="flex flex-col grow">
<div class="grow p-2 border-b border-b-alpha-black-100 overflow-y-auto">
<div class="grow p-3 border-b border-b-alpha-black-100 overflow-y-auto">
<% transaction_search_filters.each do |filter| %>
<div id="<%= filter[:key] %>" data-tabs-target="tab">
<%= render partial: get_transaction_search_filter_partial_path(filter), locals: { form: form } %>
</div>
<% end %>
</div>
<div class="flex justify-end items-center gap-2 bg-white p-3">
<%= button_tag type: "reset", data: { action: "menu#close" }, class: "py-2 px-3 bg-gray-50 rounded-lg text-sm text-gray-900 font-medium" do %>
Cancel
<% end %>
<%= form.submit "Apply", name: nil, class: "py-2 px-3 bg-gray-900 hover:bg-gray-700 rounded-lg text-sm text-white font-medium cursor-pointer" %>
<div class="flex justify-between items-center gap-2 bg-white p-3">
<div>
<% if @q.present? %>
<%= link_to t(".clear_filters"), transactions_path, class: "text-sm underline text-gray-500" %>
<% end %>
</div>
<div>
<%= button_tag type: "reset", data: { action: "menu#close" }, class: "py-2 px-3 bg-gray-50 rounded-lg text-sm text-gray-900 font-medium" do %>
<%= t(".cancel") %>
<% end %>
<%= form.submit t(".apply"), name: nil, class: "py-2 px-3 bg-gray-900 hover:bg-gray-700 rounded-lg text-sm text-white font-medium cursor-pointer" %>
</div>
</div>
</div>
</div>