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

{% load i18n assets store_tags %}

{% block css %}
{{ block.super }}
{% assets "css_reports" %}
<link rel="stylesheet" type="text/css" href="{{ ASSET_URL }}" />
{% endassets %}
{% endblock css %}

{% block scripts_extra %}
{{ block.super }}
{% assets "js_reports" %}
<script type="text/javascript" src="{{ ASSET_URL }}"></script>
{% endassets %}

<script id="language_user_activity" type="text/template">
{% include_raw "admin/xhr_language_user_activity.html" %}
</script>
<script id="summary" type="text/template">
{% include_raw "admin/xhr_summary_report.html" %}
</script>
<script id="paid-tasks" type="text/template">
{% include_raw "admin/xhr_paid_tasks_report.html" %}
</script>

<script type="text/javascript">
  $(function () {
    PTL.reports.init({
      users: {{ users|safe }},
      updateUserRatesUrl: "{% url 'pootle-reports-update-user-rates' %}",
      addPaidTaskUrl: "{% url 'pootle-reports-add-paid-task' %}",
      removePaidTaskUrl: "{% url 'pootle-reports-remove-paid-task' %}",
      serverTime: "{{ now }}",
      detailedUrl: "{% url 'pootle-reports-detailed' %}",
      adminReport: true,
      freeUserReport: false,
    });
  });
</script>

{% endblock scripts_extra %}

{% block title %}{% trans "Reports" %} | {{ block.super }}{% endblock %}

{% block breadcrumbs %}
{{ block.super }}<li>{% trans "Reports" %}</li>
<li id="js-breadcrumb-user" class="hide"></li>
{% endblock %}


{% block content %}
  <div id="reports-container">
    {% include "admin/reports/header.html" %}
    <div id="reports-results"></div>
    <div id="reports-activity">
      <h2>{% trans 'Daily activity' %}</h2>
      <div id="daily-chart"></div>
    </div>
    <div id="forms">
      {% include "admin/reports/user_rates_form.html" %}
      {% include "admin/reports/paid_task_form.html" %}
    </div>
    <div id="reports-paid-tasks"></div>
    <div id="reports-summary"></div>
  </div>
{% endblock %}
