Port admin to new layout
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
4f2b35ccb9
commit
2e301c3019
@ -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;
|
||||
|
@ -1,3 +1,7 @@
|
||||
<p class="text-center">
|
||||
With great power comes great responsibility.
|
||||
</p>
|
||||
<%= render partial: "components/header", locals: { page_title: "Admin Panel" } %>
|
||||
|
||||
<%= render layout: "components/main_simple" do %>
|
||||
<p class="text-center">
|
||||
With great power comes great responsibility.
|
||||
</p>
|
||||
<% end %>
|
||||
|
@ -1,8 +1,12 @@
|
||||
<h2>Editing Donation</h2>
|
||||
<%= render partial: "components/header", locals: { page_title: "Donations" } %>
|
||||
|
||||
<%= render 'form', donation: @donation, url: admin_donation_path(@donation) %>
|
||||
<%= render layout: "components/main_simple" do %>
|
||||
<h2>Editing Donation</h2>
|
||||
|
||||
<p class="mt-8">
|
||||
<%= link_to 'Show', admin_donation_path(@donation), class: 'ks-text-link' %> |
|
||||
<%= link_to 'Back', admin_donations_path, class: 'ks-text-link' %>
|
||||
<p>
|
||||
<%= render 'form', donation: @donation, url: admin_donation_path(@donation) %>
|
||||
|
||||
<p class="mt-8">
|
||||
<%= link_to 'Show', admin_donation_path(@donation), class: 'ks-text-link' %> |
|
||||
<%= link_to 'Back', admin_donations_path, class: 'ks-text-link' %>
|
||||
<p>
|
||||
<% end %>
|
||||
|
@ -1,41 +1,43 @@
|
||||
<h2>Donations</h2>
|
||||
<%= render partial: "components/header", locals: { page_title: "Donations" } %>
|
||||
|
||||
<% if @donations.any? %>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>User</th>
|
||||
<th>Amount BTC</th>
|
||||
<th>in EUR</th>
|
||||
<th>in USD</th>
|
||||
<th>Public name</th>
|
||||
<th>Date</th>
|
||||
<th colspan="3"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<% @donations.each do |donation| %>
|
||||
<tr>
|
||||
<td><%= donation.user.cn %></td>
|
||||
<td><%= sats_to_btc donation.amount_sats %> BTC</td>
|
||||
<td><%= number_to_currency donation.amount_eur / 100, unit: "" %></td>
|
||||
<td><%= number_to_currency donation.amount_usd / 100, unit: "" %></td>
|
||||
<td><%= donation.public_name %></td>
|
||||
<td><%= donation.paid_at ? donation.paid_at.strftime("%Y-%m-%d") : "" %></td>
|
||||
<td><%= link_to 'Show', admin_donation_path(donation), class: 'btn btn-sm btn-gray' %></td>
|
||||
<td><%= link_to 'Edit', edit_admin_donation_path(donation), class: 'btn btn-sm btn-gray' %></td>
|
||||
<td><%= link_to 'Destroy', admin_donation_path(donation), class: 'btn btn-sm btn-red', method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
||||
<%= render layout: "components/main_simple" do %>
|
||||
<% if @donations.any? %>
|
||||
<table class="w-full">
|
||||
<thead>
|
||||
<tr class="text-left">
|
||||
<th>User</th>
|
||||
<th>Amount BTC</th>
|
||||
<th>in EUR</th>
|
||||
<th>in USD</th>
|
||||
<th>Public name</th>
|
||||
<th>Date</th>
|
||||
<th colspan="3"></th>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<% else %>
|
||||
<p>
|
||||
No donations yet.
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<% @donations.each do |donation| %>
|
||||
<tr>
|
||||
<td><%= donation.user.address %></td>
|
||||
<td><%= sats_to_btc donation.amount_sats %> BTC</td>
|
||||
<td><%= number_to_currency donation.amount_eur / 100, unit: "" %></td>
|
||||
<td><%= number_to_currency donation.amount_usd / 100, unit: "" %></td>
|
||||
<td><%= donation.public_name %></td>
|
||||
<td><%= donation.paid_at ? donation.paid_at.strftime("%Y-%m-%d") : "" %></td>
|
||||
<td><%= link_to 'Show', admin_donation_path(donation), class: 'btn btn-sm btn-gray' %></td>
|
||||
<td><%= link_to 'Edit', edit_admin_donation_path(donation), class: 'btn btn-sm btn-gray' %></td>
|
||||
<td><%= link_to 'Destroy', admin_donation_path(donation), class: 'btn btn-sm btn-red', method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<% else %>
|
||||
<p>
|
||||
No donations yet.
|
||||
</p>
|
||||
<% end %>
|
||||
|
||||
<p class="mt-12">
|
||||
<%= link_to 'Record an out-of-system donation', new_admin_donation_path, class: 'btn-md btn-gray' %>
|
||||
</p>
|
||||
<% end %>
|
||||
|
||||
<p class="mt-12">
|
||||
<%= link_to 'Record an out-of-system donation', new_admin_donation_path, class: 'btn-md btn-gray' %>
|
||||
</p>
|
||||
|
@ -1,7 +1,11 @@
|
||||
<h2>New Donation</h2>
|
||||
<%= render partial: "components/header", locals: { page_title: "Donations" } %>
|
||||
|
||||
<%= render 'form', donation: @donation, url: admin_donations_path %>
|
||||
<%= render layout: "components/main_simple" do %>
|
||||
<h2>New Donation</h2>
|
||||
|
||||
<p class="mt-8">
|
||||
<%= link_to 'Back', admin_donations_path, class: 'ks-text-link' %>
|
||||
</p>
|
||||
<%= render 'form', donation: @donation, url: admin_donations_path %>
|
||||
|
||||
<p class="mt-8">
|
||||
<%= link_to 'Back', admin_donations_path, class: 'ks-text-link' %>
|
||||
</p>
|
||||
<% end %>
|
||||
|
@ -1,36 +1,40 @@
|
||||
<p id="notice"><%= notice %></p>
|
||||
<%= render partial: "components/header", locals: { page_title: "Donations" } %>
|
||||
|
||||
<p>
|
||||
<strong>User:</strong>
|
||||
<%= @donation.user_id %>
|
||||
</p>
|
||||
<%= render layout: "components/main_simple" do %>
|
||||
<p id="notice"><%= notice %></p>
|
||||
|
||||
<p>
|
||||
<strong>Amount sats:</strong>
|
||||
<%= @donation.amount_sats %>
|
||||
</p>
|
||||
<p>
|
||||
<strong>User:</strong>
|
||||
<%= @donation.user.address %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>Amount eur:</strong>
|
||||
<%= @donation.amount_eur %>
|
||||
</p>
|
||||
<p>
|
||||
<strong>Amount sats:</strong>
|
||||
<%= @donation.amount_sats %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>Amount usd:</strong>
|
||||
<%= @donation.amount_usd %>
|
||||
</p>
|
||||
<p>
|
||||
<strong>Amount eur:</strong>
|
||||
<%= @donation.amount_eur %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>Public name:</strong>
|
||||
<%= @donation.public_name %>
|
||||
</p>
|
||||
<p>
|
||||
<strong>Amount usd:</strong>
|
||||
<%= @donation.amount_usd %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>Date:</strong>
|
||||
<%= @donation.paid_at %>
|
||||
</p>
|
||||
<p>
|
||||
<strong>Public name:</strong>
|
||||
<%= @donation.public_name %>
|
||||
</p>
|
||||
|
||||
<p class="mt-8">
|
||||
<%= link_to 'Edit', edit_admin_donation_path(@donation), class: 'ks-text-link' %> |
|
||||
<%= link_to 'Back', admin_donations_path, class: 'ks-text-link' %>
|
||||
</p>
|
||||
<p>
|
||||
<strong>Date:</strong>
|
||||
<%= @donation.paid_at %>
|
||||
</p>
|
||||
|
||||
<p class="mt-8">
|
||||
<%= link_to 'Edit', edit_admin_donation_path(@donation), class: 'ks-text-link' %> |
|
||||
<%= link_to 'Back', admin_donations_path, class: 'ks-text-link' %>
|
||||
</p>
|
||||
<% end %>
|
||||
|
@ -1,32 +1,35 @@
|
||||
<section>
|
||||
<h2>Invitations</h2>
|
||||
<p>
|
||||
There are currently <strong><%= @invitations_unused_count %>
|
||||
unused invitations</strong> available to existing users.
|
||||
<strong><%= @users_with_referrals_count %> users</strong> have successfully
|
||||
invited new users.
|
||||
</p>
|
||||
</section>
|
||||
<% if @invitations_used.any? %>
|
||||
<%= render partial: "components/header", locals: { page_title: "Invitations" } %>
|
||||
|
||||
<%= render layout: "components/main_simple" do %>
|
||||
<section>
|
||||
<h3>Accepted (<%= @invitations_used.length %>)</h3>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Token</th>
|
||||
<th>Accepted</th>
|
||||
<th>Invited user</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @invitations_used.each do |invitation| %>
|
||||
<tr>
|
||||
<td class="overflow-ellipsis"><%= invitation.token %></td>
|
||||
<td><%= invitation.used_at.strftime("%Y-%m-%d") %></td>
|
||||
<td><%= User.find(invitation.invited_user_id).address %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>
|
||||
There are currently <strong><%= @invitations_unused_count %>
|
||||
unused invitations</strong> available to existing users.
|
||||
<strong><%= @users_with_referrals_count %> users</strong> have successfully
|
||||
invited new users.
|
||||
</p>
|
||||
</section>
|
||||
<% if @invitations_used.any? %>
|
||||
<section>
|
||||
<h3>Accepted (<%= @invitations_used.length %>)</h3>
|
||||
<table>
|
||||
<thead>
|
||||
<tr class="text-left">
|
||||
<th>Token</th>
|
||||
<th>Accepted</th>
|
||||
<th>Invited user</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @invitations_used.each do |invitation| %>
|
||||
<tr>
|
||||
<td class="overflow-ellipsis font-mono"><%= invitation.token %></td>
|
||||
<td><%= invitation.used_at.strftime("%Y-%m-%d") %></td>
|
||||
<td><%= User.find(invitation.invited_user_id).address %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
@ -1,32 +1,34 @@
|
||||
<h2>LDAP users: <%= @ou %></h2>
|
||||
<%= render partial: "components/header", locals: { page_title: "LDAP Users: #{@ou}" } %>
|
||||
|
||||
<h3 class="hidden">Domains</h3>
|
||||
<ul class="mb-10">
|
||||
<li class="inline-block">
|
||||
<%= link_to 'kosmos.org', admin_ldap_users_path, class: "ks-text-link" %>
|
||||
</li>
|
||||
<li class="inline-block ml-6">
|
||||
<%= link_to '5apps.com', admin_ldap_users_path(ou: '5apps.com'), class: "ks-text-link" %>
|
||||
</li>
|
||||
</ul>
|
||||
<%= render layout: "components/main_simple" do %>
|
||||
<h3 class="hidden">Domains</h3>
|
||||
<ul class="mb-10">
|
||||
<li class="inline-block">
|
||||
<%= link_to 'kosmos.org', admin_ldap_users_path, class: "ks-text-link" %>
|
||||
</li>
|
||||
<li class="inline-block ml-6">
|
||||
<%= link_to '5apps.com', admin_ldap_users_path(ou: '5apps.com'), class: "ks-text-link" %>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>UID</th>
|
||||
<th>E-Mail</th>
|
||||
<th>Admin</th>
|
||||
<!-- <th>Password</th> -->
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @entries.each do |entry| %>
|
||||
<tr>
|
||||
<td><%= entry[:uid] %></td>
|
||||
<td><%= entry[:mail] %></td>
|
||||
<td><%= entry[:admin] %></td>
|
||||
<!-- <td><%= entry[:password] %></td> -->
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<table>
|
||||
<thead>
|
||||
<tr class="text-left">
|
||||
<th>UID</th>
|
||||
<th>E-Mail</th>
|
||||
<th>Admin</th>
|
||||
<!-- <th>Password</th> -->
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @entries.each do |entry| %>
|
||||
<tr>
|
||||
<td><%= entry[:uid] %></td>
|
||||
<td><%= entry[:mail] %></td>
|
||||
<td><%= entry[:admin] %></td>
|
||||
<!-- <td><%= entry[:password] %></td> -->
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<% end %>
|
||||
|
5
app/views/components/_main_simple.html.erb
Normal file
5
app/views/components/_main_simple.html.erb
Normal file
@ -0,0 +1,5 @@
|
||||
<main class="w-full max-w-6xl mx-auto pb-12 px-4 sm:px-6 lg:px-8">
|
||||
<div class="bg-white rounded-lg shadow px-6 py-12 sm:px-12">
|
||||
<%= yield %>
|
||||
</div>
|
||||
</main>
|
@ -1,63 +1,61 @@
|
||||
<%= render partial: "components/header", locals: { page_title: "Services" } %>
|
||||
|
||||
<main class="w-full max-w-6xl mx-auto pb-12 px-4 sm:px-6 lg:px-8">
|
||||
<div class="bg-white rounded-lg shadow px-6 py-12 sm:px-12">
|
||||
<section>
|
||||
<p>
|
||||
Your Kosmos account and password currently give you access to these
|
||||
services:
|
||||
</p>
|
||||
<div class="grid services mt-12">
|
||||
<div>
|
||||
<h3 class="mb-3.5">
|
||||
<%= link_to "Chat", "https://wiki.kosmos.org/Services:Chat", class: "ks-text-link" %>
|
||||
</h3>
|
||||
<p class="text-gray-500">
|
||||
Chat rooms and instant messaging (XMPP/Jabber)
|
||||
</p>
|
||||
</div>
|
||||
<div>
|
||||
<h3 class="mb-3.5">
|
||||
<%= link_to "Discourse", "https://community.kosmos.org", class: "ks-text-link" %>
|
||||
</h3>
|
||||
<p class="text-gray-500">
|
||||
Kosmos community forums and user support/help site
|
||||
</p>
|
||||
</div>
|
||||
<div>
|
||||
<h3 class="mb-3.5">
|
||||
<span class="text-yellow-500">🗲</span>
|
||||
<%= link_to "Lightning Wallet", wallet_path, class: "ks-text-link" %>
|
||||
</h3>
|
||||
<p class="text-gray-500">
|
||||
Send and receive sats over the Bitcoin Lightning Network
|
||||
</p>
|
||||
</div>
|
||||
<div>
|
||||
<h3 class="mb-3.5">
|
||||
<%= link_to "Wiki", "https://wiki.kosmos.org", class: "ks-text-link" %>
|
||||
</h3>
|
||||
<p class="text-gray-500">
|
||||
Kosmos documentation and knowledge base
|
||||
</p>
|
||||
</div>
|
||||
<div>
|
||||
<h3 class="mb-3.5">
|
||||
<%= link_to "Gitea", "https://gitea.kosmos.org", class: "ks-text-link" %>
|
||||
</h3>
|
||||
<p class="text-gray-500">
|
||||
Code hosting and collaboration for software projects
|
||||
</p>
|
||||
</div>
|
||||
<div>
|
||||
<h3 class="mb-3.5">
|
||||
<%= link_to "Drone CI", "https://drone.kosmos.org", class: "ks-text-link" %>
|
||||
</h3>
|
||||
<p class="text-gray-500">
|
||||
Continuous integration for software projects on Gitea
|
||||
</p>
|
||||
</div>
|
||||
<%= render layout: "components/main_simple" do %>
|
||||
<section>
|
||||
<p>
|
||||
Your Kosmos account and password currently give you access to these
|
||||
services:
|
||||
</p>
|
||||
<div class="grid services mt-12">
|
||||
<div>
|
||||
<h3 class="mb-3.5">
|
||||
<%= link_to "Chat", "https://wiki.kosmos.org/Services:Chat", class: "ks-text-link" %>
|
||||
</h3>
|
||||
<p class="text-gray-500">
|
||||
Chat rooms and instant messaging (XMPP/Jabber)
|
||||
</p>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</main>
|
||||
<div>
|
||||
<h3 class="mb-3.5">
|
||||
<%= link_to "Discourse", "https://community.kosmos.org", class: "ks-text-link" %>
|
||||
</h3>
|
||||
<p class="text-gray-500">
|
||||
Kosmos community forums and user support/help site
|
||||
</p>
|
||||
</div>
|
||||
<div>
|
||||
<h3 class="mb-3.5">
|
||||
<span class="text-yellow-500">🗲</span>
|
||||
<%= link_to "Lightning Wallet", wallet_path, class: "ks-text-link" %>
|
||||
</h3>
|
||||
<p class="text-gray-500">
|
||||
Send and receive sats over the Bitcoin Lightning Network
|
||||
</p>
|
||||
</div>
|
||||
<div>
|
||||
<h3 class="mb-3.5">
|
||||
<%= link_to "Wiki", "https://wiki.kosmos.org", class: "ks-text-link" %>
|
||||
</h3>
|
||||
<p class="text-gray-500">
|
||||
Kosmos documentation and knowledge base
|
||||
</p>
|
||||
</div>
|
||||
<div>
|
||||
<h3 class="mb-3.5">
|
||||
<%= link_to "Gitea", "https://gitea.kosmos.org", class: "ks-text-link" %>
|
||||
</h3>
|
||||
<p class="text-gray-500">
|
||||
Code hosting and collaboration for software projects
|
||||
</p>
|
||||
</div>
|
||||
<div>
|
||||
<h3 class="mb-3.5">
|
||||
<%= link_to "Drone CI", "https://drone.kosmos.org", class: "ks-text-link" %>
|
||||
</h3>
|
||||
<p class="text-gray-500">
|
||||
Continuous integration for software projects on Gitea
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<% end %>
|
||||
|
@ -1,46 +1,44 @@
|
||||
<%= render partial: "components/header", locals: { page_title: "Donations" } %>
|
||||
|
||||
<main class="w-full max-w-6xl mx-auto pb-12 px-4 sm:px-6 lg:px-8">
|
||||
<div class="bg-white rounded-lg shadow px-6 py-12 sm:px-12">
|
||||
<section>
|
||||
<p>
|
||||
Your financial contributions to the development and upkeep of Kosmos
|
||||
software and services.
|
||||
</p>
|
||||
</section>
|
||||
<%= render layout: "components/main_simple" do %>
|
||||
<section>
|
||||
<p>
|
||||
Your financial contributions to the development and upkeep of Kosmos
|
||||
software and services.
|
||||
</p>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<% if @donations.any? %>
|
||||
<ul class="donations list-none">
|
||||
<% @donations.each do |donation| %>
|
||||
<li class="mb-8 grid gap-y-2 gap-x-8 grid-cols-2 items-center">
|
||||
<h3 class="mb-0">
|
||||
<%= donation.paid_at.strftime("%B %d, %Y") %>
|
||||
</h3>
|
||||
<p class="row-span-2 font-mono text-right mb-0">
|
||||
<span class="text-xl">
|
||||
<%= number_with_delimiter donation.amount_sats %> sats
|
||||
</span>
|
||||
<br>
|
||||
<span class="text-sm text-gray-500">
|
||||
(~ <%= number_to_currency donation.amount_eur / 100, unit: "" %> EUR)
|
||||
</span>
|
||||
</p>
|
||||
<p class="mb-0">
|
||||
<% if donation.public_name.present? %>
|
||||
Public name: <%= donation.public_name %>
|
||||
<% else %>
|
||||
Anonymous
|
||||
<% end %>
|
||||
</p>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<% else %>
|
||||
<p>
|
||||
No donations to show.
|
||||
</p>
|
||||
<% end %>
|
||||
</section>
|
||||
</div>
|
||||
</main>
|
||||
<section>
|
||||
<% if @donations.any? %>
|
||||
<ul class="donations list-none">
|
||||
<% @donations.each do |donation| %>
|
||||
<li class="mb-8 grid gap-y-2 gap-x-8 grid-cols-2 items-center">
|
||||
<h3 class="mb-0">
|
||||
<%= donation.paid_at.strftime("%B %d, %Y") %>
|
||||
</h3>
|
||||
<p class="row-span-2 font-mono text-right mb-0">
|
||||
<span class="text-xl">
|
||||
<%= number_with_delimiter donation.amount_sats %> sats
|
||||
</span>
|
||||
<br>
|
||||
<span class="text-sm text-gray-500">
|
||||
(~ <%= number_to_currency donation.amount_eur / 100, unit: "" %> EUR)
|
||||
</span>
|
||||
</p>
|
||||
<p class="mb-0">
|
||||
<% if donation.public_name.present? %>
|
||||
Public name: <%= donation.public_name %>
|
||||
<% else %>
|
||||
Anonymous
|
||||
<% end %>
|
||||
</p>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<% else %>
|
||||
<p>
|
||||
No donations to show.
|
||||
</p>
|
||||
<% end %>
|
||||
</section>
|
||||
<% end %>
|
||||
|
@ -1,61 +1,59 @@
|
||||
<%= render partial: "components/header", locals: { page_title: "Invitations" } %>
|
||||
|
||||
<main class="w-full max-w-6xl mx-auto pb-12 px-4 sm:px-6 lg:px-8">
|
||||
<div class="bg-white rounded-lg shadow px-6 py-12 sm:px-12">
|
||||
<section>
|
||||
<% if @invitations_unused.any? %>
|
||||
<p>
|
||||
Invite your friends to a Kosmos account by sharing an invitation URL with them:
|
||||
</p>
|
||||
<% end %>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<% if @invitations_unused.any? %>
|
||||
<table>
|
||||
<thead>
|
||||
<tr class="text-left">
|
||||
<th>URL</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @invitations_unused.each do |invitation| %>
|
||||
<tr>
|
||||
<td class="font-mono"><%= invitation_url(invitation.token) %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<% else %>
|
||||
<p>
|
||||
You do not have any invitations to give away yet. All good
|
||||
things come in time.
|
||||
</p>
|
||||
<% end %>
|
||||
</section>
|
||||
|
||||
<% if @invitations_used.any? %>
|
||||
<section>
|
||||
<h3>Accepted Invitations</h3>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="hide-small">ID</th>
|
||||
<th>Accepted</th>
|
||||
<th>Invited user</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @invitations_used.each do |invitation| %>
|
||||
<tr>
|
||||
<td class="hide-small"><%= invitation.token %></td>
|
||||
<td><%= invitation.used_at.strftime("%Y-%m-%d") %></td>
|
||||
<td><%= User.find(invitation.invited_user_id).address %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
<%= render layout: "components/main_simple" do %>
|
||||
<section>
|
||||
<% if @invitations_unused.any? %>
|
||||
<p>
|
||||
Invite your friends to a Kosmos account by sharing an invitation URL with them:
|
||||
</p>
|
||||
<% end %>
|
||||
</div>
|
||||
</main>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<% if @invitations_unused.any? %>
|
||||
<table>
|
||||
<thead>
|
||||
<tr class="text-left">
|
||||
<th>URL</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @invitations_unused.each do |invitation| %>
|
||||
<tr>
|
||||
<td class="font-mono"><%= invitation_url(invitation.token) %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<% else %>
|
||||
<p>
|
||||
You do not have any invitations to give away yet. All good
|
||||
things come in time.
|
||||
</p>
|
||||
<% end %>
|
||||
</section>
|
||||
|
||||
<% if @invitations_used.any? %>
|
||||
<section>
|
||||
<h3>Accepted Invitations</h3>
|
||||
<table>
|
||||
<thead>
|
||||
<tr class="text-left">
|
||||
<th class="hidden md:block">ID</th>
|
||||
<th>Accepted</th>
|
||||
<th>Invited user</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @invitations_used.each do |invitation| %>
|
||||
<tr>
|
||||
<td class="hidden md:block font-mono"><%= invitation.token %></td>
|
||||
<td><%= invitation.used_at.strftime("%Y-%m-%d") %></td>
|
||||
<td><%= User.find(invitation.invited_user_id).address %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
@ -10,30 +10,71 @@
|
||||
<%= stylesheet_link_tag 'application', "data-turbo-track": "reload" %>
|
||||
<%= javascript_importmap_tags %>
|
||||
</head>
|
||||
<body id="admin-panel">
|
||||
<body id="admin-panel" class="bg-red-500">
|
||||
<div class="">
|
||||
<nav class="">
|
||||
<div class="max-w-6xl mx-auto sm:px-6 lg:px-8">
|
||||
<div class="border-b border-gray-200/10">
|
||||
<div class="flex items-center justify-between h-16 px-4 sm:px-0">
|
||||
<div class="flex items-center">
|
||||
<div class="ks-site-icon flex-shrink-0">
|
||||
<%= render partial: "shared/icons/comet" %>
|
||||
<!-- <img class="h-8 w-8" src="https://tailwindui.com/img/logos/workflow-mark-indigo-500.svg" alt="Workflow"> -->
|
||||
</div>
|
||||
<div class="hidden md:block">
|
||||
<div class="ml-10 flex items-baseline space-x-4">
|
||||
<% if user_signed_in? && current_user.is_admin? %>
|
||||
<%= render partial: 'shared/admin_nav' %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hidden md:block">
|
||||
<%= render partial: 'shared/header_account' %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Mobile menu, show/hide based on menu state. -->
|
||||
<div class="border-b border-gray-700 md:hidden" id="mobile-menu">
|
||||
<div class="pt-4 pb-3 border-t border-gray-700">
|
||||
<div class="flex items-center px-5">
|
||||
<div class="flex-shrink-0">
|
||||
<img class="h-10 w-10 rounded-full" src="" alt="">
|
||||
</div>
|
||||
<div class="ml-3">
|
||||
<div class="text-base font-medium leading-none text-white">Tom Cook</div>
|
||||
<div class="text-sm font-medium leading-none text-gray-400">tom@example.com</div>
|
||||
</div>
|
||||
<button type="button" class="ml-auto bg-gray-800 flex-shrink-0 p-1 text-gray-400 rounded-full hover:text-white focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-gray-800 focus:ring-white">
|
||||
<span class="sr-only">View notifications</span>
|
||||
<!-- Heroicon name: outline/bell -->
|
||||
<svg class="h-6 w-6" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" aria-hidden="true">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9" />
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
<div class="mt-3 px-2 space-y-1">
|
||||
<a href="#" class="block px-3 py-2 rounded-md text-base font-medium text-gray-400 hover:text-white hover:bg-gray-700">Your Profile</a>
|
||||
|
||||
<a href="#" class="block px-3 py-2 rounded-md text-base font-medium text-gray-400 hover:text-white hover:bg-gray-700">Settings</a>
|
||||
|
||||
<a href="#" class="block px-3 py-2 rounded-md text-base font-medium text-gray-400 hover:text-white hover:bg-gray-700">Sign out</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<%= yield %>
|
||||
</div>
|
||||
|
||||
<div id="wrapper">
|
||||
<header>
|
||||
<h1>
|
||||
<span class ="icon"><%= render partial: "shared/icons/comet" %></span>
|
||||
<span class ="project-name">Kosmos</span>
|
||||
<span class ="site-name">Accounts</span>
|
||||
</h1>
|
||||
<%= render partial: 'shared/header_account' %>
|
||||
</header>
|
||||
|
||||
<% if user_signed_in? && current_user.confirmed? %>
|
||||
<%= render partial: 'shared/admin_nav' %>
|
||||
<% end %>
|
||||
|
||||
<% flash.each do |type, msg| %>
|
||||
<div class="flash-msg <%= type %>">
|
||||
<p><%= msg %></p>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<main>
|
||||
<%= yield %>
|
||||
</main>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -1,18 +1,16 @@
|
||||
<%= render partial: "components/header", locals: { page_title: "Account" } %>
|
||||
|
||||
<main class="w-full max-w-6xl mx-auto pb-12 px-4 sm:px-6 lg:px-8">
|
||||
<div class="bg-white rounded-lg shadow px-6 py-12 sm:px-12">
|
||||
<section>
|
||||
<h2>Security</h2>
|
||||
</section>
|
||||
<%= render layout: "components/main_simple" do %>
|
||||
<section>
|
||||
<h2>Security</h2>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h3>Password change</h3>
|
||||
<p>
|
||||
<%= form_with(url: settings_reset_password_path, method: :post) do %>
|
||||
<%= submit_tag("Send me a password reset link", class: 'btn-md btn-gray') %>
|
||||
<% end %>
|
||||
</p>
|
||||
</section>
|
||||
</div>
|
||||
</main>
|
||||
<section>
|
||||
<h3>Password change</h3>
|
||||
<p>
|
||||
<%= form_with(url: settings_reset_password_path, method: :post) do %>
|
||||
<%= submit_tag("Send me a password reset link", class: 'btn-md btn-gray') %>
|
||||
<% end %>
|
||||
</p>
|
||||
</section>
|
||||
<% end %>
|
||||
|
@ -1,22 +1,8 @@
|
||||
<nav id="main-nav">
|
||||
<div class="wrapper">
|
||||
<ul class="pages">
|
||||
<li>
|
||||
<%= link_to "Dashboard", admin_root_path,
|
||||
class: @current_section == :dashboard ? "active" : nil %>
|
||||
</li>
|
||||
<li>
|
||||
<%= link_to "Invitations", admin_invitations_path,
|
||||
class: @current_section == :invitations ? "active" : nil %>
|
||||
</li>
|
||||
<li>
|
||||
<%= link_to "Donations", admin_donations_path,
|
||||
class: @current_section == :donations ? "active" : nil %>
|
||||
</li>
|
||||
<li>
|
||||
<%= link_to "LDAP Users", admin_ldap_users_path,
|
||||
class: @current_section == :ldap_users ? "active" : nil %>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
<%= 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) %>
|
||||
|
@ -1,2 +1,6 @@
|
||||
<h2>Access forbidden</h2>
|
||||
<p>Sorry, you're not allowed to access this page.</p>
|
||||
<%= render partial: "components/header", locals: { page_title: "403" } %>
|
||||
|
||||
<%= render layout: "components/main_simple" do %>
|
||||
<h2>Access forbidden</h2>
|
||||
<p>Sorry, you're not allowed to access this page.</p>
|
||||
<% end %>
|
||||
|
@ -1,2 +1,6 @@
|
||||
<h2>Not found</h2>
|
||||
<p>Sorry, this page does not exist.</p>
|
||||
<%= render partial: "components/header", locals: { page_title: "404" } %>
|
||||
|
||||
<%= render layout: "components/main_simple" do %>
|
||||
<h2>Not found</h2>
|
||||
<p>Sorry, this page does not exist.</p>
|
||||
<% end %>
|
||||
|
@ -0,0 +1,6 @@
|
||||
<%= render partial: "components/header", locals: { page_title: "401" } %>
|
||||
|
||||
<%= render layout: "components/main_simple" do %>
|
||||
<h2>Unauthorized</h2>
|
||||
<p>This page needs authorization to access.</p>
|
||||
<% end %>
|
@ -1,92 +1,90 @@
|
||||
<%= render partial: "components/header", locals: { page_title: "Wallet" } %>
|
||||
|
||||
<main class="w-full max-w-6xl mx-auto pb-12 px-4 sm:px-6 lg:px-8">
|
||||
<div class="bg-white rounded-lg shadow px-6 py-12 sm:px-12">
|
||||
<section class="w-full grid grid-cols-1 md:grid-cols-12 md:mb-0">
|
||||
<div class="md:col-span-8">
|
||||
<p>
|
||||
Send and receive sats via the Bitcoin Lightning Network.
|
||||
</p>
|
||||
</div>
|
||||
<div class="md:col-span-4 mt-4 md:mt-0">
|
||||
<p class="font-mono md:text-right mb-0 p-4 border border-gray-300 rounded-lg overflow-hidden">
|
||||
<% if @balance %>
|
||||
<span class="text-xl"><%= number_with_delimiter @balance %> sats</span><br>
|
||||
<span class="text-sm text-gray-500">Available balance</span>
|
||||
<% else %>
|
||||
<span class="text-xl">n/a sats</span><br>
|
||||
<span class="text-sm text-gray-500">Balance unavailable</span>
|
||||
<% end %>
|
||||
</p>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h3>Lightning Address</h3>
|
||||
<%= render layout: "components/main_simple" do %>
|
||||
<section class="w-full grid grid-cols-1 md:grid-cols-12 md:mb-0">
|
||||
<div class="md:col-span-8">
|
||||
<p>
|
||||
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:
|
||||
Send and receive sats via the Bitcoin Lightning Network.
|
||||
</p>
|
||||
<p>
|
||||
<strong><%= current_user.address %></strong>
|
||||
</div>
|
||||
<div class="md:col-span-4 mt-4 md:mt-0">
|
||||
<p class="font-mono md:text-right mb-0 p-4 border border-gray-300 rounded-lg overflow-hidden">
|
||||
<% if @balance %>
|
||||
<span class="text-xl"><%= number_with_delimiter @balance %> sats</span><br>
|
||||
<span class="text-sm text-gray-500">Available balance</span>
|
||||
<% else %>
|
||||
<span class="text-xl">n/a sats</span><br>
|
||||
<span class="text-sm text-gray-500">Balance unavailable</span>
|
||||
<% end %>
|
||||
</p>
|
||||
</section>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h3>Wallet Apps</h3>
|
||||
<p>
|
||||
You can connect various wallet apps to your Kosmos account. This allows
|
||||
you to both receive and send sats. Any wallet that supports
|
||||
<a href="https://bluewallet.io/lndhub/" class="ks-text-link" target="_blank">LNDHub</a>
|
||||
accounts should be able to add/import your account using our setup
|
||||
code/URL:
|
||||
</p>
|
||||
<p class="my-6 text-center md:text-left">
|
||||
<button id="copy-setup-code" class="btn-md btn-blue">Copy setup code/URL</button>
|
||||
<span class="mx-2 my-2 md:my-0 block md:inline">or</span>
|
||||
<button id="show-setup-code" class="btn-md btn-blue">Show setup QR code</button>
|
||||
<button id="hide-setup-code" class="btn-md btn-blue hidden">Hide setup QR code</button>
|
||||
</p>
|
||||
<p id="setup-code" class="hidden my-10 w-full text-center">
|
||||
<%= raw @svg %>
|
||||
</p>
|
||||
</section>
|
||||
<section>
|
||||
<h3>Lightning Address</h3>
|
||||
<p>
|
||||
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>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h3>Recommended Apps</h3>
|
||||
<div class="w-full grid grid-cols-1 gap-y-4 md:grid-cols-12
|
||||
md:gap-y-6 md:gap-x-4 md:items-center">
|
||||
<h4 class="md:col-span-3">
|
||||
<a href="https://bluewallet.io" class="ks-text-link text-xl"
|
||||
title="Blue Wallet" target="_blank">
|
||||
<%= image_tag("/img/logos/bluewallet.svg", class: 'h-16') %>
|
||||
</a>
|
||||
</h4>
|
||||
<p class="md:col-span-4 mb-0 text-gray-500">
|
||||
Android / iOS / macOS
|
||||
</p>
|
||||
<p class="md:col-span-5 mb-0">
|
||||
When adding a wallet, choose "Import wallet" on the bottom of the screen,
|
||||
then scan the setup QR code.
|
||||
</p>
|
||||
<h4 class="md:col-span-3">
|
||||
<a href="https://getalby.com/" class="ks-text-link text-xl"
|
||||
title="Alby" target="_blank">
|
||||
<%= image_tag("/img/logos/alby.svg", class: 'h-16') %>
|
||||
</a>
|
||||
</h4>
|
||||
<p class="md:col-span-4 mb-0 text-gray-500">
|
||||
Firefox / Chrome (Opera, Brave, Chromium-based browsers)
|
||||
</p>
|
||||
<p class="md:col-span-5 mb-0">
|
||||
Choose "LNDHub (Bluewallet)" in the connect dialog and paste the setup
|
||||
URL in the "LNDHub Export URI" field.
|
||||
</p>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</main>
|
||||
<section>
|
||||
<h3>Wallet Apps</h3>
|
||||
<p>
|
||||
You can connect various wallet apps to your Kosmos account. This allows
|
||||
you to both receive and send sats. Any wallet that supports
|
||||
<a href="https://bluewallet.io/lndhub/" class="ks-text-link" target="_blank">LNDHub</a>
|
||||
accounts should be able to add/import your account using our setup
|
||||
code/URL:
|
||||
</p>
|
||||
<p class="my-6 text-center md:text-left">
|
||||
<button id="copy-setup-code" class="btn-md btn-blue">Copy setup code/URL</button>
|
||||
<span class="mx-2 my-2 md:my-0 block md:inline">or</span>
|
||||
<button id="show-setup-code" class="btn-md btn-blue">Show setup QR code</button>
|
||||
<button id="hide-setup-code" class="btn-md btn-blue hidden">Hide setup QR code</button>
|
||||
</p>
|
||||
<p id="setup-code" class="hidden my-10 w-full text-center">
|
||||
<%= raw @svg %>
|
||||
</p>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h3>Recommended Apps</h3>
|
||||
<div class="w-full grid grid-cols-1 gap-y-4 md:grid-cols-12
|
||||
md:gap-y-6 md:gap-x-4 md:items-center">
|
||||
<h4 class="md:col-span-3">
|
||||
<a href="https://bluewallet.io" class="ks-text-link text-xl"
|
||||
title="Blue Wallet" target="_blank">
|
||||
<%= image_tag("/img/logos/bluewallet.svg", class: 'h-16') %>
|
||||
</a>
|
||||
</h4>
|
||||
<p class="md:col-span-4 mb-0 text-gray-500">
|
||||
Android / iOS / macOS
|
||||
</p>
|
||||
<p class="md:col-span-5 mb-0">
|
||||
When adding a wallet, choose "Import wallet" on the bottom of the screen,
|
||||
then scan the setup QR code.
|
||||
</p>
|
||||
<h4 class="md:col-span-3">
|
||||
<a href="https://getalby.com/" class="ks-text-link text-xl"
|
||||
title="Alby" target="_blank">
|
||||
<%= image_tag("/img/logos/alby.svg", class: 'h-16') %>
|
||||
</a>
|
||||
</h4>
|
||||
<p class="md:col-span-4 mb-0 text-gray-500">
|
||||
Firefox / Chrome (Opera, Brave, Chromium-based browsers)
|
||||
</p>
|
||||
<p class="md:col-span-5 mb-0">
|
||||
Choose "LNDHub (Bluewallet)" in the connect dialog and paste the setup
|
||||
URL in the "LNDHub Export URI" field.
|
||||
</p>
|
||||
</div>
|
||||
</section>
|
||||
<% end %>
|
||||
|
||||
<script type="text/javascript">
|
||||
(function () {
|
||||
|
Loading…
x
Reference in New Issue
Block a user