diff --git a/app/assets/stylesheets/legacy/_layout.scss b/app/assets/stylesheets/legacy/_layout.scss index 6ffed80..7889464 100644 --- a/app/assets/stylesheets/legacy/_layout.scss +++ b/app/assets/stylesheets/legacy/_layout.scss @@ -8,6 +8,13 @@ body { background-attachment: fixed; } +body#admin-panel { + background: linear-gradient(35deg, rgba(255,0,255,0.2) 0, rgba(153,12,14,0.9) 100%), + url('/img/bg-1.jpg'); + background-size: cover; + background-attachment: fixed; +} + .ks-site-icon { svg { display: inline-block; @@ -60,30 +67,6 @@ body { } } -body#admin-panel { - #wrapper { - > header { - background: $color-red-bright; - background: linear-gradient(35deg, rgba(255,0,255,0.2) 0, rgba(153,12,14,0.9) 100%), - url('/img/bg-1.jpg'); - } - } - - #main-nav { - ul { - grid-template-columns: repeat(4, 1fr); - - li { - a { - &.active { - border-bottom: 2px solid $color-red-bright; - } - } - } - } - } -} - .flash-msg { width: 100%; text-align: center; @@ -123,14 +106,6 @@ main { table { width: 100%; - th, td { - &.hide-small { - @include media-max(small) { - display: none; - } - } - } - th { color: $text-color-discreet; font-weight: normal; diff --git a/app/views/admin/dashboard/index.html.erb b/app/views/admin/dashboard/index.html.erb index e7f405a..c00c55a 100644 --- a/app/views/admin/dashboard/index.html.erb +++ b/app/views/admin/dashboard/index.html.erb @@ -1,3 +1,7 @@ -

- With great power comes great responsibility. -

+<%= render partial: "components/header", locals: { page_title: "Admin Panel" } %> + +<%= render layout: "components/main_simple" do %> +

+ With great power comes great responsibility. +

+<% end %> diff --git a/app/views/admin/donations/edit.html.erb b/app/views/admin/donations/edit.html.erb index 5042797..2372949 100644 --- a/app/views/admin/donations/edit.html.erb +++ b/app/views/admin/donations/edit.html.erb @@ -1,8 +1,12 @@ -

Editing Donation

+<%= render partial: "components/header", locals: { page_title: "Donations" } %> -<%= render 'form', donation: @donation, url: admin_donation_path(@donation) %> +<%= render layout: "components/main_simple" do %> +

Editing Donation

-

- <%= link_to 'Show', admin_donation_path(@donation), class: 'ks-text-link' %> | - <%= link_to 'Back', admin_donations_path, class: 'ks-text-link' %> -

+ <%= render 'form', donation: @donation, url: admin_donation_path(@donation) %> + +

+ <%= link_to 'Show', admin_donation_path(@donation), class: 'ks-text-link' %> | + <%= link_to 'Back', admin_donations_path, class: 'ks-text-link' %> +

+<% end %> diff --git a/app/views/admin/donations/index.html.erb b/app/views/admin/donations/index.html.erb index 3325d1c..9f26c76 100644 --- a/app/views/admin/donations/index.html.erb +++ b/app/views/admin/donations/index.html.erb @@ -1,41 +1,43 @@ -

Donations

+<%= render partial: "components/header", locals: { page_title: "Donations" } %> -<% if @donations.any? %> - - - - - - - - - - - - - - - <% @donations.each do |donation| %> - - - - - - - - - - +<%= render layout: "components/main_simple" do %> + <% if @donations.any? %> +
UserAmount BTCin EURin USDPublic nameDate
<%= donation.user.cn %><%= sats_to_btc donation.amount_sats %> BTC<%= number_to_currency donation.amount_eur / 100, unit: "" %><%= number_to_currency donation.amount_usd / 100, unit: "" %><%= donation.public_name %><%= donation.paid_at ? donation.paid_at.strftime("%Y-%m-%d") : "" %><%= link_to 'Show', admin_donation_path(donation), class: 'btn btn-sm btn-gray' %><%= link_to 'Edit', edit_admin_donation_path(donation), class: 'btn btn-sm btn-gray' %><%= link_to 'Destroy', admin_donation_path(donation), class: 'btn btn-sm btn-red', method: :delete, data: { confirm: 'Are you sure?' } %>
+ + + + + + + + + - <% end %> - -
UserAmount BTCin EURin USDPublic nameDate
-<% else %> -

