WIP Add admin settings pages, reserved username config
All checks were successful
continuous-integration/drone/push Build is passing

Prototyping settings forms
This commit is contained in:
Râu Cao
2023-02-17 20:32:29 +08:00
parent cd7b05e2ff
commit 084835f06a
11 changed files with 130 additions and 2 deletions

View File

@@ -0,0 +1,31 @@
<%= render HeaderComponent.new(title: "Settings") %>
<%= render MainWithSidenavComponent.new(sidenav_partial: 'shared/admin_sidenav_settings') do %>
<section>
<h3>Registrations</h3>
<%= form_for(Setting.new, url: admin_settings_services_path) do |f| %>
<% if @errors && @errors.any? %>
<div>
<ul>
<% @errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
</ul>
</div>
<% end %>
<label>
<p class="font-bold mb-1">Reserved usernames</p>
<p class="text-gray-500">
These usernames cannot be registered as accounts:
</p>
<%= f.text_area :reserved_usernames,
value: Setting.reserved_usernames.join("\n"),
class: "h-44 mb-2" %>
<p class="text-sm text-gray-500">
One username per line
</p>
</label>
<% end %>
</section>
<% end %>