New admin page for invitations
This commit is contained in:
parent
4fbfaadb44
commit
dc7cf107c2
@ -10,6 +10,8 @@ body#admin-panel {
|
|||||||
|
|
||||||
#main-nav {
|
#main-nav {
|
||||||
ul {
|
ul {
|
||||||
|
grid-template-columns: repeat(4, 1fr);
|
||||||
|
|
||||||
li {
|
li {
|
||||||
a {
|
a {
|
||||||
&.active {
|
&.active {
|
||||||
|
6
app/controllers/admin/invitations_controller.rb
Normal file
6
app/controllers/admin/invitations_controller.rb
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
class Admin::InvitationsController < Admin::BaseController
|
||||||
|
def index
|
||||||
|
@current_section = :invitations
|
||||||
|
@invitations_used = Invitation.used.order('used_at desc')
|
||||||
|
end
|
||||||
|
end
|
25
app/views/admin/invitations/index.html.erb
Normal file
25
app/views/admin/invitations/index.html.erb
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
<section>
|
||||||
|
<h2>Invitations</h2>
|
||||||
|
|
||||||
|
<% if @invitations_used.any? %>
|
||||||
|
<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>
|
||||||
|
<% end %>
|
||||||
|
</section>
|
@ -5,6 +5,10 @@
|
|||||||
<%= link_to "Dashboard", admin_root_path,
|
<%= link_to "Dashboard", admin_root_path,
|
||||||
class: @current_section == :dashboard ? "active" : nil %>
|
class: @current_section == :dashboard ? "active" : nil %>
|
||||||
</li>
|
</li>
|
||||||
|
<li>
|
||||||
|
<%= link_to "Invitations", admin_invitations_path,
|
||||||
|
class: @current_section == :invitations ? "active" : nil %>
|
||||||
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<%= link_to "Donations", admin_donations_path,
|
<%= link_to "Donations", admin_donations_path,
|
||||||
class: @current_section == :donations ? "active" : nil %>
|
class: @current_section == :donations ? "active" : nil %>
|
||||||
|
@ -18,6 +18,7 @@ Rails.application.routes.draw do
|
|||||||
|
|
||||||
namespace :admin do
|
namespace :admin do
|
||||||
root to: 'dashboard#index'
|
root to: 'dashboard#index'
|
||||||
|
get 'invitations', to: 'invitations#index'
|
||||||
get 'ldap_users', to: 'ldap_users#index'
|
get 'ldap_users', to: 'ldap_users#index'
|
||||||
resources :donations
|
resources :donations
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user