Files
sure/app/views/akahu_items/select_existing_account.html.erb
Brad 1b8b21760b feat(provider): Akahu integration (#1921)
* First pass of Akahu

* fix up sync all

* conflicts

* fix db migration issue? - fix auto selection of akahu account type

* Address Akahu PR feedback

* Complete provider metadata

* Fix PR 1921 CI tests

* PR feedback

* PR feedback

* post merge

---------

Co-authored-by: failing <failing@users.noreply.github.com>
Co-authored-by: Juan José Mata <jjmata@jjmata.com>
Co-authored-by: sure-admin <sure-admin@splashblot.com>
2026-06-02 21:44:57 +02:00

51 lines
2.2 KiB
Plaintext

<%= turbo_frame_tag "modal" do %>
<%= render DS::Dialog.new do |dialog| %>
<% dialog.with_header(title: t(".title", account_name: @account.name)) %>
<% dialog.with_body do %>
<div class="space-y-4">
<% if @api_error.present? %>
<%= render DS::Alert.new(message: @api_error, variant: :error) %>
<% elsif @akahu_accounts.empty? %>
<p class="text-sm text-secondary"><%= t(".no_accounts_found") %></p>
<% else %>
<p class="text-sm text-secondary"><%= t(".description") %></p>
<%= form_with url: link_existing_account_akahu_items_path,
method: :post,
data: { turbo_frame: "_top" },
class: "space-y-4" do %>
<%= hidden_field_tag :akahu_item_id, @akahu_item.id %>
<%= hidden_field_tag :account_id, @account.id %>
<%= hidden_field_tag :return_to, @return_to %>
<div class="space-y-2">
<% @akahu_accounts.each do |akahu_account| %>
<label class="flex items-start gap-3 p-3 border border-primary rounded-lg hover:bg-surface cursor-pointer transition-colors">
<%= radio_button_tag "akahu_account_id", akahu_account.id, false, class: "mt-1" %>
<div class="flex-1">
<div class="font-medium text-sm text-primary"><%= akahu_account.name %></div>
<div class="text-xs text-secondary mt-1">
<%= [akahu_account.formatted_account, akahu_account.currency, akahu_account.account_type].compact.join(" · ") %>
</div>
</div>
</label>
<% end %>
</div>
<div class="flex gap-2 justify-end pt-4">
<%= render DS::Link.new(
text: t(".cancel"),
href: @return_to || accounts_path,
variant: :secondary,
data: { turbo_frame: "_top", action: "DS--dialog#close" }
) %>
<%= render DS::Button.new(text: t(".link_account"), type: "submit") %>
</div>
<% end %>
<% end %>
</div>
<% end %>
<% end %>
<% end %>