1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-08-05 13:35:21 +02:00

Stock filter (#1376)
Some checks are pending
Publish Docker image / ci (push) Waiting to run
Publish Docker image / Build docker image (push) Blocked by required conditions

* Initial pass at stock filtering

* Rough in filter

* Cleaning up security listing

* Tweak to search function

* Combobox tweaks

* Clean up search query

* Update trades test with combobox

* Update securities.yml
This commit is contained in:
Josh Pigford 2024-10-28 15:49:19 -04:00 committed by GitHub
parent c2561b5fb4
commit 7d8028b505
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 104 additions and 7 deletions

View file

@ -7,10 +7,12 @@
<div class="space-y-2">
<%= form.select :type, options_for_select([%w[Buy buy], %w[Sell sell], %w[Deposit transfer_in], %w[Withdrawal transfer_out], %w[Interest interest]], "buy"), { label: t(".type") }, { data: { "trade-form-target": "typeInput" } } %>
<div data-trade-form-target="tickerInput">
<%= form.text_field :ticker, value: nil, label: t(".holding"), placeholder: t(".ticker_placeholder") %>
<div class="form-field combobox">
<%= form.combobox :ticker, securities_account_trades_path(entry.account), label: t(".holding"), placeholder: t(".ticker_placeholder"), autocomplete: :list, free_text: true %>
</div>
</div>
<%= form.date_field :date, label: true %>
<%= form.date_field :date, label: true, value: Date.current %>
<div data-trade-form-target="amountInput" hidden>
<%= form.money_field :amount, label: t(".amount"), disable_currency: true %>

View file

@ -0,0 +1,7 @@
<div class="flex items-center">
<%= image_tag("https://logo.synthfinance.com/ticker/#{tickers&.ticker}", class: "rounded-full h-8 w-8 inline-block mr-2") %>
<div class="flex flex-col">
<span class="text-sm font-medium"><%= tickers&.name.presence || tickers&.ticker %></span>
<span class="text-xs text-gray-500"><%= "#{tickers&.ticker} (#{tickers&.exchange_acronym})" %></span>
</div>
</div>

View file

@ -0,0 +1,3 @@
<%= async_combobox_options @securities,
render_in: { partial: "account/trades/tickers" },
next_page: @pagy.next %>