- No donations yet. + + + + <% @donations.each do |donation| %> + + <%= donation.user.address %> + <%= sats_to_btc donation.amount_sats %> BTC + <%= number_to_currency donation.amount_eur / 100, unit: "" %> + <%= number_to_currency donation.amount_usd / 100, unit: "" %> + <%= donation.public_name %> + <%= donation.paid_at ? donation.paid_at.strftime("%Y-%m-%d") : "" %> + <%= link_to 'Show', admin_donation_path(donation), class: 'btn btn-sm btn-gray' %> + <%= link_to 'Edit', edit_admin_donation_path(donation), class: 'btn btn-sm btn-gray' %> + <%= link_to 'Destroy', admin_donation_path(donation), class: 'btn btn-sm btn-red', method: :delete, data: { confirm: 'Are you sure?' } %> + + <% end %> + + + <% else %> +

+ No donations yet. +

+ <% end %> + +

+ <%= link_to 'Record an out-of-system donation', new_admin_donation_path, class: 'btn-md btn-gray' %>

<% end %> - -

- <%= link_to 'Record an out-of-system donation', new_admin_donation_path, class: 'btn-md btn-gray' %> -

diff --git a/app/views/admin/donations/new.html.erb b/app/views/admin/donations/new.html.erb index ca10ca3..965cdbc 100644 --- a/app/views/admin/donations/new.html.erb +++ b/app/views/admin/donations/new.html.erb @@ -1,7 +1,11 @@ -

New Donation

+<%= render partial: "components/header", locals: { page_title: "Donations" } %> -<%= render 'form', donation: @donation, url: admin_donations_path %> +<%= render layout: "components/main_simple" do %> +

New Donation

-

- <%= link_to 'Back', admin_donations_path, class: 'ks-text-link' %> -

+ <%= render 'form', donation: @donation, url: admin_donations_path %> + +

+ <%= link_to 'Back', admin_donations_path, class: 'ks-text-link' %> +

+<% end %> diff --git a/app/views/admin/donations/show.html.erb b/app/views/admin/donations/show.html.erb index dd929f2..6cd247a 100644 --- a/app/views/admin/donations/show.html.erb +++ b/app/views/admin/donations/show.html.erb @@ -1,36 +1,40 @@ -

<%= notice %>

+<%= render partial: "components/header", locals: { page_title: "Donations" } %> -

- User: - <%= @donation.user_id %> -

+<%= render layout: "components/main_simple" do %> +

<%= notice %>

-

- Amount sats: - <%= @donation.amount_sats %> -

+

+ User: + <%= @donation.user.address %> +

-

- Amount eur: - <%= @donation.amount_eur %> -

+

+ Amount sats: + <%= @donation.amount_sats %> +

-

- Amount usd: - <%= @donation.amount_usd %> -

+

+ Amount eur: + <%= @donation.amount_eur %> +

-

- Public name: - <%= @donation.public_name %> -

+

+ Amount usd: + <%= @donation.amount_usd %> +

-

- Date: - <%= @donation.paid_at %> -

+

+ Public name: + <%= @donation.public_name %> +

-

- <%= link_to 'Edit', edit_admin_donation_path(@donation), class: 'ks-text-link' %> | - <%= link_to 'Back', admin_donations_path, class: 'ks-text-link' %> -

+

+ Date: + <%= @donation.paid_at %> +

+ +

+ <%= link_to 'Edit', edit_admin_donation_path(@donation), class: 'ks-text-link' %> | + <%= link_to 'Back', admin_donations_path, class: 'ks-text-link' %> +

