<% cache [current_user, notifications, project_id] do %>
   <% if notifications.any? %>
  <div class="notification-header">
    Notifications
    (<span data-behavior='unread-count'><%= unread_count %></span>)
    <div class="pull-right">
      <%= link_to 'Mark all as read',
                  notification_path(id: 'all'),
                  method: :put,
                  remote: true
                  %>
    </div>
  </div>
  <% end %>
  <ul class="notification-container" >
    <% if notifications.any? %>
      <%= render notifications %>
    <% else %>
      <li class="text-center">You don't have any notifications yet.</li>
    <% end %>
  </ul>
  <% if notifications.any? %>
    <div class="footer text-center">
      <%= link_to 'See all notifications', project_id ? project_notifications_path(project_id) : notifications_path %>
    </div>
  <% end %>
<% end %>
