- models = RailsAdmin::Config.visible_models.select { |model| authorized?(:index, model.abstract_model) } - root_models = models.select { |model| model.parent == :root } %ul#nav.navigation %li{:class => ("active" if @page_type == "dashboard")} = link_to(t("admin.dashboard.name"), dashboard_path) - root_models.each do |model| - children = [model] + models.select { |m| m.parent.to_s == model.abstract_model.model.to_s } - tab_titles = children.map { |child| child.abstract_model.pretty_name.downcase } - active = tab_titles.include? @page_type %li{:class => "#{"active" if active} #{"more" unless children.empty?}"} - if children.size == 1 = link_to(model.label_plural, index_path(:model_name => model.abstract_model.to_param)) - else = model.navigation_label ? t(model.navigation_label, :default => model.navigation_label) : model.label_plural %ul - children.each_with_index do |child, index| %li{:class => ("active" if @page_type == tab_titles[index])} = link_to(child.label_plural, index_path(:model_name => child.abstract_model.to_param))