Merge branch 'master' into feature/rs-oauth

This commit is contained in:
Râu Cao
2023-07-04 16:43:32 +02:00
23 changed files with 296 additions and 158 deletions

View File

@@ -8,16 +8,15 @@
description: "Discourse configuration present and features enabled"
) %>
<% if Setting.discourse_enabled? %>
<%= render FormElements::FieldsetComponent.new(title: "Public URL") do %>
<%= f.text_field :discourse_public_url,
value: Setting.discourse_public_url,
class: "w-full", disabled: true %>
<% end %>
<%= render FormElements::FieldsetComponent.new(title: "Connect secret") do %>
<%= f.password_field :discourse_connect_secret,
value: Setting.discourse_connect_secret,
class: "w-full", disabled: true %>
<% end %>
<%= render FormElements::FieldsetResettableSettingComponent.new(
key: :discourse_public_url,
title: "Public URL"
) %>
<%= render FormElements::FieldsetResettableSettingComponent.new(
key: :discourse_connect_secret,
type: :password,
title: "Connect secret"
) %>
<% end %>
</ul>
<% if Setting.discourse_enabled? %>

View File

@@ -8,16 +8,14 @@
description: "ejabberd configuration present and features enabled"
) %>
<% if Setting.ejabberd_enabled? %>
<%= render FormElements::FieldsetComponent.new(title: "API URL") do %>
<%= f.text_field :ejabberd_api_url,
value: Setting.ejabberd_api_url,
class: "w-full", disabled: true %>
<% end %>
<%= render FormElements::FieldsetComponent.new(title: "Admin URL") do %>
<%= f.text_field :ejabberd_admin_url,
value: Setting.ejabberd_admin_url,
class: "w-full", disabled: true %>
<% end %>
<%= render FormElements::FieldsetResettableSettingComponent.new(
key: :ejabberd_api_url,
title: "API URL"
) %>
<%= render FormElements::FieldsetResettableSettingComponent.new(
key: :ejabberd_admin_url,
title: "Admin URL"
) %>
</ul>
<h3 class="mt-10">User default settings</h3>
<ul role="list">
@@ -37,12 +35,24 @@
title: "Auto-join default rooms",
description: "Automatically join above default rooms in chat clients"
) %>
<%= render FormElements::FieldsetComponent.new(
<%= render FormElements::FieldsetResettableSettingComponent.new(
key: :ejabberd_buddy_roster,
title: "Contact roster name",
description: "Used when exchanging contacts after signup from invitation"
) %>
</ul>
<h3 class="mt-10">Notifications</h3>
<ul role="list">
<%= render FormElements::FieldsetComponent.new(
title: "From address",
description: "Address (JID) of the account notifications are sent from",
resettable: Setting.get_field(:xmpp_notifications_from_address)[:default] != Setting.xmpp_notifications_from_address
) do %>
<%= f.text_field :ejabberd_buddy_roster,
value: Setting.ejabberd_buddy_roster,
<%= f.text_field :xmpp_notifications_from_address,
value: Setting.xmpp_notifications_from_address,
data: {
:'default-value' => Setting.get_field(:xmpp_notifications_from_address)[:default]
},
class: "w-full" %>
<% end %>
<% end %>

View File

@@ -8,10 +8,9 @@
description: "Gitea configuration present and features enabled"
) %>
<% if Setting.gitea_enabled? %>
<%= render FormElements::FieldsetComponent.new(title: "Public URL") do %>
<%= f.text_field :gitea_public_url,
value: Setting.gitea_public_url,
class: "w-full", disabled: true %>
<% end %>
<%= render FormElements::FieldsetResettableSettingComponent.new(
key: :gitea_public_url,
title: "Public URL"
) %>
<% end %>
</ul>

View File

@@ -8,11 +8,10 @@
description: "LNDHub configuration present and wallet features enabled"
) %>
<% if Setting.lndhub_enabled? %>
<%= render FormElements::FieldsetComponent.new(title: "API URL") do %>
<%= f.text_field :lndhub_api_url,
value: Setting.lndhub_api_url,
class: "w-full", disabled: true %>
<% end %>
<%= render FormElements::FieldsetResettableSettingComponent.new(
key: :lndhub_api_url,
title: "API URL"
) %>
<% end %>
<%= render FormElements::FieldsetToggleComponent.new(
form: f,
@@ -29,10 +28,10 @@
description: "Allow users to receive invoice-less payments to their Lightning Address"
) %>
<% if Setting.lndhub_keysend_enabled? %>
<%= render FormElements::FieldsetComponent.new(title: "Public key", description: "The public key of the Lightning node used by LNDHub") do %>
<%= f.text_field :lndhub_public_key,
value: Setting.lndhub_public_key,
class: "w-full", disabled: true %>
<% end %>
<%= render FormElements::FieldsetResettableSettingComponent.new(
key: :lndhub_public_key,
title: "Public key",
description: "The public key of the Lightning node used by LNDHub"
) %>
<% end %>
</ul>

