Merge branch 'master' into 3296-user-profile
[arvados.git] / apps / workbench / app / views / layouts / body.html.erb
index 10482be45003ac5c5d488637379e42c585763c6e..1d081640cb2295a08234124e51463ceeacfaf9ec 100644 (file)
           </li>
 
           <% if current_user %>
-          <!-- XXX placeholder for this when search is implemented
           <li>
-            <form class="navbar-form" role="search">
+            <form class="navbar-form" role="search"
+                       data-search-modal=
+                       "<%= url_for(
+                        action: 'choose',
+                        controller: 'search',
+                        title: 'Search',
+                        action_name: 'Show',
+                        action_href: url_for(controller: :actions, action: :show),
+                        action_method: 'get',
+                        action_data: {selection_param: 'uuid', success: 'redirect-to-created-object', copy_from_search_box: true}.to_json)
+                       %>">
               <div class="input-group" style="width: 220px">
                 <input type="text" class="form-control" placeholder="search">
-                <span class="input-group-addon"><span class="glyphicon glyphicon-search"></span></span>
+                <a class="input-group-addon"><span class="glyphicon glyphicon-search"></span></a>
               </div>
             </form>
           </li>
-          -->
 
           <li class="dropdown notification-menu">
             <a href="#" class="dropdown-toggle" data-toggle="dropdown" id="notifications-menu">
               <%= current_user.email %>
             </a>
             <ul class="dropdown-menu" role="menu">
+              <li role="presentation" class="dropdown-header">
+                My account
+              </li>
               <% if current_user.is_active %>
-              <li role="presentation"><a href="/authorized_keys" role="menuitem"><i class="fa fa-key fa-fw"></i> Manage ssh keys</a></li>
-              <li role="presentation"><a href="/api_client_authorizations" role="menuitem"><i class="fa fa-ticket fa-fw"></i> Manage API tokens</a></li>
+              <li role="presentation"><a href="/manage_account" role="menuitem"><i class="fa fa-key fa-fw"></i> Manage account</a></li>
+              <% if Rails.configuration.user_profile_form_fields %>
+                <li role="presentation"><a href="/profile" role="menuitem"><i class="fa fa-key fa-fw"></i> Manage my profile</a></li>
+              <% end %>
               <li role="presentation" class="divider"></li>
               <% end %>
               <li role="presentation"><a href="<%= logout_path %>" role="menuitem"><i class="fa fa-sign-out fa-fw"></i> Log out</a></li>
                 <li role="presentation" class="dropdown-header">
                   Settings
                 </li>
-                <li role="presentation"><a href="/repositories">
-                    <i class="fa fa-lg fa-code-fork fa-fw"></i> Repositories
-                </a></li>
-                <li role="presentation"><a href="/virtual_machines">
-                    <i class="fa fa-lg fa-terminal fa-fw"></i> Virtual machines
-                </a></li>
+                <% if current_user.andand.is_admin %>
+                  <li role="presentation"><a href="/repositories">
+                      <i class="fa fa-lg fa-code-fork fa-fw"></i> Repositories
+                  </a></li>
+                  <li role="presentation"><a href="/virtual_machines">
+                      <i class="fa fa-lg fa-terminal fa-fw"></i> Virtual machines
+                  </a></li>
+                  <li role="presentation"><a href="/authorized_keys">
+                      <i class="fa fa-lg fa-key fa-fw"></i> SSH keys
+                  </a></li>
+                  <li role="presentation"><a href="/api_client_authorizations">
+                      <i class="fa fa-lg fa-ticket fa-fw"></i> API tokens
+                  </a></li>
+                <% end %>
                 <li role="presentation"><a href="/links">
                     <i class="fa fa-lg fa-arrows-h fa-fw"></i> Links
                 </a></li>
             <ul class="dropdown-menu" role="menu">
             <%= render partial: "projects_tree_menu", locals: {
                   :project_link_to => Proc.new do |pnode, &block|
-                    link_to(project_path(pnode[:object].uuid), data: {object_uuid: pnode[:object].uuid, name: 'name'}, &block)
+                    link_to(project_path(pnode[:object].uuid),
+                      data: { 'object-uuid' => pnode[:object].uuid,
+                              'name' => 'name' },
+                      &block)
                   end,
                   :top_button => Proc.new do %>
                     <% link_to projects_path, method: 'post', class: 'btn btn-xs btn-default pull-right' do %>