2024-04-18 07:56:51 -04:00
|
|
|
<% content_for :sidebar do %>
|
|
|
|
<%= render "settings/nav" %>
|
|
|
|
<% end %>
|
2024-03-07 10:55:51 -05:00
|
|
|
<div class="space-y-4">
|
|
|
|
<div class="flex items-center justify-between">
|
|
|
|
<h1 class="text-xl font-medium text-gray-900">Accounts</h1>
|
2024-05-03 12:11:31 +00:00
|
|
|
<%= link_to new_account_path, class: "flex text-white text-sm font-medium items-center gap-1 bg-gray-900 rounded-lg p-2 pr-3", data: { turbo_frame: "modal" } do %>
|
2024-03-07 10:55:51 -05:00
|
|
|
<%= lucide_icon("plus", class: "w-5 h-5") %>
|
2024-04-09 16:08:58 +04:00
|
|
|
<span><%= t(".new_account") %></span>
|
2024-03-07 10:55:51 -05:00
|
|
|
<% end %>
|
|
|
|
</div>
|
2024-04-18 07:56:51 -04:00
|
|
|
<% if @accounts.empty? %>
|
2024-03-07 10:55:51 -05:00
|
|
|
<div class="flex justify-center items-center h-[800px] text-sm">
|
|
|
|
<div class="text-center flex flex-col items-center max-w-[300px]">
|
|
|
|
<p class="text-gray-900 mb-1 font-medium">No accounts yet</p>
|
|
|
|
<p class="text-gray-500 mb-4">Add an account either via connection, importing or entering manually.</p>
|
2024-05-03 12:11:31 +00:00
|
|
|
<%= link_to new_account_path, class: "w-fit flex text-white text-sm font-medium items-center gap-1 bg-gray-900 rounded-lg p-2 pr-3", data: { turbo_frame: "modal" } do %>
|
2024-03-07 10:55:51 -05:00
|
|
|
<%= lucide_icon("plus", class: "w-5 h-5") %>
|
2024-04-09 16:08:58 +04:00
|
|
|
<span><%= t(".new_account") %></span>
|
2024-03-07 10:55:51 -05:00
|
|
|
<% end %>
|
2024-02-02 23:06:29 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2024-03-07 10:55:51 -05:00
|
|
|
<% else %>
|
|
|
|
<div>
|
2024-04-18 07:56:51 -04:00
|
|
|
<% @accounts.by_provider.each do |item| %>
|
|
|
|
<details open class="bg-white group p-4 border border-alpha-black-25 shadow-xs rounded-xl">
|
2024-03-07 10:55:51 -05:00
|
|
|
<summary class="flex items-center gap-2">
|
|
|
|
<%= lucide_icon("chevron-down", class: "hidden group-open:block w-5 h-5 text-gray-500") %>
|
|
|
|
<%= lucide_icon("chevron-right", class: "group-open:hidden w-5 h-5 text-gray-500") %>
|
|
|
|
<% if item[:name] == "Manual accounts" %>
|
|
|
|
<div class="flex items-center justify-center h-8 w-8 rounded-full bg-black/5">
|
|
|
|
<%= lucide_icon("folder-pen", class: "w-5 h-5 text-gray-500") %>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
<span class="text-sm font-medium text-gray-900">
|
|
|
|
<%= item[:name] %>
|
|
|
|
</span>
|
|
|
|
</summary>
|
|
|
|
<div class="space-y-4 mt-4">
|
|
|
|
<% item[:accounts].each do |group, accounts| %>
|
|
|
|
<div class="bg-gray-25 p-1 rounded-xl">
|
|
|
|
<div class="flex items-center px-4 py-2 text-xs font-medium text-gray-500">
|
|
|
|
<p><%= to_accountable_title(Accountable.from_type(group)) %></p>
|
|
|
|
<span class="text-gray-400 mx-2">·</span>
|
|
|
|
<p><%= accounts.count %></p>
|
2024-04-09 16:08:58 +04:00
|
|
|
<p class="ml-auto"><%= format_money accounts.sum(&:balance_money) %></p>
|
2024-03-07 10:55:51 -05:00
|
|
|
</div>
|
|
|
|
<div class="bg-white">
|
|
|
|
<% accounts.each do |account| %>
|
|
|
|
<%= render account %>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
</details>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
2024-04-18 07:56:51 -04:00
|
|
|
<div class="flex justify-between gap-4">
|
|
|
|
<% if self_hosted? %>
|
2024-04-25 14:55:39 -04:00
|
|
|
<%= previous_setting("Self-Hosting", settings_hosting_path) %>
|
2024-04-18 07:56:51 -04:00
|
|
|
<% else %>
|
|
|
|
<%= previous_setting("Billing", settings_billing_path) %>
|
|
|
|
<% end %>
|
2024-05-23 08:09:33 -04:00
|
|
|
<%= next_setting("Tags", tags_path) %>
|
2024-04-18 07:56:51 -04:00
|
|
|
</div>
|
2024-03-07 10:55:51 -05:00
|
|
|
</div>
|