mirror of
https://github.com/we-promise/sure.git
synced 2026-04-23 14:04:06 +00:00
* Initial account sharing changes * Update schema.rb * Update schema.rb * Change sharing UI to modal * UX fixes and sharing controls * Scope include in finances better * Update totals.rb * Update totals.rb * Scope reports to finance account scope * Update impersonation_sessions_controller_test.rb * Review fixes * Update schema.rb * Update show.html.erb * FIX db validation * Refine edit permissions * Review items * Review * Review * Add application level helper * Critical review * Address remaining review items * Fix modals * more scoping * linter * small UI fix * Fix: Sync broadcasts push unscoped balance sheet to all users * Update sync_complete_event.rb The fix removes the sidebar broadcasts (which rendered unscoped account groups using family.balance_sheet without user context) along with the now-unused sidebar_targets, account_group, and family_balance_sheet private methods. The sidebar will still update correctly — when the sync completes, Family::SyncCompleteEvent#broadcast fires family.broadcast_refresh, which triggers a morph-based page refresh for each user with their own authenticated session, rendering properly scoped sidebar content.
78 lines
3.1 KiB
Plaintext
78 lines
3.1 KiB
Plaintext
<%= content_for :page_title, t(".page_title") %>
|
|
|
|
<%= settings_section title: t(".general_title"), subtitle: t(".general_subtitle") do %>
|
|
<div>
|
|
<%= styled_form_with model: @user, class: "space-y-4", data: { controller: "auto-submit-form" } do |form| %>
|
|
<%= form.hidden_field :redirect_to, value: "preferences" %>
|
|
|
|
<%= form.select :locale,
|
|
language_options,
|
|
{ label: t(".language"), include_blank: t(".language_auto") },
|
|
{ data: { auto_submit_form_target: "auto" } } %>
|
|
|
|
<%= form.fields_for :family do |family_form| %>
|
|
<%= family_form.select :currency,
|
|
Money::Currency.as_options.map { |currency| [ "#{currency.name} (#{currency.iso_code})", currency.iso_code ] },
|
|
{ label: t(".currency") }, disabled: true %>
|
|
|
|
<%= family_form.select :timezone,
|
|
timezone_options,
|
|
{ label: t(".timezone") },
|
|
{ data: { auto_submit_form_target: "auto" } } %>
|
|
|
|
<%= family_form.select :date_format,
|
|
Family::DATE_FORMATS,
|
|
{ label: t(".date_format") },
|
|
{ data: { auto_submit_form_target: "auto" } } %>
|
|
|
|
<%= form.select :default_period,
|
|
Period.all.map { |period| [ period.label, period.key ] },
|
|
{ label: t(".default_period") },
|
|
{ data: { auto_submit_form_target: "auto" } } %>
|
|
|
|
<%= form.select :default_account_order,
|
|
AccountOrder.all.map { |order| [ order.label, order.key ] },
|
|
{ label: t(".default_account_order") },
|
|
{ data: { auto_submit_form_target: "auto" } } %>
|
|
|
|
<%= family_form.select :country,
|
|
country_options,
|
|
{ label: t(".country") },
|
|
{ data: { auto_submit_form_target: "auto" } } %>
|
|
|
|
<%= family_form.select :month_start_day,
|
|
(1..28).map { |day| [day.ordinalize, day] },
|
|
{ label: t(".month_start_day"), hint: t(".month_start_day_hint") },
|
|
{ data: { auto_submit_form_target: "auto" } } %>
|
|
|
|
<% if @user.family.uses_custom_month_start? %>
|
|
<div class="text-sm text-warning bg-warning/10 p-3 rounded-lg">
|
|
<%= t(".month_start_day_warning") %>
|
|
</div>
|
|
<% end %>
|
|
|
|
<p class="text-xs italic pl-2 text-secondary">Please note, we are still working on translations for various languages.</p>
|
|
<% end %>
|
|
<% end %>
|
|
</div>
|
|
<% end %>
|
|
|
|
<% if Current.user.admin? %>
|
|
<%= settings_section title: t(".sharing_title", moniker: family_moniker), subtitle: t(".sharing_subtitle", moniker: family_moniker_downcase) do %>
|
|
<div>
|
|
<%= styled_form_with model: @user, class: "space-y-4", data: { controller: "auto-submit-form" } do |form| %>
|
|
<%= form.hidden_field :redirect_to, value: "preferences" %>
|
|
<%= form.fields_for :family do |family_form| %>
|
|
<%= family_form.select :default_account_sharing,
|
|
[
|
|
[t(".sharing_shared"), "shared"],
|
|
[t(".sharing_private"), "private"]
|
|
],
|
|
{ label: t(".sharing_default_label") },
|
|
{ data: { auto_submit_form_target: "auto" } } %>
|
|
<% end %>
|
|
<% end %>
|
|
</div>
|
|
<% end %>
|
|
<% end %>
|