+<% end %> diff --git a/app/views/admin/invitations/index.html.erb b/app/views/admin/invitations/index.html.erb index fa2e981..d30c0d0 100644 --- a/app/views/admin/invitations/index.html.erb +++ b/app/views/admin/invitations/index.html.erb @@ -1,32 +1,35 @@ -
-

Invitations

-

- There are currently <%= @invitations_unused_count %> - unused invitations available to existing users. - <%= @users_with_referrals_count %> users have successfully - invited new users. -

-
-<% if @invitations_used.any? %> +<%= render partial: "components/header", locals: { page_title: "Invitations" } %> + +<%= render layout: "components/main_simple" do %>
-

Accepted (<%= @invitations_used.length %>)

- - - - - - - - - - <% @invitations_used.each do |invitation| %> - - - - - - <% end %> - -
TokenAcceptedInvited user
<%= invitation.token %><%= invitation.used_at.strftime("%Y-%m-%d") %><%= User.find(invitation.invited_user_id).address %>
+

+ There are currently <%= @invitations_unused_count %> + unused invitations available to existing users. + <%= @users_with_referrals_count %> users have successfully + invited new users. +

+ <% if @invitations_used.any? %> +
+

Accepted (<%= @invitations_used.length %>)

+ + + + + + + + + + <% @invitations_used.each do |invitation| %> + + + + + + <% end %> + +
TokenAcceptedInvited user
<%= invitation.token %><%= invitation.used_at.strftime("%Y-%m-%d") %><%= User.find(invitation.invited_user_id).address %>
+
+ <% end %> <% end %> diff --git a/app/views/admin/ldap_users/index.html.erb b/app/views/admin/ldap_users/index.html.erb index 930199c..27d7a96 100644 --- a/app/views/admin/ldap_users/index.html.erb +++ b/app/views/admin/ldap_users/index.html.erb @@ -1,32 +1,34 @@ -

LDAP users: <%= @ou %>

+<%= render partial: "components/header", locals: { page_title: "LDAP Users: #{@ou}" } %> - - +<%= render layout: "components/main_simple" do %> + + - - - - - - - - - - - <% @entries.each do |entry| %> - - - - - - - <% end %> - -
UIDE-MailAdmin
<%= entry[:uid] %><%= entry[:mail] %><%= entry[:admin] %>
+ + + + + + + + + + + <% @entries.each do |entry| %> + + + + + + + <% end %> + +
UIDE-MailAdmin
<%= entry[:uid] %><%= entry[:mail] %><%= entry[:admin] %>
+<% end %> diff --git a/app/views/components/_main_simple.html.erb b/app/views/components/_main_simple.html.erb new file mode 100644 index 0000000..168e6c0 --- /dev/null +++ b/app/views/components/_main_simple.html.erb @@ -0,0 +1,5 @@ +
+
+ <%= yield %> +
+
diff --git a/app/views/dashboard/index.html.erb b/app/views/dashboard/index.html.erb index ce5f86c..a5dce88 100644 --- a/app/views/dashboard/index.html.erb +++ b/app/views/dashboard/index.html.erb @@ -1,63 +1,61 @@ <%= render partial: "components/header", locals: { page_title: "Services" } %> -
-
-
-

- Your Kosmos account and password currently give you access to these - services: -

-
-
-

- <%= link_to "Chat", "https://wiki.kosmos.org/Services:Chat", class: "ks-text-link" %> -

-

- Chat rooms and instant messaging (XMPP/Jabber) -

-
-
-

- <%= link_to "Discourse", "https://community.kosmos.org", class: "ks-text-link" %> -

-

- Kosmos community forums and user support/help site -

-
-
-

- 🗲 - <%= link_to "Lightning Wallet", wallet_path, class: "ks-text-link" %> -

-

- Send and receive sats over the Bitcoin Lightning Network -

-
-
-

- <%= link_to "Wiki", "https://wiki.kosmos.org", class: "ks-text-link" %> -

-

- Kosmos documentation and knowledge base -

