Sha256: 1d8193a506358819defb0e447861baa0fc2138f38bd327bf054d03fc7c738388
Contents?: true
Size: 1.11 KB
Versions: 1
Compression:
Stored size: 1.11 KB
Contents
- 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))
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
elucid-rails_admin-0.0.1 | app/views/layouts/rails_admin/_navigation.html.haml |