* Turn prefs into a flat hash structure, since nesting is not worth the trouble * Add a custom serializer class for prefs * Add a config file for defaults and merge set prefs with unset ones * Use booleans for "true" and "false", and integers where appropriate
26 lines
847 B
Plaintext
26 lines
847 B
Plaintext
<%= form_for @user, url: setting_path(:lightning), html: { :method => :put } do |f| %>
|
|
<section>
|
|
<h3>Notifications</h3>
|
|
<ul role="list">
|
|
<%= render FormElements::FieldsetComponent.new(
|
|
positioning: :horizontal,
|
|
title: "Sats received",
|
|
description: "Notify me when sats are sent to my Lightning Address"
|
|
) do %>
|
|
<% f.fields_for :preferences do |p| %>
|
|
<%= p.select :lightning_notify_sats_received, options_for_select([
|
|
["off", "disabled"],
|
|
["Chat (Jabber)", "xmpp"],
|
|
["E-Mail", "email"]
|
|
], selected: @user.preferences[:lightning_notify_sats_received]) %>
|
|
<% end %>
|
|
<% end %>
|
|
</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 %>
|