-
-
-

- <%= link_to "Gitea", "https://gitea.kosmos.org", class: "ks-text-link" %> -

-

- Code hosting and collaboration for software projects -

-
-
-

- <%= link_to "Drone CI", "https://drone.kosmos.org", class: "ks-text-link" %> -

-

- Continuous integration for software projects on Gitea -

-
+<%= render layout: "components/main_simple" do %> +
+

+ Your Kosmos account and password currently give you access to these + services: +

+
+
+

+ <%= link_to "Chat", "https://wiki.kosmos.org/Services:Chat", class: "ks-text-link" %> +

+

+ Chat rooms and instant messaging (XMPP/Jabber) +

-
-
-
+
+

+ <%= link_to "Discourse", "https://community.kosmos.org", class: "ks-text-link" %> +

+

+ Kosmos community forums and user support/help site +

+
+
+

+ 🗲 + <%= link_to "Lightning Wallet", wallet_path, class: "ks-text-link" %> +

+

+ Send and receive sats over the Bitcoin Lightning Network +

+
+
+

+ <%= link_to "Wiki", "https://wiki.kosmos.org", class: "ks-text-link" %> +

+

+ Kosmos documentation and knowledge base +

+
+
+

+ <%= link_to "Gitea", "https://gitea.kosmos.org", class: "ks-text-link" %> +

+

+ Code hosting and collaboration for software projects +

+
+
+

+ <%= link_to "Drone CI", "https://drone.kosmos.org", class: "ks-text-link" %> +

+

+ Continuous integration for software projects on Gitea +

+
+ + +<% end %> diff --git a/app/views/donations/index.html.erb b/app/views/donations/index.html.erb index 89c2378..15b7d40 100644 --- a/app/views/donations/index.html.erb +++ b/app/views/donations/index.html.erb @@ -1,46 +1,44 @@ <%= render partial: "components/header", locals: { page_title: "Donations" } %> -
-
-
-

- Your financial contributions to the development and upkeep of Kosmos - software and services. -

-
+<%= render layout: "components/main_simple" do %> +
+

+ Your financial contributions to the development and upkeep of Kosmos + software and services. +

+
-
- <% if @donations.any? %> -
    - <% @donations.each do |donation| %> -
  • -

    - <%= donation.paid_at.strftime("%B %d, %Y") %> -

    -

    - - <%= number_with_delimiter donation.amount_sats %> sats - -
    - - (~ <%= number_to_currency donation.amount_eur / 100, unit: "" %> EUR) - -

    -

    - <% if donation.public_name.present? %> - Public name: <%= donation.public_name %> - <% else %> - Anonymous - <% end %> -

    -
  • - <% end %> -
- <% else %> -

- No donations to show. -

- <% end %> -
-
-
+
+ <% if @donations.any? %> + + <% else %> +

+ No donations to show. +

+ <% end %> +
+<% end %> diff --git a/app/views/invitations/index.html.erb b/app/views/invitations/index.html.erb index 303b2bd..83257fc 100644 --- a/app/views/invitations/index.html.erb +++ b/app/views/invitations/index.html.erb @@ -1,61 +1,59 @@ <%= render partial: "components/header", locals: { page_title: "Invitations" } %> -
-
-
- <% if @invitations_unused.any? %> -

- Invite your friends to a Kosmos account by sharing an invitation URL with them: -

- <% end %> -
- -
- <% if @invitations_unused.any? %> - - - - - - - - <% @invitations_unused.each do |invitation| %> - - - - <% end %> - -
URL
<%= invitation_url(invitation.token) %>
- <% else %> -

- You do not have any invitations to give away yet. All good - things come in time. -

- <% end %> -
- - <% if @invitations_used.any? %> -
-

Accepted Invitations

- - - - - - - - - - <% @invitations_used.each do |invitation| %> - - - - - - <% end %> - -
IDAcceptedInvited user
<%= invitation.token %><%= invitation.used_at.strftime("%Y-%m-%d") %><%= User.find(invitation.invited_user_id).address %>
-
+<%= render layout: "components/main_simple" do %> +
+ <% if @invitations_unused.any? %> +

