{% extends "projects/base.html" %}
{% load i18n %}
{% load txcommontags %}

{% block extra_head %}
<link media="screen" href="{{ MEDIA_URL }}css/tablesorter.css" type="text/css" rel="stylesheet" />
<link media="screen" href="{{ MEDIA_URL }}css/webtrans.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="{{ MEDIA_URL }}js/tablesorted.js"></script>
<script type="text/javascript" src="{{ MEDIA_URL }}js/table_pagination.js"></script>
<script type="text/javascript" src="{{ MEDIA_URL }}js/web_editor.js"></script>

<!-- Google suggest -->
<script src="http://www.google.com/jsapi" type="text/javascript"></script>    
<script type="text/javascript">
//<!--
{% if WEBTRANS_SUGGESTIONS %}
  google.load("language", "1");
  {% include 'webtrans/js/google-translate.js' %}
{% endif %}
//-->
</script>
{% endblock %}

{% block title %}
{% with pofile.object as component %}
{{ block.super }}
| {{ component.project.name }}
| {% blocktrans with component.name as component_name %}{{ component_name }}{% endblocktrans %}
| {% blocktrans with pofile.filename as filename %}Translate '{{ filename }}'{% endblocktrans %}
{% endwith %}
{% endblock %}

{% block breadcrumb %}
{% with pofile.object as component %}
{{ block.super }}
&raquo; <a href="{{ component.project.get_absolute_url }}">{{ component.project.name }}</a>
&raquo; <a href="{{ component.get_absolute_url }}">{{ component.name }}</a>
&raquo; {% blocktrans with pofile.filename as filename %}Translate '<code>{{ filename }}</code>'{% endblocktrans %}
{% endwith %}
{% endblock %}

{% block content_title %}
<h2 class="pagetitle">{% blocktrans with component.name as component_name and pofile.filename as filename %}Translate '<code>{{ filename }}</code>'{% endblocktrans %}</h2>
{% endblock %}

{% block content %}

{% if pofile.total %}
  <h3>Current status</h3>

<fieldset class="floatright">
  <legend>Settings</legend>
  <table class="definition">
  <tr>
    <th>Show occurences:</th>
    <td><input id="toggle_occurences" type="checkbox" checked="checked" name="toggle_occurences" /></td>
  </tr>
  </table>
</fieldset>

  <table class="definition stats_totals">
  <tr>
    <th class="translated">Translated</th>
      <td id="total_translated">{{ pofile.trans }}</td>
      <td id="total_translated_perc">{{ pofile.trans_perc }}%</td>
      <td><input id="only_translated" type="checkbox" checked="checked" name="only_translated"/></td>
  </tr>
  <tr>
    <th class="fuzzy">Fuzzy</th>
      <td id="total_fuzzy">{{ pofile.fuzzy }}</td>
      <td id="total_fuzzy_perc">{{ pofile.fuzzy_perc }}%</td>
      <td><input id="only_fuzzy" type="checkbox" checked="checked" name="only_fuzzy"/></td>
  </tr>
  <tr>
    <th class="untranslated">Untranslated</th>
      <td id="total_untranslated">{{ pofile.untrans }}</td>
      <td id="total_untranslated_perc">{{ pofile.untrans_perc }}%</td>
      <td><input id="only_untranslated" type="checkbox" checked="checked" name="only_untranslated"/></td>
  </tr>
  <tr class="last">
    <th>Total</th>
      <td id="total_sum">{{ pofile.total }}</td>
  </tr>
  </table>
{% endif %}

  <h3>Live translation</h3>

  {% if form_message %}
    <p class="message i16 bell">{{ form_message }}</p>
  {% endif %}
  <form action='' method='post'>
  <table id="trans_web_edit" class="trans_web_edit stats_comp tablesorter">
   <thead>
    <tr>
      <th>{% trans "#" %}</th>
      <th>{% trans "Source String" %}</th>
      <th>{% trans "Translation" %}</th>
{% if WEBTRANS_SUGGESTIONS %}      <th class="suggest_container"><abbr title="{% trans "Auto-translate" %}">{% trans "AT" %}</abbr></th>{% endif %}
      <th class="occurences">{% trans "Occurrences" %}</th>
      <th>{% trans "Fuzzy?" %}</th>
    </tr>
   </thead>
   <tbody>
    {% with pofile_form as form %} 
    {% include "webtrans/transfile_form.html" %}
    {% endwith %}
   </tbody>
  </table>
  <p class="submit"><input type="submit" class="i16 submit" value="{% trans "Submit translations" %}" /></p>
  </form>
{% endblock %}
