mirror of
https://github.com/we-promise/sure.git
synced 2026-05-27 14:34:56 +00:00
* add missing Hungarian translations for newly extracted strings Replace hard-coded UI strings with I18n lookups across controllers, models and views (breadcrumbs, dashboard, reports, settings, transactions, balance sheet, MFA status). Update models to use translations for category defaults, account/display names, classification group and period labels; remove a few hardcoded display_name methods. Add and update numerous locale files (English and extensive Hungarian translations, plus model/view/doorkeeper entries) to provide the required keys. These changes centralize copy for localization and prepare the app for Hungarian/English UI text. * Pluralize account type labels; tidy Crypto model Update English locale account type labels to use plural forms for consistency (Investment(s), Properties, Vehicles, Other Assets, Credit Cards, Loans, Other Liabilities). Also remove an extra blank line in app/models/crypto.rb to tidy up formatting. * Back to singular * fix(i18n): separate singular and group account labels * Update _accountable_group.html.erb * Use I18n plural names for account types Change Accountable#display_name to look up pluralized account type names via I18n (accounts.types_plural.<underscored_class>) with a fallback to the legacy display logic. Add legacy_display_name helper to preserve previous behavior (singular for Depository and Crypto, pluralized otherwise). Add corresponding types_plural entries in English and Hungarian locale files for various account types. --------- Co-authored-by: Juan José Mata <jjmata@jjmata.com> Co-authored-by: sure-admin <sure-admin@splashblot.com>
69 lines
3.3 KiB
Plaintext
69 lines
3.3 KiB
Plaintext
<%# locals: (account_group:, mobile: false, all_tab: false, open: nil, **args) %>
|
|
|
|
<div id="<%= account_group.dom_id(tab: all_tab ? :all : nil, mobile: mobile) %>">
|
|
<% is_open = open.nil? ? account_group.accounts.any? { |account| page_active?(account_path(account)) } : open %>
|
|
<%= render DS::Disclosure.new(align: :left, open: is_open) do |disclosure| %>
|
|
<% disclosure.with_summary_content do %>
|
|
<div class="flex items-center gap-3">
|
|
<%= icon "chevron-right", class: "group-open:transform group-open:rotate-90" %>
|
|
<%= tag.span class: class_names("text-sm text-primary font-medium", "animate-pulse" => account_group.syncing?) do %>
|
|
<%= account_group.name %>
|
|
<% end %>
|
|
</div>
|
|
|
|
<div class="ml-auto text-right grow">
|
|
<%= tag.p format_money(account_group.total_money), class: "text-sm font-medium text-primary privacy-sensitive" %>
|
|
<%= turbo_frame_tag "#{account_group.key}_sparkline", src: accountable_sparkline_path(account_group.key), loading: "lazy", data: { controller: "turbo-frame-timeout", turbo_frame_timeout_timeout_value: 10000 } do %>
|
|
<div class="flex items-center w-8 h-4 ml-auto">
|
|
<div class="w-6 h-px bg-loader"></div>
|
|
</div>
|
|
<% end %>
|
|
</div>
|
|
<% end %>
|
|
|
|
<div class="space-y-1">
|
|
<% account_group.accounts.each do |account| %>
|
|
<%= link_to account_path(account),
|
|
class: class_names(
|
|
"block flex items-center gap-2 px-3 py-2 rounded-lg",
|
|
page_active?(account_path(account)) ? "bg-container" : "hover:bg-surface-hover"
|
|
),
|
|
title: account.name do %>
|
|
<%= render "accounts/logo", account: account, size: "sm", color: account_group.color %>
|
|
|
|
<div class="min-w-0 grow">
|
|
<div class="flex items-center gap-2 mb-0.5">
|
|
<%= tag.p account.name, class: class_names("text-sm text-primary font-medium truncate", "animate-pulse" => account.syncing?) %>
|
|
<% if account.shared? %>
|
|
<%= icon("users", class: "w-3 h-3 text-secondary shrink-0") %>
|
|
<% end %>
|
|
</div>
|
|
<%= tag.p account.short_subtype_label, class: "text-sm text-secondary truncate" %>
|
|
</div>
|
|
|
|
<div class="ml-auto text-right grow h-10">
|
|
<%= tag.p format_money(account.balance_money), class: "text-sm font-medium text-primary whitespace-nowrap privacy-sensitive" %>
|
|
<%= turbo_frame_tag dom_id(account, :sparkline), src: sparkline_account_path(account), loading: "lazy", data: { controller: "turbo-frame-timeout", turbo_frame_timeout_timeout_value: 10000 } do %>
|
|
<div class="flex items-center w-8 h-4 ml-auto">
|
|
<div class="w-6 h-px bg-loader"></div>
|
|
</div>
|
|
<% end %>
|
|
</div>
|
|
<% end %>
|
|
<% end %>
|
|
</div>
|
|
|
|
<div class="my-2">
|
|
<%= render DS::Link.new(
|
|
href: new_polymorphic_path(account_group.key, step: "method_select"),
|
|
text: t("accounts.sidebar.new_account_group", account_group: account_group.accountable_type.singular_display_name.downcase),
|
|
icon: "plus",
|
|
full_width: true,
|
|
variant: "ghost",
|
|
frame: :modal,
|
|
class: "justify-start"
|
|
) %>
|
|
</div>
|
|
<% end %>
|
|
</div>
|