rosa-build/app/views/layouts/menu/_top.html.haml

7 lines
416 B
Plaintext
Raw Normal View History

- namespace = which_menu == 'admins_menu' ? 'admin_' : ''
%ul
2012-03-19 17:32:02 +00:00
- (collection = t which_menu).each do |base, title|
- if can? :index, base.to_s.classify.constantize
%li= link_to title, send(:"#{namespace}#{base}_path"), :class => top_menu_class(base)
- if current_user.try(:admin?) and which_menu == 'top_menu'
%li= link_to t('admins_menu_header'), admin_users_path, :class => top_menu_class('admin')