View File

@@ -8,10 +8,9 @@
description: "Mastodon configuration present and features enabled"
) %>
<% if Setting.mastodon_enabled? %>
<%= render FormElements::FieldsetComponent.new(title: "Public URL") do %>
<%= f.text_field :mastodon_public_url,
value: Setting.mastodon_public_url,
class: "w-full", disabled: true %>
<% end %>
<%= render FormElements::FieldsetResettableSettingComponent.new(
key: :mastodon_public_url,
title: "Public URL"
) %>
<% end %>
</ul>

View File

@@ -8,10 +8,9 @@
description: "MediaWiki configuration present and features enabled"
) %>
<% if Setting.mediawiki_enabled? %>
<%= render FormElements::FieldsetComponent.new(title: "Public URL") do %>
<%= f.text_field :mediawiki_public_url,
value: Setting.mediawiki_public_url,
class: "w-full", disabled: true %>
<% end %>
<%= render FormElements::FieldsetResettableSettingComponent.new(
key: :mediawiki_public_url,
title: "Public URL"
) %>
<% end %>
</ul>

View File

@@ -1,4 +1,5 @@
<h3>RemoteStorage</h3>
<p class="text-red-600 mb-8">Feature currently in development.</p>
<ul role="list">
<%= render FormElements::FieldsetToggleComponent.new(
form: f,
@@ -8,10 +9,9 @@
description: "RemoteStorage configuration present and features enabled"
) %>
<% if Setting.remotestorage_enabled? %>
<%= render FormElements::FieldsetComponent.new(title: "Storage URL") do %>
<%= f.text_field :rs_storage_url,
value: Setting.rs_storage_url,
class: "w-full", disabled: true %>
<% end %>
<%= render FormElements::FieldsetResettableSettingComponent.new(
key: :rs_storage_url,
title: "Storage URL"
) %>
<% end %>
</ul>

View File

@@ -7,13 +7,25 @@
<section>
<h3>Lightning Address</h3>
<p>
<p class="mb-6">
Your Kosmos user address is also a
<a class="ks-text-link" href="https://lightningaddress.com/" target="_blank">Lightning Address</a>!
The easiest way to receive sats is by just giving out your address:
</p>
<p>
<strong><%= current_user.address %></strong>
<p data-controller="clipboard" class="flex gap-1 sm:w-2/5">
<input type="text" id="user_address" class="grow"
value=<%= current_user.address %> disabled="disabled"
data-clipboard-target="source" />
<button id="copy-user-address" class="btn-md btn-icon btn-blue shrink-0"
data-clipboard-target="trigger" data-action="clipboard#copy"
title="Copy to clipboard">
<span class="content-initial">
<%= render partial: "icons/copy", locals: { custom_class: "text-white h-4 w-4 inline" } %>
</span>
<span class="content-active hidden">
<%= render partial: "icons/check", locals: { custom_class: "text-white h-4 w-4 inline" } %>
</span>
</button>
</p>
</section>
@@ -39,7 +51,7 @@
<button id="hide-setup-code" class="hidden btn-md btn-blue w-full sm:w-auto">Hide setup QR code</button>
</p>
<p id="setup-code" class="hidden my-10 w-full text-center">
<%= raw @svg %>
<%= raw @lndhub_qr_svg %>
</p>
</section>
@@ -88,6 +100,24 @@
</p>
</div>
</section>
<section class="mb-12">
<h3>QR Code for Donations/Tips</h3>
<p>
You can print out or publish a QR code for people to scan with their
wallet apps, so they can send you sats without a direct personal
interaction (for example at a concert, or on your website).
</p>
<p class="my-6 text-center md:text-left">
<%= link_to "Download SVG file",
qr_lnurlp_services_lightning_index_path(format: "svg"),
class: "btn-md btn-blue w-full sm:w-auto"%>
<span class="mx-2 my-2 md:my-0 block md:inline">or</span>
<%= link_to "Download PNG file",
qr_lnurlp_services_lightning_index_path(format: "png"),
class: "btn-md btn-blue w-full sm:w-auto"%>
</p>
</section>
<% end %>
<script type="text/javascript">