Skip to content

Commit

Permalink
Merge pull request #9 from josefzacek/add-header-navigation
Browse files Browse the repository at this point in the history
Add header navigation
  • Loading branch information
josefzacek authored Aug 4, 2016
2 parents 7cf9ea9 + d63b1a9 commit b012602
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
24 changes: 24 additions & 0 deletions app/views/layouts/_header_navigation.html.slim
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions app/views/layouts/application.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ html lang="en"

body

= render "layouts/header_navigation"

.container

p.notice #{notice}
Expand Down

0 comments on commit b012602

Please sign in to comment.