2012-05-02 10:18:07 +01:00
|
|
|
- namespace = which_menu == 'admins_menu' ? 'admin_' : ''
|
2012-02-08 14:01:00 +00:00
|
|
|
%ul
|
2012-03-19 17:32:02 +00:00
|
|
|
- (collection = t which_menu).each do |base, title|
|
2012-02-08 14:01:00 +00:00
|
|
|
- if can? :index, base.to_s.classify.constantize
|
2014-01-21 04:51:49 +00:00
|
|
|
%li= link_to title, send(:"#{namespace}#{base}_path"), class: top_menu_class(base)
|
2012-03-31 00:37:54 +01:00
|
|
|
- if current_user.try(:admin?) and which_menu == 'top_menu'
|
2014-04-11 21:29:43 +01:00
|
|
|
%li= link_to t('admins_menu_header'), admin_root_path, class: top_menu_class('admin')
|