+ Invite your friends to a Kosmos account by sharing an invitation URL with them: +

<% end %> -
-
+ + +
+ <% if @invitations_unused.any? %> + + + + + + + + <% @invitations_unused.each do |invitation| %> + + + + <% end %> + +
URL
<%= invitation_url(invitation.token) %>
+ <% else %> +

+ You do not have any invitations to give away yet. All good + things come in time. +

+ <% end %> +
+ + <% if @invitations_used.any? %> +
+

Accepted Invitations

+ + + + + + + + + + <% @invitations_used.each do |invitation| %> + + + + + + <% end %> + +
AcceptedInvited user
<%= invitation.used_at.strftime("%Y-%m-%d") %><%= User.find(invitation.invited_user_id).address %>
+
+ <% end %> +<% end %> diff --git a/app/views/layouts/admin.html.erb b/app/views/layouts/admin.html.erb index e4d5735..047c145 100644 --- a/app/views/layouts/admin.html.erb +++ b/app/views/layouts/admin.html.erb @@ -10,30 +10,71 @@ <%= stylesheet_link_tag 'application', "data-turbo-track": "reload" %> <%= javascript_importmap_tags %> - + +
+ + + <%= yield %> +
+
-
-

- <%= render partial: "shared/icons/comet" %> - Kosmos - Accounts -

- <%= render partial: 'shared/header_account' %> -
- - <% if user_signed_in? && current_user.confirmed? %> - <%= render partial: 'shared/admin_nav' %> - <% end %> - <% flash.each do |type, msg| %>

<%= msg %>

<% end %> - -
- <%= yield %> -
diff --git a/app/views/security/index.html.erb b/app/views/security/index.html.erb index c9e59ed..425fe9b 100644 --- a/app/views/security/index.html.erb +++ b/app/views/security/index.html.erb @@ -1,18 +1,16 @@ <%= render partial: "components/header", locals: { page_title: "Account" } %> -
-
-
-

Security

-
+<%= render layout: "components/main_simple" do %> +
+

Security

+
-
-

Password change

-

- <%= form_with(url: settings_reset_password_path, method: :post) do %> - <%= submit_tag("Send me a password reset link", class: 'btn-md btn-gray') %> - <% end %> -

-
-
-
+
+

Password change

+

+ <%= form_with(url: settings_reset_password_path, method: :post) do %> + <%= submit_tag("Send me a password reset link", class: 'btn-md btn-gray') %> + <% end %> +

+
+<% end %> diff --git a/app/views/shared/_admin_nav.html.erb b/app/views/shared/_admin_nav.html.erb index c1ca550..001aad6 100644 --- a/app/views/shared/_admin_nav.html.erb +++ b/app/views/shared/_admin_nav.html.erb @@ -1,22 +1,8 @@ - +<%= link_to "Dashboard", admin_root_path, + class: main_nav_class(@current_section, :dashboard) %> +<%= link_to "Invitations", admin_invitations_path, + class: main_nav_class(@current_section, :invitations) %> +<%= link_to "Donations", admin_donations_path, + class: main_nav_class(@current_section, :contributions) %> +<%= link_to "LDAP Users", admin_ldap_users_path, + class: main_nav_class(@current_section, :ldap_users) %> diff --git a/app/views/shared/status_forbidden.html.erb b/app/views/shared/status_forbidden.html.erb index cff9a63..ff47dcf 100644 --- a/app/views/shared/status_forbidden.html.erb +++ b/app/views/shared/status_forbidden.html.erb @@ -1,2 +1,6 @@ -

Access forbidden

-

Sorry, you're not allowed to access this page.

+<%= render partial: "components/header", locals: { page_title: "403" } %> + +<%= render layout: "components/main_simple" do %> +

Access forbidden

+

Sorry, you're not allowed to access this page.

