Merge branch 'master' into feature/rs-oauth
# Conflicts: # app/models/user.rb # config/routes.rb # db/schema.rb
@@ -12,7 +12,7 @@
|
||||
|
||||
<section class="sm:w-1/2 grid grid-cols-2 items-center gap-y-2">
|
||||
<%= form.label :user_id %>
|
||||
<%= form.collection_select :user_id, User.where(ou: "kosmos.org").order(:cn), :id, :cn, {} %>
|
||||
<%= form.collection_select :user_id, User.where(ou: Setting.primary_domain).order(:cn), :id, :cn, {} %>
|
||||
|
||||
<%= form.label :amount_sats, "Amount BTC (sats)" %>
|
||||
<%= form.number_field :amount_sats %>
|
||||
|
||||
@@ -7,11 +7,46 @@
|
||||
title: "Enable Discourse integration",
|
||||
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 %>
|
||||
<% 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 %>
|
||||
<% end %>
|
||||
</ul>
|
||||
<% if Setting.discourse_enabled? %>
|
||||
<% content_for :documentation do %>
|
||||
<h3 class="mt-8">How to configure Discourse</h3>
|
||||
<ol class="list-decimal list-inside">
|
||||
<li class="mb-6">
|
||||
Set the <strong>Discourse Connect URL</strong> to the following URL:
|
||||
</li>
|
||||
<li data-controller="clipboard" class="mb-6 flex gap-1">
|
||||
<input type="text" class="grow" disabled="disabled"
|
||||
value="https://<%= Setting.accounts_domain %>/discourse/connect"
|
||||
data-clipboard-target="source" />
|
||||
<button 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>
|
||||
</li>
|
||||
<li class="mb-6">
|
||||
Set the <strong>Discourse Connect Secret</strong> to the value above.
|
||||
</li>
|
||||
<li>
|
||||
Enable Discourse Connect.
|
||||
</li>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
@@ -7,24 +7,43 @@
|
||||
title: "Enable ejabberd integration",
|
||||
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::FieldsetComponent.new(
|
||||
title: "Contact roster name",
|
||||
description: "Used when exchanging contacts after signup from invitation"
|
||||
) do %>
|
||||
<%= f.text_field :ejabberd_buddy_roster,
|
||||
value: Setting.ejabberd_buddy_roster,
|
||||
class: "w-full" %>
|
||||
<% end %>
|
||||
<% 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 %>
|
||||
</ul>
|
||||
<h3 class="mt-10">User default settings</h3>
|
||||
<ul role="list">
|
||||
<%= render FormElements::FieldsetComponent.new(
|
||||
title: "Default rooms",
|
||||
description: "Add these default rooms to new users' bookmarks"
|
||||
) do %>
|
||||
<%= f.text_area :xmpp_default_rooms,
|
||||
value: Setting.xmpp_default_rooms.join("\n"),
|
||||
placeholder: "Welcome <welcome@kosmos.chat>\nKosmos <kosmos@kosmos.chat>",
|
||||
class: "h-24 w-full" %>
|
||||
<% end %>
|
||||
<%= render FormElements::FieldsetToggleComponent.new(
|
||||
form: f,
|
||||
attribute: :xmpp_autojoin_default_rooms,
|
||||
enabled: Setting.xmpp_autojoin_default_rooms?,
|
||||
title: "Auto-join default rooms",
|
||||
description: "Automatically join above default rooms in chat clients"
|
||||
) %>
|
||||
<%= render FormElements::FieldsetComponent.new(
|
||||
title: "Contact roster name",
|
||||
description: "Used when exchanging contacts after signup from invitation"
|
||||
) do %>
|
||||
<%= f.text_field :ejabberd_buddy_roster,
|
||||
value: Setting.ejabberd_buddy_roster,
|
||||
class: "w-full" %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</ul>
|
||||
|
||||
@@ -20,4 +20,10 @@
|
||||
</p>
|
||||
</section>
|
||||
<% end %>
|
||||
|
||||
<% if content_for?(:documentation) %>
|
||||
<section>
|
||||
<%= yield :documentation %>
|
||||
</section>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
@@ -6,6 +6,10 @@
|
||||
<h3>Account</h3>
|
||||
<table class="divided">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<td><%= @user.id %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Created at</th>
|
||||
<td><%= @user.created_at.strftime("%Y-%m-%d (%H:%M UTC)") %></td>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<div class="border border-gray-300 rounded-md hover:border-gray-400
|
||||
bg-[length:95%] bg-center bg-no-repeat
|
||||
bg-[url(/img/logos/icon_discourse.svg)]">
|
||||
<%= link_to "https://community.kosmos.org",
|
||||
<%= link_to "#{Setting.discourse_public_url}/session/sso?return_path=/",
|
||||
class: "block h-full px-6 py-6 rounded-md" do %>
|
||||
<h3 class="mb-3.5">Discourse</h3>
|
||||
<p class="text-gray-600">
|
||||
@@ -43,9 +43,9 @@
|
||||
<div class="border border-gray-300 rounded-md hover:border-gray-400
|
||||
bg-cover bg-center sm:bg-[center_top_-140px] bg-no-repeat
|
||||
bg-[url(/img/logos/icon_lightning.svg)]">
|
||||
<%= link_to wallet_path,
|
||||
<%= link_to services_lightning_index_path,
|
||||
class: "block h-full px-6 py-6 rounded-md" do %>
|
||||
<h3 class="mb-3.5">Wallet</h3>
|
||||
<h3 class="mb-3.5">Lightning Network</h3>
|
||||
<p class="text-gray-600">
|
||||
Send and receive sats over the Bitcoin Lightning Network
|
||||
</p>
|
||||
@@ -73,6 +73,17 @@
|
||||
</p>
|
||||
<% end %>
|
||||
</div>
|
||||
<% if Setting.remotestorage_enabled? && Flipper.enabled?(:remotestorage, current_user) %>
|
||||
<div class="border border-gray-300 rounded-md hover:border-gray-400">
|
||||
<%= link_to services_storage_path,
|
||||
class: "block h-full px-6 py-6 rounded-md" do %>
|
||||
<h3 class="mb-3.5">Storage</h3>
|
||||
<p class="text-gray-600">
|
||||
Sync your data between apps and devices
|
||||
</p>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
<!-- <div class="border border-gray-300 rounded-md hover:border-gray-400 -->
|
||||
<!-- bg-[length:80%] bg-[right_top_-30px] bg-no-repeat -->
|
||||
<!-- bg-[url(/img/logos/icon_mastodon.svg)]"> -->
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<p>Welcome <%= @email %>!</p>
|
||||
<p>Welcome <%= @resource.cn %>!</p>
|
||||
|
||||
<p>You can confirm your account email through the link below:</p>
|
||||
<p>Please confirm your email address through the link below:</p>
|
||||
|
||||
<p><%= link_to 'Confirm my account', confirmation_url(@resource, confirmation_token: @token) %></p>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<p>Hello <%= @email %>!</p>
|
||||
<p>Hello <%= @resource.cn %>!</p>
|
||||
|
||||
<% if @resource.try(:unconfirmed_email?) %>
|
||||
<p>We're contacting you to notify you that your email is being changed to <%= @resource.unconfirmed_email %>.</p>
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
<p>Hello <%= @resource.email %>!</p>
|
||||
<p>Hello <%= @resource.cn %>!</p>
|
||||
|
||||
<p>We're contacting you to notify you that your password has been changed.</p>
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
<p>Hello <%= @resource.cn %>,</p>
|
||||
|
||||
<p>Please confirm your new email address through the link below:</p>
|
||||
|
||||
<p><%= link_to 'Confirm my address', confirmation_url(@resource, confirmation_token: @token) %></p>
|
||||
@@ -1,4 +1,4 @@
|
||||
<p>Hello <%= @resource.email %>!</p>
|
||||
<p>Hello <%= @resource.cn %>!</p>
|
||||
|
||||
<p>Someone has requested a link to change your password. You can do this through the link below.</p>
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<p>Hello <%= @resource.email %>!</p>
|
||||
<p>Hello <%= @resource.cn %>!</p>
|
||||
|
||||
<p>Your account has been locked due to an excessive number of unsuccessful sign in attempts.</p>
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<p class="flex gap-2 items-center">
|
||||
<%= f.text_field :cn, autofocus: true, autocomplete: "username",
|
||||
required: true, class: "relative grow"%>
|
||||
<span class="relative shrink-0 text-gray-500">@ kosmos.org</span>
|
||||
<span class="relative shrink-0 text-gray-500">@ <%= Setting.primary_domain %></span>
|
||||
</p>
|
||||
</div>
|
||||
<p>
|
||||
|
||||
@@ -1,14 +1,20 @@
|
||||
<%
|
||||
# TODO remove when https://github.com/hotwired/turbo/issues/203 is fixed
|
||||
enable_turbo = !session[:user_return_to] || !session[:user_return_to].match?('/discourse/connect')
|
||||
%>
|
||||
|
||||
<%= render HeaderCompactComponent.new(title: "Log in") %>
|
||||
|
||||
<%= render MainCompactComponent.new do %>
|
||||
<%= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %>
|
||||
<%= form_for(resource, as: resource_name, url: session_path(resource_name),
|
||||
data: { turbo: enable_turbo.to_s }) do |f| %>
|
||||
<%= render "devise/shared/error_messages", resource: resource %>
|
||||
<div class="mb-6">
|
||||
<%= f.label :cn, 'User', class: 'block mb-2 font-bold' %>
|
||||
<p class="flex gap-2 items-center">
|
||||
<%= f.text_field :cn, autofocus: true, autocomplete: "username",
|
||||
required: true, class: "relative grow", tabindex: "1" %>
|
||||
<span class="relative shrink-0 text-gray-500">@ kosmos.org</span>
|
||||
<span class="relative shrink-0 text-gray-500">@ <%= Setting.primary_domain %></span>
|
||||
</p>
|
||||
</div>
|
||||
<p class="mb-8">
|
||||
|
||||
@@ -1 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-edit-2"><path d="M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z"></path></svg>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-edit-2 <%= custom_class %>"><path d="M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z"></path></svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 291 B After Width: | Height: | Size: 312 B |
@@ -1 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-edit-3"><path d="M12 20h9"></path><path d="M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"></path></svg>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-edit-3 <%= custom_class %>"><path d="M12 20h9"></path><path d="M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"></path></svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 317 B After Width: | Height: | Size: 338 B |
@@ -1 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-edit"><path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"></path><path d="M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"></path></svg>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-edit <%= custom_class %>"><path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"></path><path d="M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"></path></svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 365 B After Width: | Height: | Size: 386 B |
1
app/views/icons/_science.html.erb
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" height="48" viewBox="0 96 960 960" width="48" class="material-science <%= custom_class %>" fill="currentColor"><path d="M172 936q-41.777 0-59.388-39Q95 858 124 826l248-280V276h-52q-12.75 0-21.375-8.675-8.625-8.676-8.625-21.5 0-12.825 8.625-21.325T320 216h320q12.75 0 21.375 8.675 8.625 8.676 8.625 21.5 0 12.825-8.625 21.325T640 276h-52v270l248 280q29 32 11.388 71-17.611 39-59.388 39H172Zm-12-60h640L528 568V276h-96v292L160 876Zm318-300Z"/></svg>
|
||||
|
After Width: | Height: | Size: 488 B |
@@ -1,3 +1,3 @@
|
||||
You just received <%= number_with_delimiter @amount_sats %> sats in your Lightning account (<%= @user.address %>). Check your wallet app, or open the account page for details:
|
||||
|
||||
<%= wallet_transactions_url %>
|
||||
<%= transactions_services_lightning_index_url %>
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<%= render HeaderComponent.new(title: "Wallet") %>
|
||||
<%= render HeaderComponent.new(title: "Lightning Network") %>
|
||||
|
||||
<%= render MainSimpleComponent.new do %>
|
||||
<%= render WalletSummaryComponent.new(balance: @balance) %>
|
||||
|
||||
<%= render partial: "shared/tabnav_wallet" %>
|
||||
<%= render partial: "shared/tabnav_lightning" %>
|
||||
|
||||
<section>
|
||||
<h3>Lightning Address</h3>
|
||||
@@ -1,9 +1,9 @@
|
||||
<%= render HeaderComponent.new(title: "Wallet") %>
|
||||
<%= render HeaderComponent.new(title: "Lightning Network") %>
|
||||
|
||||
<%= render MainSimpleComponent.new do %>
|
||||
<%= render WalletSummaryComponent.new(balance: @balance) %>
|
||||
|
||||
<%= render partial: "shared/tabnav_wallet" %>
|
||||
<%= render partial: "shared/tabnav_lightning" %>
|
||||
|
||||
<section>
|
||||
<h3 class="hidden">Transactions</h3>
|
||||
@@ -27,7 +27,7 @@
|
||||
<p class="col-span-2 md:col-span-1 mb-0 text-right">
|
||||
<span class="text-xl font-mono <%= tx["received"] ? "text-emerald-600" : "" %>">
|
||||
<%= tx["received"] ? "+" : "" %><%= number_with_delimiter tx["amount_sats"] %>
|
||||
<span class="hidden md:inline">sats</span>
|
||||
<span class="text-base md:text-lg">sats</span>
|
||||
</span>
|
||||
</p>
|
||||
<p class="col-span-4 md:col-span-3 mb-0 text-gray-500">
|
||||
@@ -35,7 +35,10 @@
|
||||
</p>
|
||||
<p class="col-span-4 md:col-span-1 md:text-right mb-0">
|
||||
<span class="col-span-2 md:col-span-1 text-sm text-gray-500">
|
||||
<%= tx["datetime"].strftime("%B %e, %H:%M") %>
|
||||
<%= tx["datetime"].strftime("%B %e, %H:%M") -%>
|
||||
<% if tx["fee"] && (tx["fee"] > 0) %>
|
||||
~ Fee: <%= pluralize tx["fee"], "sat" %>
|
||||
<% end %>
|
||||
</span>
|
||||
</p>
|
||||
</li>
|
||||
7
app/views/services/remotestorage/dashboard.html.erb
Normal file
@@ -0,0 +1,7 @@
|
||||
<%= render HeaderComponent.new(title: "Storage") %>
|
||||
|
||||
<%= render MainSimpleComponent.new do %>
|
||||
<section>
|
||||
<h3>Feature enabled</h3>
|
||||
</section>
|
||||
<% end %>
|
||||
@@ -1,13 +1,44 @@
|
||||
<section>
|
||||
<%= tag.section data: {
|
||||
controller: "settings--account--email",
|
||||
"settings--account--email-validation-failed-value": @validation_errors.present?
|
||||
} do %>
|
||||
<h3>E-Mail</h3>
|
||||
<p class="mb-2">
|
||||
<%= label :email, 'Address', class: 'font-bold' %>
|
||||
</p>
|
||||
<p class="flex gap-1 mb-2 sm:w-3/5">
|
||||
<input type="text" id="email" class="grow"
|
||||
value=<%= current_user.email %> disabled="disabled" />
|
||||
</p>
|
||||
</section>
|
||||
<%= form_for(@user, url: update_email_settings_path, method: "post") do |f| %>
|
||||
<%= hidden_field_tag :section, "account" %>
|
||||
<p class="mb-2">
|
||||
<%= f.label :email, 'Address', class: 'font-bold' %>
|
||||
</p>
|
||||
<p class="mb-2 flex gap-1 sm:w-3/5">
|
||||
<%= f.email_field :email, class: "grow", data: {
|
||||
'settings--account--email-target': 'emailField'
|
||||
}, required: true %>
|
||||
<button type="button" id="edit-email"
|
||||
class="btn-md btn-icon btn-blue shrink-0 hidden initial-visible"
|
||||
data-settings--account--email-target="editEmailButton"
|
||||
data-action="settings--account--email#editEmail"
|
||||
title="Edit email address">
|
||||
<span class="">
|
||||
<%= render partial: "icons/edit-3", locals: {
|
||||
custom_class: "text-white h-4 w-4 inline" } %>
|
||||
</span>
|
||||
</button>
|
||||
</p>
|
||||
<% if @validation_errors.present? && @validation_errors[:email].present? %>
|
||||
<p class="error-msg"><%= @validation_errors[:email].first %></p>
|
||||
<% end %>
|
||||
<div class="initial-hidden">
|
||||
<p class="mt-4 mb-2">
|
||||
<%= f.label :current_password, 'Current password', class: 'font-bold' %>
|
||||
</p>
|
||||
<p class="sm:w-3/5">
|
||||
<%= f.password_field :current_password, class: "w-full", required: true %>
|
||||
</p>
|
||||
<p class="mt-6">
|
||||
<%= f.submit "Update", class: "btn-md btn-blue w-full md:w-auto" %>
|
||||
</p>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<section>
|
||||
<h3>Password</h3>
|
||||
<p class="mb-8">Use the following button to request an email with a password reset link:</p>
|
||||
|
||||
89
app/views/settings/_experiments.html.erb
Normal file
@@ -0,0 +1,89 @@
|
||||
<section>
|
||||
<h3>Nostr</h3>
|
||||
<h4 class="mb-0">Public Key</h4>
|
||||
<div data-controller="settings--nostr-pubkey"
|
||||
data-settings--nostr-pubkey-user-address-value="<%= current_user.address %>"
|
||||
data-settings--nostr-pubkey-shared-secret-value="<%= session[:shared_secret] %>"
|
||||
data-settings--nostr-pubkey-pubkey-hex-value="<%= current_user.nostr_pubkey %>">
|
||||
|
||||
<p class="<%= current_user.nostr_pubkey.present? ? '' : 'hidden' %> mt-2 flex gap-1">
|
||||
<input type="text" value="<%= current_user.nostr_pubkey %>" disabled
|
||||
data-settings--nostr-pubkey-target="pubkeyBech32Input"
|
||||
name="nostr_public_key" class="relative grow" />
|
||||
<%= link_to nostr_pubkey_settings_path,
|
||||
class: 'btn-md btn-outline text-red-700 relative shrink-0',
|
||||
data: { turbo_method: :delete, turbo_confirm: 'Are you sure?' } do %>
|
||||
Remove
|
||||
<% end %>
|
||||
</p>
|
||||
|
||||
<% if current_user.nostr_pubkey.present? %>
|
||||
<div class="rounded-md bg-blue-50 p-4">
|
||||
<div class="flex">
|
||||
<div class="flex-shrink-0">
|
||||
<svg class="h-5 w-5 text-blue-400" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
|
||||
<path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z" clip-rule="evenodd" />
|
||||
</svg>
|
||||
</div>
|
||||
<div class="ml-3 flex-1">
|
||||
<p class="text-sm text-blue-800">
|
||||
Your user address <strong><%= current_user.address %></strong> is
|
||||
also a Nostr address now. Use your favorite Nostr app, or for
|
||||
example <a href="http://metadata.nostr.com" target="_blank"
|
||||
class="underline">metadata.nostr.com</a>, to add this
|
||||
<strong>NIP-05</strong> address to your public profile.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% else %>
|
||||
<p class="my-4">
|
||||
If you use any apps on the Nostr network, you can verify your public key
|
||||
with us in order to enable Nostr-specific features for your account.
|
||||
</p>
|
||||
<% end %>
|
||||
|
||||
<div data-settings--nostr-pubkey-target="noExtension"
|
||||
class="hidden rounded-md bg-blue-50 p-4">
|
||||
<div class="flex">
|
||||
<div class="flex-shrink-0">
|
||||
<svg class="h-5 w-5 text-blue-400" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
|
||||
<path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z" clip-rule="evenodd" />
|
||||
</svg>
|
||||
</div>
|
||||
<div class="ml-3">
|
||||
<h3 class="mb-0 text-sm font-bold text-blue-800">
|
||||
No browser extension found
|
||||
</h3>
|
||||
<div class="mt-2 mb-0 text-sm text-blue-800">
|
||||
<p>
|
||||
We recommend Alby, which you can also use for your Lightning
|
||||
Wallet.
|
||||
</p>
|
||||
</div>
|
||||
<div class="mt-4">
|
||||
<div class="-mx-2 -my-1.5 flex">
|
||||
<a href="https://getalby.com" target="_blank"
|
||||
class="rounded-md bg-blue-50 px-2 py-1.5 text-sm
|
||||
font-bold text-blue-800 hover:bg-blue-100
|
||||
focus:outline-none focus:ring-2 focus:ring-blue-600
|
||||
focus:ring-offset-2 focus:ring-offset-blue-50">
|
||||
Get Alby
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<% unless current_user.nostr_pubkey.present? %>
|
||||
<p class="mt-8">
|
||||
<button class="btn-md btn-gray w-full sm:w-auto" disabled
|
||||
data-settings--nostr-pubkey-target="setPubkey"
|
||||
data-action="settings--nostr-pubkey#setPubkey">
|
||||
Get public key from browser extension
|
||||
</button>
|
||||
</p>
|
||||
<% end %>
|
||||
</div>
|
||||
</section>
|
||||
@@ -21,10 +21,15 @@
|
||||
<p class="text-sm text-gray-500">
|
||||
Your user address for Chat and Lightning Network.
|
||||
</p>
|
||||
|
||||
<%# <%= form_for(@user, as: "profile", url: settings_profile_path) do |f| %>
|
||||
<%# <p class="mt-8">
|
||||
<%# <%= f.submit "Save changes", class: 'btn-md btn-blue w-full sm:w-auto' %>
|
||||
<%# </p>
|
||||
<%# <% end %>
|
||||
<%= form_for(@user, url: setting_path(:profile), html: { :method => :put }) do |f| %>
|
||||
<%= render FormElements::FieldsetComponent.new(tag: "div", title: "Display name") do %>
|
||||
<%= f.text_field :display_name, class: "w-full sm:w-3/5 mb-2" %>
|
||||
<% if @validation_errors.present? && @validation_errors[:display_name].present? %>
|
||||
<p class="error-msg"><%= @validation_errors[:display_name].first %></p>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<p class="mt-8 pt-6 border-t border-gray-200 text-right">
|
||||
<%= f.submit 'Save', class: "btn-md btn-blue w-full md:w-auto" %>
|
||||
</p>
|
||||
<% end %>
|
||||
</section>
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
<%= link_to "Services", root_path,
|
||||
class: main_nav_class(@current_section, :dashboard) %>
|
||||
<%= link_to "Contributions", contributions_donations_path,
|
||||
class: main_nav_class(@current_section, :contributions) %>
|
||||
class: main_nav_class(@current_section, :services) %>
|
||||
<%= link_to "Invitations", invitations_path,
|
||||
class: main_nav_class(@current_section, :invitations) %>
|
||||
<%= link_to "Wallet", wallet_path,
|
||||
class: main_nav_class(@current_section, :wallet) %>
|
||||
<%= link_to "Contributions", contributions_donations_path,
|
||||
class: main_nav_class(@current_section, :contributions) %>
|
||||
<%= link_to "Settings", settings_path,
|
||||
class: main_nav_class(@current_section, :settings) %>
|
||||
|
||||
@@ -1,20 +1,26 @@
|
||||
<%= render SidenavLinkComponent.new(
|
||||
name: "Profile", path: setting_path(:profile), icon: "user",
|
||||
active: current_page?(setting_path(:profile))
|
||||
active: @settings_section.to_s == "profile"
|
||||
) %>
|
||||
<%= render SidenavLinkComponent.new(
|
||||
name: "Account", path: setting_path(:account), icon: "key",
|
||||
active: current_page?(setting_path(:account))
|
||||
active: @settings_section.to_s == "account"
|
||||
) %>
|
||||
<% if Setting.ejabberd_enabled %>
|
||||
<%= render SidenavLinkComponent.new(
|
||||
name: "Chat", path: setting_path(:xmpp), icon: "message-circle",
|
||||
active: current_page?(setting_path(:xmpp))
|
||||
active: @settings_section.to_s == "xmpp"
|
||||
) %>
|
||||
<% end %>
|
||||
<% if Setting.lndhub_enabled %>
|
||||
<%= render SidenavLinkComponent.new(
|
||||
name: "Wallet", path: setting_path(:lightning), icon: "zap",
|
||||
active: current_page?(setting_path(:lightning))
|
||||
name: "Lightning", path: setting_path(:lightning), icon: "zap",
|
||||
active: @settings_section.to_s == "lightning"
|
||||
) %>
|
||||
<% end %>
|
||||
<% if Setting.nostr_enabled %>
|
||||
<%= render SidenavLinkComponent.new(
|
||||
name: "Experiments", path: setting_path(:experiments), icon: "science",
|
||||
active: @settings_section.to_s == "experiments"
|
||||
) %>
|
||||
<% end %>
|
||||
|
||||
14
app/views/shared/_tabnav_lightning.html.erb
Normal file
@@ -0,0 +1,14 @@
|
||||
<section>
|
||||
<div class="border-b border-gray-200">
|
||||
<nav class="-mb-px flex" aria-label="Tabs">
|
||||
<%= render TabnavLinkComponent.new(
|
||||
name: "Info", path: services_lightning_index_path,
|
||||
active: current_page?(services_lightning_index_path)
|
||||
) %>
|
||||
<%= render TabnavLinkComponent.new(
|
||||
name: "Transactions", path: transactions_services_lightning_index_path,
|
||||
active: current_page?(transactions_services_lightning_index_path)
|
||||
) %>
|
||||
</nav>
|
||||
</div>
|
||||
</section>
|
||||
@@ -1,14 +0,0 @@
|
||||
<section>
|
||||
<div class="border-b border-gray-200">
|
||||
<nav class="-mb-px flex" aria-label="Tabs">
|
||||
<%= render TabnavLinkComponent.new(
|
||||
name: "Info", path: wallet_path,
|
||||
active: current_page?(wallet_path)
|
||||
) %>
|
||||
<%= render TabnavLinkComponent.new(
|
||||
name: "Transactions", path: wallet_transactions_path,
|
||||
active: current_page?(wallet_transactions_path)
|
||||
) %>
|
||||
</nav>
|
||||
</div>
|
||||
</section>
|
||||
@@ -10,7 +10,7 @@
|
||||
<%= f.text_field :cn, autofocus: true, autocomplete: "username",
|
||||
required: true, class: "relative grow text-xl"%>
|
||||
<span class="relative shrink-0 text-gray-500 md:text-xl">
|
||||
@ kosmos.org
|
||||
@ <%= Setting.primary_domain %>
|
||||
</span>
|
||||
</p>
|
||||
</div>
|
||||
|
||||