{% extends "language_base.html" %}
{% load i18n baseurl cleanhtml assets common_tags search %}

{% get_current_language as LANGUAGE_CODE %}

{% block body_id %}languageoverview{% endblock %}

{% block search %}{% render_search %}{% endblock %}

{% block content %}
<div class="module first">
  <div class="hd">
    <h2>{{ language.summary }}</h2>
  </div>

  <div class="bd">
    {% display_table table %}
    {% include "translation_summary_legend.html" %}
  </div>

</div>

<div class="module">
  {% if language.description or can_edit %}
  <div class="hd">
    <h2>{% trans "Description" %}</h2>
  </div>

  <div id="overview-description" class="bd">

    <div id="overview-description-language"
      class="markup-body{% if can_edit %} js-ctx-meta-desc{% endif %}">
    {% if language.description %}
      {{ language.description }}
    {% else %}
      <p class="placeholder muted">{% trans "No description set." %}</p>
    {% endif %}
    {% if can_edit %}
      {% include "admin/edit_links.html" %}
    {% endif %}
    </div>
  {% if can_edit %}
    <div class="settings-container js-edit-ctx-meta-desc" style="display:none;">
      {% include "admin/general_settings_form.html" with form_action="edit_settings.html" %}
    </div>
  {% endif %}

  </div>
  {% endif %}
</div>
{% endblock content %}

{% block postcontent %}
{% include "top_contributers_table.html" %}
{% endblock postcontent %}

{% block scripts_extra %}
<script type="text/javascript">
$(function() {
  PTL.search.init();

  $("td.stats-name").filter(":not([dir])").bidi();
});
</script>
{% if user.is_superuser or request.permissions.administrate %}
{% assets "js_admin" %}
<script type="text/javascript" src="{{ ASSET_URL }}"></script>
{% endassets %}
{% endif %}
{% endblock %}
