Commit 22bba08e1b6d29a749cd8fb62f9b24d0411a7ddc
1 parent
6de27be9
Exists in
colab
and in
2 other branches
Move user links to header dropdown
This will make possible to remove the left side box which now has no purpose. Signed-off-by: Heitor Reis <marcheing@gmail.com>
Showing
2 changed files
with
11 additions
and
6 deletions
Show diff stats
app/views/layouts/application.html.erb
| @@ -52,10 +52,6 @@ | @@ -52,10 +52,6 @@ | ||
| 52 | <div class="col-sm-3 col-md-3"> | 52 | <div class="col-sm-3 col-md-3"> |
| 53 | <div class="well sidebar-nav"> | 53 | <div class="well sidebar-nav"> |
| 54 | <ul class="list-group"> | 54 | <ul class="list-group"> |
| 55 | - <% if user_signed_in? %> | ||
| 56 | - <li class="nav-header"><%= t('hello_html', user: current_user.name) %></li> | ||
| 57 | - <li class="list-group-item"><%= link_to t('your_projects'), user_projects_path(current_user.id) %></li> | ||
| 58 | - <% end %> | ||
| 59 | <li class="nav-header"><%= t('tutorials') %></li> | 55 | <li class="nav-header"><%= t('tutorials') %></li> |
| 60 | <li class="list-group-item"><%= link_to t('analysis'), tutorials_path('analyzing') %></li> | 56 | <li class="list-group-item"><%= link_to t('analysis'), tutorials_path('analyzing') %></li> |
| 61 | <li class="list-group-item"><%= link_to t('configuring'), tutorials_path('configuring') %></li> | 57 | <li class="list-group-item"><%= link_to t('configuring'), tutorials_path('configuring') %></li> |
app/views/shared/_navbar.html.erb
| @@ -19,8 +19,17 @@ | @@ -19,8 +19,17 @@ | ||
| 19 | </ul> | 19 | </ul> |
| 20 | <ul class="nav navbar-nav navbar-right"> | 20 | <ul class="nav navbar-nav navbar-right"> |
| 21 | <% if user_signed_in? %> | 21 | <% if user_signed_in? %> |
| 22 | - <li><%= link_to t('edit_account'), edit_user_registration_path %></li> | ||
| 23 | - <li><%= link_to t('sign_out'), destroy_user_session_path, :method => :delete %></li> | 22 | + <li class="dropdown"> |
| 23 | + <a class="dropdown-toggle" aria-expanded="true" role="button" data-toggle="dropdown" href="#"> | ||
| 24 | + <%= t('hello_html', user: current_user.name) %> | ||
| 25 | + <span class="caret"></span> | ||
| 26 | + </a> | ||
| 27 | + <ul class="dropdown-menu" role="menu"> | ||
| 28 | + <li><%= link_to t('your_projects'), user_projects_path(current_user.id) %></li> | ||
| 29 | + <li><%= link_to t('edit_account'), edit_user_registration_path %></li> | ||
| 30 | + <li><%= link_to t('sign_out'), destroy_user_session_path, :method => :delete %></li> | ||
| 31 | + </ul> | ||
| 32 | + </li> | ||
| 24 | <% else %> | 33 | <% else %> |
| 25 | <li><%= link_to t('sign_in'), new_user_session_path %></li> | 34 | <li><%= link_to t('sign_in'), new_user_session_path %></li> |
| 26 | <li><%= link_to t('sign_up'), new_user_registration_path %></li> | 35 | <li><%= link_to t('sign_up'), new_user_registration_path %></li> |