{# vim: set ts=2 et sts=2 sw=2: #}
{% extends "base.html" %}
{% from "dashboards/includes/macros.html" import print_readout %}
{% set title = _('Localization Dashboard') %}
{% set scripts = ('wiki',) %}
{% set styles = ('wiki',) %}
{% set crumbs = [(None, title)] %}
{# TODO: Move required dashboard styles/scripts out of wiki.css into their own or refactor up? #}

{% block content %}
  <article id="localize" class="main dashboards">
    <h1>{{ title }}</h1>

    <div class="choice-list">
      <label>{{ _('Show information for:') }}</label>
      <ul>
        <li>
          <a href="{{ url('dashboards.contributors') }}">{{ default_locale_name }}</a>
        </li>
        <li>
          {{ current_locale_name }}
        </li>
      </ul>
    </div>

    <details class="h2" open="open">
      <summary>{{ _('Overview') }}</summary>
      <table class="overview">
        {% for row in overview_rows() %}
          <tr>
            <td>
              {% if row.url %}
                <a href="{{ row.url }}">{{ row.title }}</a>
              {% else %}
                {{ row.title }}
              {% endif %}
            </td>
            <td>
              {{ number(row.numerator) }}
              <div class="denominator">of {{ number(row.denominator) }}</div>
            </td>
            <td>
              {{ row.percent }}%
              <div class="percent-graph">
                <div style="width: {{ row.percent }}%"></div>
              </div>
            </td>
            <td>
              {{ row.description }}
            </td>
          </tr>
        {% endfor %}
        <tr>
          <td>{{ _('User Interface') }}</td>
          <td></td>
          <td></td>
          <td>
            {% trans url='https://localize.mozilla.org/' %}
              A fully translated user interface improves the experience for
              site visitors in your language. Help
              <a href="{{ url }}">translate the interface</a>.
            {% endtrans %}
          </td>
        </tr>
      </table>
      <div id="overview-options" class="choice-list">
        <label>{{ _('More options:') }}</label>
        <ul>
          {% for slug, readout in readouts.iteritems() %}
            <li><a href="#{{ slug }}">{{ readout.short_title }}</a></li>
          {% endfor %}
        </ul>
      </div>
    </details>

    {% for readout in readouts.itervalues() %}
      {{ print_readout(readout, 'dashboards.localization_detail') }}
    {% endfor %}
  </article>
{% endblock %}

{% block side %}
  <div id="doc-watch">
    {% with locale=request.locale %}
      {% include 'dashboards/includes/watch_locale.html' %}
      {% include 'dashboards/includes/watch_approved.html' %}
    {% endwith %}
    {% if request.locale != settings.WIKI_DEFAULT_LANGUAGE %}
      {% with locale=settings.WIKI_DEFAULT_LANGUAGE, is_watching_approved=is_watching_approved_default %}
        {% include 'dashboards/includes/watch_approved.html' %}
      {% endwith %}
    {% endif %}
  </div>
{% endblock %}
