Add admin layout with admin navigation
And remove the hacky link list from the dashboard.
This commit is contained in:
@@ -1,8 +1,3 @@
|
||||
<h2>Admin Panel</h2>
|
||||
<p>
|
||||
Ohai there, admin human.
|
||||
<p class="text-centered">
|
||||
With great power comes great responsibility.
|
||||
</p>
|
||||
<ul>
|
||||
<li><%= link_to 'LDAP users', admin_ldap_users_path %></li>
|
||||
<li><%= link_to 'Donations', admin_donations_path %></li>
|
||||
</ul>
|
||||
|
||||
45
app/views/layouts/admin.html.erb
Normal file
45
app/views/layouts/admin.html.erb
Normal file
@@ -0,0 +1,45 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Admin Panel | Kosmos Accounts</title>
|
||||
<%= csrf_meta_tags %>
|
||||
<%= csp_meta_tag %>
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
|
||||
<%= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' %>
|
||||
</head>
|
||||
|
||||
<body id="admin-panel">
|
||||
<div id="wrapper">
|
||||
<header>
|
||||
<h1>
|
||||
<span class ="project-name">Kosmos</span>
|
||||
<span class ="site-name">Akkounts</span>
|
||||
<span class="beta"><span class="bolt">⚡</span> beta</span>
|
||||
</h1>
|
||||
<% if user_signed_in? %>
|
||||
<p class="current-user">
|
||||
Signed in as <strong><%= current_user.cn %>@kosmos.org</strong>.
|
||||
<%= link_to "Log out", destroy_user_session_path, method: :delete %>
|
||||
</p>
|
||||
<% end %>
|
||||
</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>
|
||||
18
app/views/shared/_admin_nav.html.erb
Normal file
18
app/views/shared/_admin_nav.html.erb
Normal file
@@ -0,0 +1,18 @@
|
||||
<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 "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>
|
||||
@@ -3,15 +3,15 @@
|
||||
<ul class="pages">
|
||||
<li>
|
||||
<%= link_to "Services", root_path,
|
||||
class: @current_section == "dashboard" ? "active" : nil %>
|
||||
class: @current_section == :dashboard ? "active" : nil %>
|
||||
</li>
|
||||
<li>
|
||||
<%= link_to "Donations", donations_path,
|
||||
class: @current_section == "contributions" ? "active" : nil %>
|
||||
class: @current_section == :contributions ? "active" : nil %>
|
||||
</li>
|
||||
<li>
|
||||
<%= link_to "Invitations", invitations_path,
|
||||
class: @current_section == "invitations" ? "active" : nil %>
|
||||
class: @current_section == :invitations ? "active" : nil %>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user