mirror of
https://github.com/we-promise/sure.git
synced 2026-08-05 08:32:15 +00:00
* refactor(settings): header-less settings_section variant + migrate guides
Add a title:nil branch to settings_section so a page can route through the one
canonical surface recipe (bg-container shadow-border-xs rounded-xl p-4 space-y-4)
without a section header. No visual change to existing titled callers.
Migrate the guides page onto it: replace the hand-rolled card + hardcoded
'Guides' page title with settings_section + t('.page_title') (new locale key).
First step of the settings design-consistency pass.
* refactor(family-exports): un-nest exports list
The exports list rendered 'Exports' three times (page h1 + settings_section
title + inset count header) inside three stacked surfaces (section card >
bg-container-inset > inner bg-container table card). Flatten it:
- settings_section header-less (drop the duplicate title; the page h1 + the
inset count header already label it),
- drop the redundant inner space-y-4 wrapper,
- table sits directly in the inset (remove the inner bg-container card).
Now: one title, one card, one inset.
* refactor(settings): payments + appearances consistency
- payments: subscription summary row was bg-container inside the section's
bg-container (container-on-container) -> bg-container-inset + p-4.
- appearances: toggle-row labels used <h4> (heading-level break inside a
settings_section) -> <p font-medium>.
* refactor(settings): preferences consistency
- month_start_day warning: text-warning bg-warning/10 colored-body-text box
-> DS::Alert(:warning) (neutral-text recipe).
- preview-features block: hand-rolled <section bg-container shadow-border-xs
rounded-xl p-4> -> header-less settings_section (canonical surface).
- toggle-row <h4> -> <p font-medium>; text-[11px] base-currency badge -> text-xs.
* refactor(settings): profiles consistency
- unconfirmed-email notice was hardcoded English -> i18n
(unconfirmed_email_notice_html + resend_confirmation_link keys).
- role + pending chips: bespoke 'rounded-md bg-surface px-1.5 py-0.5 uppercase'
pills -> DS::Pill (tone: gray, badge mode).
- pending-invitation row border: border-alpha-black-25 -> shadow-border-xs
(match the member-row token).
66 lines
2.5 KiB
Plaintext
66 lines
2.5 KiB
Plaintext
<%= content_for :page_title, t(".page_title") %>
|
|
|
|
<%= settings_section title: t(".subscription_title"), subtitle: t(".subscription_subtitle") do %>
|
|
<div class="space-y-4">
|
|
<div class="p-4 bg-container-inset rounded-lg flex justify-between items-center">
|
|
<div class="flex items-center gap-3">
|
|
<%= render DS::FilledIcon.new(
|
|
icon: "gem",
|
|
rounded: true,
|
|
size: "lg"
|
|
) %>
|
|
|
|
<div class="text-sm space-y-1">
|
|
<% if @family.has_active_subscription? %>
|
|
<p class="text-primary">
|
|
<span><%= t(".currently_on_plan") %> <span class="font-medium"><%= @family.subscription.name %></span>.</span> <br>
|
|
|
|
<% if @family.next_payment_date %>
|
|
<% if @family.subscription_pending_cancellation? %>
|
|
<span><%= t("views.settings.payments.cancellation", date: l(@family.next_payment_date, format: :long)) %></span>
|
|
<% else %>
|
|
<span><%= t("views.settings.payments.renewal", date: l(@family.next_payment_date, format: :long)) %></span>
|
|
<% end %>
|
|
<% end %>
|
|
</p>
|
|
<% elsif @family.trialing? %>
|
|
<p class="text-primary">
|
|
<%= t(".trialing", product_name: product_name) %> <br>
|
|
<span class="text-secondary">
|
|
(<%= t(".trial_days_left", count: @family.days_left_in_trial) %>)
|
|
</span>
|
|
</p>
|
|
<% else %>
|
|
<p class="text-primary"><%= t(".not_contributing_prefix") %> <span class="font-medium"><%= t(".not_contributing_emphasis") %></span></p>
|
|
<p class="text-secondary"><%= t(".contributions_note", product_name: product_name) %></p>
|
|
<% end %>
|
|
</div>
|
|
</div>
|
|
|
|
<% if @family.has_active_subscription? %>
|
|
<%= render DS::Link.new(
|
|
text: t(".manage"),
|
|
icon: "external-link",
|
|
variant: "primary",
|
|
icon_position: "right",
|
|
href: subscription_path,
|
|
rel: "noopener"
|
|
) %>
|
|
<% else %>
|
|
<%= render DS::Link.new(
|
|
text: t(".choose_level"),
|
|
variant: "primary",
|
|
icon: "plus",
|
|
icon_position: "right",
|
|
href: upgrade_subscription_path(view: "upgrade"),
|
|
rel: "noopener") %>
|
|
<% end %>
|
|
</div>
|
|
|
|
<div class="flex items-center gap-2">
|
|
<%= image_tag "stripe-logo.svg", class: "w-5 h-5 shrink-0" %>
|
|
<p class="text-secondary text-sm"><%= t(".payment_via_stripe") %></p>
|
|
</div>
|
|
</div>
|
|
<% end %>
|