{% extends "cosinnus/base.html" %}
{% load i18n bootstrap3 cosinnus_tags %}
{% load static from staticfiles %}

{% block page_title %}{% trans "User Dashboard" %}{{ block.super }}{% endblock page_title %}

{% block extrahead %}
  <link href="{% static "css/cosinnus.dashboard.css" %}" rel="stylesheet">
{% endblock extrahead %}

    <div>
        <a href="{% group_url 'cosinnus:group-detail' group=group %}">{{ group.name }} - Details</a>
    </div>

{% block main_page_header %}
{% endblock main_page_header %}
            

{% block main_page %}
    <div class="row">
        {% include 'cosinnus/messages.html' %}
        
        
        <div id="dashboard"> <!-- An extra wrapper div, not in the mockups, but required for the cosinnus dashboard data extension -->
            {% for widget in widgets %}
                {% cosinnus_render_widget widget %}
            {% endfor %}
        </div>
          
    </div><!-- row -->
{% endblock main_page %}


{% block extrafooter %}
  {{ block.super }}

  <script src="{% static "js/cosinnus.dashboard.js" %}"></script>
  <script type="text/javascript">
    $(document).ready(function(){
      var dashboard = window.Cosinnus.dashboard.init("#dashboard", {% if group.slug %}"{{ group.slug }}"{% else %}null{% endif %});
    });
  </script>
{% endblock %}