+<% end %> diff --git a/app/views/shared/status_not_found.html.erb b/app/views/shared/status_not_found.html.erb index c31810c..44e8b49 100644 --- a/app/views/shared/status_not_found.html.erb +++ b/app/views/shared/status_not_found.html.erb @@ -1,2 +1,6 @@ -

Not found

-

Sorry, this page does not exist.

+<%= render partial: "components/header", locals: { page_title: "404" } %> + +<%= render layout: "components/main_simple" do %> +

Not found

+

Sorry, this page does not exist.

+<% end %> diff --git a/app/views/shared/status_unauthorized.html.erb b/app/views/shared/status_unauthorized.html.erb index e69de29..9e8a412 100644 --- a/app/views/shared/status_unauthorized.html.erb +++ b/app/views/shared/status_unauthorized.html.erb @@ -0,0 +1,6 @@ +<%= render partial: "components/header", locals: { page_title: "401" } %> + +<%= render layout: "components/main_simple" do %> +

Unauthorized

+

This page needs authorization to access.

+<% end %> diff --git a/app/views/wallet/index.html.erb b/app/views/wallet/index.html.erb index 8c800fa..c34b2bc 100644 --- a/app/views/wallet/index.html.erb +++ b/app/views/wallet/index.html.erb @@ -1,92 +1,90 @@ <%= render partial: "components/header", locals: { page_title: "Wallet" } %> -
-
-
-
-

- Send and receive sats via the Bitcoin Lightning Network. -

-
-
-

- <% if @balance %> - <%= number_with_delimiter @balance %> sats
- Available balance - <% else %> - n/a sats
- Balance unavailable - <% end %> -

-
-
- -
-

Lightning Address

+<%= render layout: "components/main_simple" do %> +
+

- Your Kosmos user address is also a - Lightning Address! - The easiest way to receive sats is by just giving out your address: + Send and receive sats via the Bitcoin Lightning Network.

-

- <%= current_user.address %> +

+
+

+ <% if @balance %> + <%= number_with_delimiter @balance %> sats
+ Available balance + <% else %> + n/a sats
+ Balance unavailable + <% end %>

-
+
+ -
-

Wallet Apps

-

- You can connect various wallet apps to your Kosmos account. This allows - you to both receive and send sats. Any wallet that supports - LNDHub - accounts should be able to add/import your account using our setup - code/URL: -

-

- - or - - -

- -
+
+

Lightning Address

+

+ Your Kosmos user address is also a + Lightning Address! + The easiest way to receive sats is by just giving out your address: +

+

+ <%= current_user.address %> +

+
-
-

Recommended Apps

-
-

- - <%= image_tag("/img/logos/bluewallet.svg", class: 'h-16') %> - -

-

- Android / iOS / macOS -

-

- When adding a wallet, choose "Import wallet" on the bottom of the screen, - then scan the setup QR code. -

-

- - <%= image_tag("/img/logos/alby.svg", class: 'h-16') %> - -

-

- Firefox / Chrome (Opera, Brave, Chromium-based browsers) -

-

- Choose "LNDHub (Bluewallet)" in the connect dialog and paste the setup - URL in the "LNDHub Export URI" field. -

-
-
- -
+
+

Wallet Apps

+

+ You can connect various wallet apps to your Kosmos account. This allows + you to both receive and send sats. Any wallet that supports + LNDHub + accounts should be able to add/import your account using our setup + code/URL: +

+

+ + or + + +

+ +
+ +
+

Recommended Apps

+
+

+ + <%= image_tag("/img/logos/bluewallet.svg", class: 'h-16') %> + +

+

+ Android / iOS / macOS +

+

+ When adding a wallet, choose "Import wallet" on the bottom of the screen, + then scan the setup QR code. +

+

+ + <%= image_tag("/img/logos/alby.svg", class: 'h-16') %> + +

+

+ Firefox / Chrome (Opera, Brave, Chromium-based browsers) +

+

+ Choose "LNDHub (Bluewallet)" in the connect dialog and paste the setup + URL in the "LNDHub Export URI" field. +

+
+
+<% end %>