diff --git a/app/views/layouts/_header_navigation.html.slim b/app/views/layouts/_header_navigation.html.slim new file mode 100644 index 0000000..2c756b4 --- /dev/null +++ b/app/views/layouts/_header_navigation.html.slim @@ -0,0 +1,24 @@ +nav.navbar.navbar-default + .container-fluid + .navbar-header + button.navbar-toggle.collapsed type='button' data-toggle='collapse' data-target='#navbar' aria-expanded='false' aria-controls='navbar' + span.sr-only Toggle navigation + span.icon-bar + span.icon-bar + span.icon-bar + = link_to 'Rails 5 Group Chat', root_path, class: 'navbar-brand' + + #navbar.collapse.navbar-collapse + ul.nav.navbar-nav.navbar-right + - if user_signed_in? + li.dropdown + = link_to '/', class: 'dropdown-toggle', :'data-toggle' => 'dropdown', :'role' => 'button', :'aria-haspopup' => 'true', :'aria-expanded' => 'false' do + = current_user.username + span.caret + ul.dropdown-menu + li = link_to 'Settings', edit_user_registration_path + li.divider role='separator' + li = link_to 'Logout', destroy_user_session_path, method: :delete + - else + li = link_to 'Sign Up', new_user_registration_path + li = link_to 'Login', new_user_session_path diff --git a/app/views/layouts/application.html.slim b/app/views/layouts/application.html.slim index 4ccabc7..3056a8c 100644 --- a/app/views/layouts/application.html.slim +++ b/app/views/layouts/application.html.slim @@ -13,6 +13,8 @@ html lang="en" body + = render "layouts/header_navigation" + .container p.notice #{notice}