mirror of
https://github.com/we-promise/sure.git
synced 2026-04-09 15:24:48 +00:00
* Add localization for onboarding goals across multiple languages * Add password requirements localization for multiple languages * Refactor localization keys for authentication messages * Add `oidc` localization key for multiple languages * Add OIDC account localization for multiple languages * Add localization for trial and profile setup across multiple languages * Refactor OIDC button label fallback to prioritize label presence over localization key * Refactor onboarding tests to use I18n for text assertions and button labels * Linter * Last test fix?!? * We keep both `oidc` and `openid_connect` due to contatenation issues --------- Co-authored-by: Juan José Mata <juanjo.mata@gmail.com>
79 lines
3.1 KiB
Plaintext
79 lines
3.1 KiB
Plaintext
<%
|
|
header_title @user_exists ? t("oidc_accounts.link.title_link") : t("oidc_accounts.link.title_create")
|
|
%>
|
|
|
|
<% if @user_exists %>
|
|
<div class="mb-6 p-4 bg-yellow-50 border border-yellow-200 rounded-md">
|
|
<h3 class="text-sm font-medium text-yellow-800 mb-2"><%= t("oidc_accounts.link.verify_heading") %></h3>
|
|
<p class="text-sm text-yellow-700">
|
|
<% email_suffix = @pending_auth["email"].present? ? t("oidc_accounts.link.email_suffix_html", email: @pending_auth["email"]) : "" %>
|
|
<%= t("oidc_accounts.link.verify_description_html", provider: @pending_auth["provider"], email_suffix: email_suffix).html_safe %>
|
|
</p>
|
|
</div>
|
|
|
|
<%= styled_form_with url: create_link_oidc_account_path, class: "space-y-4", data: { turbo: false } do |form| %>
|
|
<%= form.email_field :email,
|
|
label: t("oidc_accounts.link.email_label"),
|
|
autofocus: false,
|
|
autocomplete: "email",
|
|
required: "required",
|
|
placeholder: t("oidc_accounts.link.email_placeholder"),
|
|
value: @email %>
|
|
|
|
<%= form.password_field :password,
|
|
label: t("oidc_accounts.link.password_label"),
|
|
required: "required",
|
|
placeholder: t("oidc_accounts.link.password_placeholder"),
|
|
autocomplete: "current-password" %>
|
|
|
|
<div class="text-sm text-gray-600 mt-2">
|
|
<p><%= t("oidc_accounts.link.verify_hint") %></p>
|
|
</div>
|
|
|
|
<%= form.submit t("oidc_accounts.link.submit_link") %>
|
|
<% end %>
|
|
<% else %>
|
|
<div class="mb-6 p-4 bg-blue-50 border border-blue-200 rounded-md">
|
|
<h3 class="text-sm font-medium text-blue-800 mb-2"><%= t("oidc_accounts.link.create_heading") %></h3>
|
|
<p class="text-sm text-blue-700">
|
|
<%= t("oidc_accounts.link.create_description_html", email: @pending_auth["email"], provider: @pending_auth["provider"]).html_safe %>
|
|
</p>
|
|
</div>
|
|
|
|
<div class="space-y-4">
|
|
<div class="p-4 bg-container border border-secondary rounded-md">
|
|
<p class="text-sm text-primary">
|
|
<strong><%= t("oidc_accounts.link.info_email") %></strong> <%= @pending_auth["email"] %>
|
|
</p>
|
|
<% if @pending_auth["name"].present? %>
|
|
<p class="text-sm text-primary mt-2">
|
|
<strong><%= t("oidc_accounts.link.info_name") %></strong> <%= @pending_auth["name"] %>
|
|
</p>
|
|
<% end %>
|
|
</div>
|
|
|
|
<% if @allow_account_creation %>
|
|
<%= render DS::Button.new(
|
|
text: t("oidc_accounts.link.submit_create"),
|
|
href: create_user_oidc_account_path,
|
|
full_width: true,
|
|
variant: :primary,
|
|
method: :post,
|
|
data: { turbo: false }
|
|
) %>
|
|
<% else %>
|
|
<p class="text-xs text-secondary">
|
|
<%= t("oidc_accounts.link.account_creation_disabled") %>
|
|
</p>
|
|
<% end %>
|
|
</div>
|
|
<% end %>
|
|
|
|
<div class="mt-6 text-center">
|
|
<%= render DS::Link.new(
|
|
text: t("oidc_accounts.link.cancel"),
|
|
href: new_session_path,
|
|
variant: :default,
|
|
class: "font-medium text-sm text-primary hover:underline transition"
|
|
) %>
|
|
</div> |