mirror of
https://github.com/we-promise/sure.git
synced 2026-04-07 14:31:25 +00:00
* Add onboarding modes to self-hosted signup * Style form consistently * Configure ONBOARDING_STATE via ENV
62 lines
2.3 KiB
Plaintext
62 lines
2.3 KiB
Plaintext
<div class="space-y-4">
|
|
<div class="flex items-center justify-between">
|
|
<div class="space-y-1">
|
|
<p class="text-sm"><%= t(".title") %></p>
|
|
<p class="text-secondary text-sm"><%= t(".description", product: product_name) %></p>
|
|
</div>
|
|
|
|
<%= styled_form_with model: Setting.new,
|
|
url: settings_hosting_path,
|
|
method: :patch,
|
|
data: { controller: "auto-submit-form", auto_submit_form_trigger_event_value: "change" } do |form| %>
|
|
<div class="form-field w-fit">
|
|
<%= form.select :onboarding_state,
|
|
options_for_select(
|
|
[
|
|
[ t(".states.open"), "open" ],
|
|
[ t(".states.closed"), "closed" ],
|
|
[ t(".states.invite_only"), "invite_only" ]
|
|
],
|
|
Setting.onboarding_state
|
|
),
|
|
{ label: false },
|
|
{ data: { auto_submit_form_target: "auto" } } %>
|
|
</div>
|
|
<% end %>
|
|
</div>
|
|
|
|
<div class="flex items-center justify-between">
|
|
<div class="space-y-1">
|
|
<p class="text-sm"><%= t(".email_confirmation_title") %></p>
|
|
<p class="text-secondary text-sm"><%= t(".email_confirmation_description") %></p>
|
|
</div>
|
|
|
|
<%= styled_form_with model: Setting.new,
|
|
url: settings_hosting_path,
|
|
method: :patch,
|
|
data: { controller: "auto-submit-form", auto_submit_form_trigger_event_value: "change" } do |form| %>
|
|
<%= form.toggle :require_email_confirmation, { data: { auto_submit_form_target: "auto" } } %>
|
|
<% end %>
|
|
</div>
|
|
|
|
<% if Setting.onboarding_state == "invite_only" %>
|
|
<div class="flex items-center justify-between mb-4">
|
|
<div>
|
|
<span class="text-primary text-base font-medium"><%= t(".generated_tokens") %></span>
|
|
</div>
|
|
<div>
|
|
<%= render DS::Button.new(
|
|
text: t(".generate_tokens"),
|
|
variant: "primary",
|
|
href: invite_codes_path,
|
|
method: :post
|
|
) %>
|
|
</div>
|
|
</div>
|
|
|
|
<div>
|
|
<%= turbo_frame_tag :invite_codes, src: invite_codes_path %>
|
|
</div>
|
|
<% end %>
|
|
</div>
|