58 lines
2.2 KiB
Plaintext
58 lines
2.2 KiB
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 account"
|
|
) 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 %>
|
|
<% if @user.nostr_pubkey.present? %>
|
|
<%= render FormElements::FieldsetComponent.new(
|
|
positioning: :horizontal,
|
|
title: "Zap received",
|
|
description: "Notify me when someone zaps me on Nostr"
|
|
) do %>
|
|
<% f.fields_for :preferences do |p| %>
|
|
<%= p.select :lightning_notify_zap_received, options_for_select([
|
|
["off", "disabled"],
|
|
["Chat (Jabber)", "xmpp"],
|
|
["E-Mail", "email"]
|
|
], selected: @user.preferences[:lightning_notify_zap_received]) %>
|
|
<% end %>
|
|
<% end %>
|
|
<% end %>
|
|
<% if @notifications_enabled %>
|
|
<%= render FormElements::FieldsetToggleComponent.new(
|
|
field_name: "user[preferences][lightning_notify_only_with_message]",
|
|
enabled: @user.preferences[:lightning_notify_only_with_message],
|
|
title: "Ignore transactions without message",
|
|
description: "Only send notifications when there is a message attached to the payment"
|
|
) %>
|
|
<%= render FormElements::FieldsetComponent.new(
|
|
title: "Minimum amount",
|
|
description: "Only send notifications when amount is higher than this"
|
|
) do %>
|
|
<%= f.number_field :lightning_notify_min_sats,
|
|
name: "user[preferences][lightning_notify_min_sats]",
|
|
class: "w-full",
|
|
value: @user.preferences[:lightning_notify_min_sats].to_i %>
|
|
<% 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 %>
|