{% extends "base.html" %}
{% load djblets_deco %}
{% load i18n %}
{% load reviewtags %}
{% load staticfiles %}

{% block title %}{% trans "My Dashboard" %}{% endblock %}

{% block extrahead %}
<meta http-equiv="refresh" content="300" />
{% endblock %}

{% block css %}
{{block.super}}
<link rel="stylesheet" type="text/css" href="{% static "djblets/css/datagrid.css" %}" />
{% endblock %}

{% block scripts-post %}
<script type="text/javascript" src="{% static "djblets/js/datagrid.js" %}"></script>
{% endblock %}

{% block content %}
{% box "dashboard" %}
<div id="dashboard-wrapper">
 <table class="datagrid" id="dashboard-navbar">
  <colgroup>
   <col class="summary" />
   <col class="count" />
  </colgroup>
  <tbody>
{% dashboard_entry "main-item" "Starred Reviews"  "starred" %}
{% dashboard_entry "main-item" "Outgoing Reviews" "outgoing" %}
{% dashboard_entry "main-item" "Incoming Reviews" "incoming" %}
{% dashboard_entry "sub-item"  "To Me"            "to-me" %}
{% for name, value in datagrid.counts.groups.items %}
{%  dashboard_entry "sub-item" name "to-group" name %}
{% endfor %}
{% if datagrid.counts.starred_groups %}
{%  dashboard_entry "main-item" "Watched Groups" "watched-groups" %}
{%  for name, value in datagrid.counts.starred_groups.items %}
{%   dashboard_entry "sub-item" name "to-group" name %}
{%  endfor %}
{% endif %}
{% dashboard_entry "main-item" "All My Requests" "mine" %}
{% for hook in sidebar_hooks %}
{%  for main_entry in hook.entries %}
{%   dashboard_entry "main-item" main_entry.label "url" main_entry.url %}
{%   for sub_entry in main_entry.subitems %}
{%    dashboard_entry "sub-item" sub_entry.label "url" sub_entry.url %}
{%   endfor %}
{%  endfor %}
{% endfor %}
  </tbody>
 </table>
 <div id="dashboard-main" class="clearfix">
{{datagrid.render_listview}}
 </div>
</div>
{% endbox %}
{% endblock %}
