Feature: Introduce Super Admins (#705)
* Feature: Introduce Super Admins - added new devise model for super user - added administrate gem - sample dashboards for users and accounts Co-authored-by: Pranav Raj Sreepuram <pranavrajs@gmail.com>
This commit is contained in:
27
app/views/super_admin/application/_navigation.html.erb
Normal file
27
app/views/super_admin/application/_navigation.html.erb
Normal file
@@ -0,0 +1,27 @@
|
||||
<%#
|
||||
# Navigation
|
||||
|
||||
This partial is used to display the navigation in Administrate.
|
||||
By default, the navigation contains navigation links
|
||||
for all resources in the admin dashboard,
|
||||
as defined by the routes in the `admin/` namespace
|
||||
%>
|
||||
|
||||
<%= javascript_pack_tag 'superadmin_pages' %>
|
||||
<%= stylesheet_pack_tag 'superadmin_pages' %>
|
||||
|
||||
|
||||
<nav class="navigation" role="navigation">
|
||||
<%= link_to "Back to app", root_url, class: "button button--alt" %>
|
||||
<%= link_to "Logout", super_admin_logout_url , class: "button button--alt" %>
|
||||
|
||||
<% Administrate::Namespace.new(namespace).resources.each do |resource| %>
|
||||
<%= link_to(
|
||||
display_resource_name(resource),
|
||||
[namespace, resource_index_route_key(resource)],
|
||||
class: "navigation__link navigation__link--#{nav_link_state(resource)}"
|
||||
) if valid_action? :index, resource %>
|
||||
<% end %>
|
||||
|
||||
<%= link_to "Sidekiq", sidekiq_web_url , class: "button" %>
|
||||
</nav>
|
||||
43
app/views/super_admin/devise/sessions/new.html.erb
Normal file
43
app/views/super_admin/devise/sessions/new.html.erb
Normal file
@@ -0,0 +1,43 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>SuperAdmin | Chatwoot</title>
|
||||
<%= javascript_pack_tag 'superadmin' %>
|
||||
<%= stylesheet_pack_tag 'superadmin' %>
|
||||
</head>
|
||||
<body data-gr-c-s-loaded="true">
|
||||
<div id="app" class="superadmin-body app-wrapper app-root">
|
||||
<div class="medium column login">
|
||||
<div class="text-center medium-12 login__hero align-self-top">
|
||||
<h2 class="hero__title">
|
||||
Howdy, admin 👋
|
||||
</h2>
|
||||
</div>
|
||||
<div class="row align-center">
|
||||
<div class="small-12 medium-4 column">
|
||||
<%= form_for(resource, as: resource_name, url: '/super_admin/sign_in', html: { class: 'login-box column align-self-top'}) do |f| %>
|
||||
<div class="column log-in-form">
|
||||
<label>
|
||||
Email
|
||||
<%= f.email_field :email, autofocus: true, autocomplete: "email", placeholder: "Email eg: someone@example.com" %>
|
||||
</label>
|
||||
<label>
|
||||
Password
|
||||
<%= f.password_field :password, autocomplete: "current-password", placeholder: "Password" %>
|
||||
</label>
|
||||
<p>
|
||||
<%= f.check_box :remember_me %> Remember me
|
||||
</p>
|
||||
<button type="submit" class="button nice large expanded">
|
||||
Login
|
||||
</button>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="column text-center sigin__footer">
|
||||
© Chatwoot
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user