{# -*- engine:django -*- #}

{% extends "core/base.html" %}

{% load i18n data_helpers rules %}
{% load render_table from django_tables2 %}

{% block browser_title %}{% blocktrans %}Dashboard widgets{% endblocktrans %}{% endblock %}
{% block page_title %}{% blocktrans %}Dashboard widgets{% endblocktrans %}{% endblock %}

{% block content %}

  {% for ct, model in widget_types %}
    <a class="btn green waves-effect waves-light" href="{% url 'create_dashboard_widget' ct.app_label ct.model  %}">
      <i class="material-icons left">add</i>
      {% verbose_name_object model as widget_name %}
      {% blocktrans with name=widget_name %}Create {{ name }}{% endblocktrans %}
    </a>
  {% endfor %}

  {% has_perm "core.edit_default_dashboard" user as can_edit_default_dashboard %}
  {% if can_edit_default_dashboard %}
    <a class="btn orange waves-effect waves-light" href="{% url "edit_default_dashboard" %}">
      <i class="material-icons left">edit</i>
      {% trans "Edit default dashboard" %}
    </a>
  {% endif %}

  {% render_table table %}
{% endblock %}
