51 lines
1.9 KiB
Plaintext
51 lines
1.9 KiB
Plaintext
<%= render HeaderComponent.new(title: "Settings") %>
|
|
|
|
<%= render MainWithSidenavComponent.new(sidenav_partial: 'shared/admin_sidenav_settings') do %>
|
|
<%= form_for(Setting.new, url: admin_settings_registrations_path, method: :put) do |f| %>
|
|
<section>
|
|
<h3>Registrations</h3>
|
|
|
|
<% if @errors && @errors.any? %>
|
|
<%= render partial: "admin/settings/errors", locals: { errors: @errors } %>
|
|
<% end %>
|
|
|
|
<ul role="list">
|
|
<%= render FormElements::FieldsetComponent.new(
|
|
title: "Reserved usernames",
|
|
description: "These usernames cannot be registered as accounts."
|
|
) do %>
|
|
<%= f.text_area :reserved_usernames,
|
|
value: Setting.reserved_usernames.join("\n"),
|
|
class: "h-44 w-60" %>
|
|
<p class="text-sm text-gray-500">
|
|
One username per line
|
|
</p>
|
|
<% end %>
|
|
<li>
|
|
<p class="font-bold mb-1">Default services</p>
|
|
<p class="text-gray-500">
|
|
These services are enabled for new users by default after signup.
|
|
</p>
|
|
<div class="flex flex-wrap gap-x-6 gap-y-2">
|
|
<% Setting.available_services.each do |option| %>
|
|
<div class="md:inline-block">
|
|
<%= f.check_box :default_services,
|
|
{ multiple: true, checked: Setting.default_services.include?(option),
|
|
class: "h-4 w-4 rounded border-gray-300 text-blue-600 focus:ring-blue-600 mr-0.5" },
|
|
option, nil %>
|
|
<%= f.label "default_services_#{option.parameterize}", service_human_name(option) %>
|
|
</div>
|
|
<% end %>
|
|
</div>
|
|
</li>
|
|
</ul>
|
|
</section>
|
|
|
|
<section>
|
|
<p class="pt-6 border-t border-gray-200 text-right">
|
|
<%= f.submit 'Save', class: "btn-md btn-blue w-full md:w-auto" %>
|
|
</p>
|
|
</section>
|
|
<% end %>
|
|
<% end %>
|