config/chaltron_navigation.rb in chaltron-0.3.2 vs config/chaltron_navigation.rb in chaltron-1.0.0

- old
+ new

@@ -1,33 +1,25 @@ SimpleNavigation::Configuration.run do |navigation| navigation.items do |primary| - navigation.renderer = SimpleNavigationBootstrap::Bootstrap3 - primary.dom_class = 'pull-right' + primary.dom_class = 'justify-content-end' + navigation.selected_class = 'active' if signed_in? - primary.item :admin, - { icon: 'fa fa-fw fa-cogs', - text: I18n.t('chaltron.menu.admin') - }, nil do |admin| - admin.item :users, - { icon: 'fa fa-fw fa-users', - text: I18n.t('chaltron.menu.users') - }, users_path, highlights_on: /\/(users|ldap)(?!\/self_(show|edit|update))/ if can?(:read, User) - admin.item :logs, - { icon: 'fa fa-fw fa-book', - text: I18n.t('chaltron.menu.logs') - }, logs_path, highlights_on: /\/logs/ if can?(:read, Log) - end if can?(:read, User) or can?(:read, Log) - primary.item :logged, current_user.display_name.html_safe, nil do |user| + primary.item :admin, I18n.t('chaltron.menu.admin'), '#', link_html: { icon: 'cogs' } do |admin| + admin.item :users, I18n.t('chaltron.menu.users'), users_path, link_html: { icon: 'users' }, + highlights_on: /\/(users|ldap)(?!\/self_(show|edit|update))/ if can?(:manage, User) + admin.item :logs, I18n.t('chaltron.menu.logs'), logs_path, link_html: { icon: 'book' }, + highlights_on: /\/logs/ if can?(:read, Log) + end if can?(:manage, User) or can?(:read, Log) + primary.item :logged, current_user.display_name.html_safe, '#' do |user| user.dom_class = 'dropdown-menu-right' - user.item :self_edit, { icon: 'fa fa-fw fa-user', - text: I18n.t('chaltron.menu.self_show') }, self_show_users_path, - highlights_on: /\/self_(show|edit|update)/ - - user.item :logout, { icon: 'fa fa-fw fa-sign-out', text: 'Logout' }, - destroy_user_session_path, method: :delete + user.item :self_edit, I18n.t('chaltron.menu.self_show'), self_show_users_path, + link_html: { icon: 'user'}, + highlights_on: /\/self_(show|edit|update)/ + user.item :logout, 'Logout', destroy_user_session_path, method: :delete, + link_html: { icon: 'sign-out' } end else - primary.item :login, { icon: 'fa fa-fw fa-sign-in', text: 'Login' }, new_user_session_path + primary.item :login, 'Login', new_user_session_path, link_html: { icon: 'sign-in' } end end end