forked from hulihanapplications/Opal
/
_menu.html.erb
executable file
·26 lines (26 loc) · 2.11 KB
/
_menu.html.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<% content_for :side do %>
<%= content_tag :div, :class => "admin menu", :id => "admin-menu" do %>
<ul class="menu">
<%= content_tag(:li, :class => :selected) do %>
<%= link_to(icon("admin") + " " + t("single.overview").capitalize, {:action => "index", :controller => "admin"}, :class => params[:controller] == "admin" ? :selected : nil) %>
<%= content_tag(:li, :class => %w{items categories plugins plugin_features tools}.include?(params[:controller]) ? :selected : nil) do %>
<%= link_to(icon("items") + " " + Item.model_name.human(:count => :other), {:action => "all_items", :controller => "items"}, :class => params[:action] == "all_items" ? :selected : nil ) %>
<%#= render :partial => "items/all_items_menu" %>
<%= render :partial => "items/menu" %>
<% end %>
<%= content_tag(:li, :class => (params[:controller] == "pages") ? :selected : nil) do %>
<%= link_to(icon("pages") + " " + Page.model_name.human(:count => :other), {:action => "index", :controller => "pages"}, :class => current_page?(pages_path) && params[:type].blank? ? :selected : nil) %>
<%= render :partial => "pages/menu" %>
<% end %>
<%= content_tag(:li, :class => params[:controller] == "users" || params[:controller] == "groups" || params[:controller] == "messages" || params[:controller] == "logs" ? :selected : nil) do %>
<%= link_to(icon("users") + " " + User.model_name.human(:count => :other), {:action => "index", :controller => "users"}, :class => current_page?(users_path) ? :selected : nil) %>
<%= render :partial => "users/menu" %>
<% end %>
<%= content_tag(:li, :class => params[:controller] == "settings" ? :selected : nil) do %>
<%= link_to(icon("settings") + " " + t("section.title.configure").capitalize, {:action => "index", :controller => "settings"}, :class => params[:controller] == "settings" && params[:action] == "index" ? :selected : nil) %>
<%= render :partial => "settings/menu" %>
<% end %>
<% end %>
</ul>
<% end %>
<% end if current_user.is_admin? %>