Newer
Older
dmpopidor / app / views / admin / application / _sidebar.html.erb
@Jimmy Angelakos Jimmy Angelakos on 3 Mar 2017 749 bytes Installed Administrate as Super Admin backend
<%# Hack for customisation %>
<%= render 'admin_header' %>

<%#
# Sidebar

This partial is used to display the sidebar in Administrate.
By default, the sidebar contains navigation links
for all resources in the admin dashboard,
as defined by the routes in the `admin/` namespace
%>

<ul class="sidebar__list">
  <% Administrate::Namespace.new(namespace).resources.each do |resource| %>
    <%# Hack to hide unnecessary models from sidebar %>
    <% if [:users,:orgs,:perms,:templates,].include? resource %> 
      <li>
        <%= link_to(
          display_resource_name(resource),
          [namespace, resource],
          class: "sidebar__link sidebar__link--#{nav_link_state(resource)}"
        ) %>
      </li>
    <% end %>
  <% end %>
</ul>