Merge pull request #1 from curoverse/master
[arvados.git] / apps / workbench / app / views / layouts / body.html.erb
index 5cfa2ca373c79f7708f63f77b65dc547adab5f42..fbbd0fac26e32793d50f095973933750a52cbdef 100644 (file)
@@ -7,7 +7,12 @@
           <span class="icon-bar"></span>
           <span class="icon-bar"></span>
         </button>
-        <a class="navbar-brand" href="/" data-push=true><%= Rails.configuration.site_name.downcase rescue Rails.application.class.parent_name %></a>
+        <% site_name = Rails.configuration.site_name.downcase rescue Rails.application.class.parent_name %>
+        <% if current_user %>
+          <a class="navbar-brand" href="/" data-push=true><%= site_name %></a>
+        <% else %>
+          <span class="navbar-brand"><%= site_name %></span>
+        <% end %>
       </div>
 
       <div class="collapse navbar-collapse">
@@ -41,7 +46,7 @@
 
             <li class="dropdown notification-menu">
               <a href="#" class="dropdown-toggle" data-toggle="dropdown" id="notifications-menu">
-                <span class="badge badge-alert notification-count"><%= @notification_count %></span>
+                <span class="badge badge-alert notification-count"><%= user_notifications.length if user_notifications.any? %></span>
                 <%= current_user.email %> <span class="caret"></span>
               </a>
               <ul class="dropdown-menu" role="menu">
                 <% end %>
                 <% end %>
                 <li role="menuitem"><a href="<%= logout_path %>" role="menuitem"><i class="fa fa-sign-out fa-fw"></i> Log out</a></li>
-                <% if current_user.is_active and
-                      (@notifications || []).length > 0 %>
+                <% if user_notifications.any? %>
                   <li role="presentation" class="divider"></li>
-                  <% @notifications.each_with_index do |n, i| %>
+                  <% user_notifications.each_with_index do |n, i| %>
                     <% if i > 0 %><li class="divider"></li><% end %>
                     <li class="notification"><%= n.call(self) %></li>
                   <% end %>
       </nav>
     <% end %>
 
+    <%= render partial: 'browser_unsupported' %><%# requires JS support below %>
+
     <div id="page-wrapper">
       <%= yield %>
     </div>
 
 <div class="modal-container"></div>
 <div id="report-issue-modal-window"></div>
+<script src="/browser_unsupported.js"></script>