Commit 22bba08e1b6d29a749cd8fb62f9b24d0411a7ddc

Authored by Rafael Reggiani Manzo
1 parent 6de27be9
Exists in colab and in 2 other branches master, stable

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>
app/views/layouts/application.html.erb
... ... @@ -52,10 +52,6 @@
52 52 <div class="col-sm-3 col-md-3">
53 53 <div class="well sidebar-nav">
54 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 55 <li class="nav-header"><%= t('tutorials') %></li>
60 56 <li class="list-group-item"><%= link_to t('analysis'), tutorials_path('analyzing') %></li>
61 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 19 </ul>
20 20 <ul class="nav navbar-nav navbar-right">
21 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 33 <% else %>
25 34 <li><%= link_to t('sign_in'), new_user_session_path %></li>
26 35 <li><%= link_to t('sign_up'), new_user_registration_path %></li>
... ...