{% extends "base.html" %}
{% load i18n %}
{% load static %}
{% load translations %}
{% load crispy_forms_tags %}
{% load permissions %}

{% block extra_meta %}
<link rel="canonical" href="{{ unit.get_absolute_url }}" />
{% endblock %}

{% block breadcrumbs %}
<li><a href="{{ unit.translation.component.project.get_absolute_url }}">{{ unit.translation.component.project }}</a></li>
<li><a href="{{ unit.translation.component.get_absolute_url }}">{{ unit.translation.component.name }}</a>
{% indicate_alerts object %}
</li>
<li><a href="{{ unit.translation.get_absolute_url }}">{{ unit.translation.language }}</a></li>
<li><a href="{{ unit.translation.get_translate_url }}">{% trans "translate" %}</a></li>
{% endblock %}

{% block content %}

{% perm 'unit.edit' unit as user_can_translate %}
{% perm 'suggestion.add' unit.translation as user_can_suggest %}
{% perm 'suggestion.accept' unit as user_can_accept_suggestion %}
{% perm 'suggestion.vote' unit.translation as user_can_vote_suggestion %}
{% perm 'machinery.view' unit.translation as user_can_use_mt %}
{% perm 'source.edit' unit.translation as user_can_edit_source %}
{% perm 'screenshot.add' project as user_can_add_screenshot %}
{% perm 'comment.add' project as user_can_add_comment %}
{% perm 'glossary.add' project as user_can_add_dictionary %}

<div class="btn-group pull-right flip" role="group">
{% if user_can_translate %}
<a href="{% url 'zen' project=unit.translation.component.project.slug component=unit.translation.component.slug lang=unit.translation.language.code %}?{{ search_url }}" data-params="{{ search_url }}" title="{% trans "Edit in Zen mode" %}" class="btn btn-primary"><i class="fa fa-arrows-alt"></i> {% trans "Zen" %}</a>
{% endif %}

<a href="{% url 'profile' %}#preferences" class="btn btn-primary" title="{% trans "Configure editor" %}"><i class="fa fa-sliders"></i></a>
</div>

{% include "show-component-state.html" with object=unit.translation.component %}

{% with unit.get_comments as comments and unit.nearby as nearby %}

<div class="btn-group">
<ul class="pagination unit-navi">
<li><a id="button-first" href="{{ first_unit_url }}" title="{% trans "First" %}"><i class="fa {% if LANGUAGE_BIDI %}fa-step-forward{% else %}fa-step-backward{% endif %}"></i></a></li>
<li><a id="button-prev" href="{{ prev_unit_url }}" title="{% trans "Previous" %}"><i class="fa {% if LANGUAGE_BIDI %}fa-forward{% else %}fa-backward{% endif %}"></i></a></li>
<li>
<a class="dropdown-toggle" data-toggle="dropdown" href="#" title="{% trans "Edit search parameters" %}" id="search-dropdown">
<i class="fa fa-search" aria-hidden="true"></i>
{{ filter_name }}
<span class="caret"></span>
</a>
  <div class="dropdown-menu">

<div class="panel-group">
<form action="{{ unit.translation.get_translate_url }}" method="GET">
{{ search_form|crispy }}
<input type="submit" value="{% trans "Search" %}" class="btn btn-primary" />
</form>
</div>

</div>
</li>
<li>
<a class="dropdown-toggle" data-toggle="dropdown" href="#" title="{% trans "Go to position" %}" id="goto-dropdown">
{% blocktrans %}{{ filter_pos }} / {{ filter_count }}{% endblocktrans %}
<span class="caret"></span>
</a>
  <div class="dropdown-menu">

<div class="panel-group">

<form action="{{ unit.translation.get_translate_url }}" method="GET">
{% for key, value in search_items %}
<input type="hidden" name="{{ key }}" value="{{ value }}" />
{% endfor %}
<div class="form-group">
<label class="control-label" for="id-goto-number">{% trans "Jump to position" %}</label>
<div class="controls">
<input type="number" min="1" max="{{ filter_count }}" value="{{ filter_pos }}" name="offset" id="id-goto-number">
</div>
</div>
<input type="submit" value="{% trans "Jump" %}" class="btn btn-primary" />
</form>
</div>

</div>
</li>
<li><a id="button-next" href="{{ next_unit_url }}" title="{% trans "Next" %}"><i class="fa {% if LANGUAGE_BIDI %}fa-backward{% else %}fa-forward{% endif %}"></i></a></li>
<li><a id="button-end" href="{{ last_unit_url }}" title="{% trans "Last" %}"><i class="fa {% if LANGUAGE_BIDI %}fa-step-backward{% else %}fa-step-forward{% endif %}"></i></a></li>
</ul>
</div>


<div class="container-fluid">
<div class="row">
<div class="col-sm-9">

<form action="{{ this_unit_url }}" method="post" class="translation-form translator">
<div class="panel {% if unit.approved %}panel-success{% elif unit.translation.is_template %}panel-warning{% else %}panel-primary{% endif %}">

  <div class="panel-heading"><span class="pull-right flip">
  <i class="fa fa-link text-tooltip" data-toggle="tooltip" data-placement="bottom" data-clipboard-text="{{ site_url }}{{ unit.get_absolute_url }}" title="{% trans "Copy permalink" %}"></i>
  &nbsp;
  <i class="fa fa-keyboard-o html-tooltip" data-toggle="tooltip" data-placement="bottom">
  <div class="tooltip-content hidden">
    <table><thead><tr><th colspan='2'>{% trans "Keyboard shortcuts available:" %}</th></tr></thead>
    <tbody>
    <tr><td>Ctrl+Enter</td><td>{% trans "Save" %}</td></tr>
    <tr><td>Ctrl+Shift+Enter</td><td>{% trans "Unmark review needed flag and save" %}</td></tr>
    <tr><td>Alt+PageUp/PageDown/Home/End</td><td>{% trans "Strings navigation" %}</td></tr>
    <tr><td>Ctrl+E</td><td>{% trans "Focus translation editor" %}</td></tr>
    <tr><td>Ctrl+Q</td><td>{% trans "Focus comment editor" %}</td></tr>
    <tr><td>Ctrl+M</td><td>{% trans "Shows machine translation tab" %}</td></tr>
    <tr><td>Ctrl+J</td><td>{% trans "Shows nearby strings tab" %}</td></tr>
    <tr><td>Ctrl+S</td><td>{% trans "Shows search tab" %}</td></tr>
    <tr><td>Ctrl+O</td><td>{% trans "Copies source string" %}</td></tr>
    <tr><td>Ctrl+Y</td><td>{% trans "Toggle edit needed flag" %}</td></tr>
    </tbody>
    </table>
  </div></i>
  </span><h4 class="panel-title">{% if unit.translation.is_template %}{% trans "Editing source string" %}{% else %}{% trans "Translate" %}{% endif %}</h4></div>
  <div class="panel-body">
    {% csrf_token %}
    {% if antispam %}<div id="s_content">{{ antispam|crispy }}</div>{% endif %}

    <!-- secondary -->
    {% if secondary %}
    {% for secondary_unit in secondary %}
    <div class="form-group">
    <label>{{ secondary_unit.translation.language }}</label>
    {% perm 'unit.edit' secondary_unit as user_can_edit_secondary %}
    {% if user_can_edit_secondary %}
    <a title="{% trans "Edit string" %}"href="{{ secondary_unit.get_absolute_url }}"><i class="fa fa-pencil"></i></a>
    {% endif %}
    {% if user.profile.hide_source_secondary %}
    {% format_translation secondary_unit.target secondary_unit.translation.language secondary_unit.translation.plural search_match=search_query num_plurals=unit.translation.plural.number unit=unit %}
    {% else %}
    {% format_translation secondary_unit.target secondary_unit.translation.language secondary_unit.translation.plural %}
    {% endif %}
    </div>
    {% endfor %}
    {% endif %}

    <!-- source change -->
    {% if unit.previous_source and unit.fuzzy %}
    <div class="form-group">
    <label>{% trans "Source change" %}</label>
    {% format_translation unit.source unit.translation.component.project.source_language diff=unit.previous_source num_plurals=unit.translation.plural.number %}
    </div>
    {% endif %}

    {% if unit.translation.is_template %}
    <!-- editing template -->
    <div class="form-group">
    <label>{% trans "Context" %}</label>
    {% format_translation unit.context unit.translation.component.project.source_language search_match=search_query num_plurals=unit.translation.plural.number %}
    </div>
    {% else %}

    {% if unit.comment %}
    <!-- comment -->
    <div class="form-group help-block">
    <label>{% trans "Source string comment" %}</label>
    {% format_translation unit.comment unit.translation.component.project.source_language %}
    </div>
    {% endif %}

    {% if unit.source_info.context %}
    <!-- source string context  -->
    <div class="form-group help-block">
    <label>{% trans "Additional context" %}</label>
    {% format_translation unit.source_info.context unit.translation.component.project.source_language %}
    </div>
    {% endif %}

    {% if not user.profile.hide_source_secondary or not secondary %}
    <!-- source -->
    <div class="form-group">
    {% if unit.context %}
    <div class="pull-right flip">
    <label>{% trans "Context:" %}</label>
    {{ unit.context }}
    </div>
    {% endif %}
    <label>{% trans "Source" %}</label>
    {% with unit.translation.component.get_editable_template as edit_template %}
    {% if edit_template %}
    {% perm 'unit.edit' edit_template as user_can_edit_template %}
    {% if user_can_edit_template %}
    <a title="{% trans "Edit source string" %}"href="{{ edit_template.get_translate_url }}?checksum={{ unit.checksum }}"><i class="fa fa-pencil"></i></a>
    {% endif %}
    {% endif %}
    {% endwith %}
    {% format_translation unit.source unit.translation.component.project.source_language search_match=search_query num_plurals=unit.translation.plural.number unit=unit %}
    </div>
    {% endif %}
    {% endif %}

    <!-- edit form -->
    {% crispy form %}
  </div>
  <div class="panel-footer">
    <button class="btn btn-primary" type="submit" name="save" tabindex="150" 
    {% if locked or not user_can_translate %}disabled="disabled"{% endif %} 
    {% if not user_can_translate %}
    {% if not user.is_authenticated %}
    title="{% trans "Please log in to save translations." %}"
    {% elif unit.approved %}
    title="{% trans "Only reviewers can change approved strings, please add a suggestion if you think the string should be changed." %}"
    {% elif unit.translation.component.suggestion_voting %}
    title="{% trans "This translation only accepts suggestions and these are approved by voting." %}"
    {% else %}
    title="{% trans "Insufficient privileges for saving translations." %}"
    {% endif %}
    {% elif locked %}
    title="{% trans "This translation is currently locked." %}"
    {% endif %}
    ><i class="fa fa-check"></i> {% trans "Save" %}</button>

    {% if unit.translation.component.enable_suggestions %}
    <button class="btn btn-warning" type="submit" name="suggest" tabindex="151" 
    {% if project_locked or not user_can_suggest %}disabled="disabled"{% endif %}
    {% if not user_can_suggest %}
    title="{% trans "Insufficient privileges for adding suggestions." %}"
    {% elif project_locked %}
    title="{% trans "This translation is currently locked." %}"
    {% endif %}
    ><i class="fa fa-comment"></i> {% trans "Suggest" %}</button>
    {% endif %}
    <button class="btn btn-info" type="submit" name="skip" tabindex="152"><i class="fa {% if LANGUAGE_BIDI %}fa-backward{% else %}fa-forward{% endif %}"></i> {% trans "Skip" %}</button>
  </div>
</div>
</form>

<ul class="nav nav-pills translation-tabs">
<li class="active"><a href="#nearby" data-toggle="tab" id="toggle-nearby" title="{% trans "Messages placed around this one" %}">{% trans "Nearby strings" %} <span class="badge">{{ nearby|length }}</span></a></li>
{% if unit.suggestions %}
<li><a href="#suggestions" data-toggle="tab" id="toggle-suggestions">{% trans "Suggestions" %} <span class="badge">{{ unit.suggestions|length }}</span></a></li>
{% endif %}
{% if others.total %}
<li><a href="#others" data-toggle="tab" id="toggle-others">{% trans "Other occurrences" %} <span class="badge">{{ others.total }}</span></a></li>
{% endif %}
{% if comments or user_can_add_comment %}
<li><a href="#comments" data-toggle="tab" id="toggle-comments">{% trans "Comments" %}{% if comments %} <span class="badge">{{ comments|length }}</span>{% endif %}</a></li>
{% endif %}
{% if user_can_use_mt %}
<li><a href="#machine" data-toggle="tab" id="toggle-machine" data-load="mt" title="{% trans "Machine translation suggestions" %}">{% trans "Machine translation" %}</a></li>
{% endif %}
<li><a href="#translations" data-toggle="tab" id="toggle-translations" data-href="{% url 'js-unit-translations' unit_id=unit.id %}" title="{% trans "Translations of this string in the other languages" %}">{% trans "Other languages" %}</a></li>
<li><a href="#history" data-toggle="tab" id="toggle-history" data-href="{% url 'js-unit-changes' unit_id=unit.id %}" title="{% trans "List of recent changes done in Weblate" %}">{% trans "History" %}</a></li>
</ul>

<div class="tab-content">

<div class="tab-pane active" id="nearby">
<table class="table table-condensed">
<thead>
<tr><th></th><th>{% if unit.translation.is_template %}{% trans "Context" %}{% else %}{% trans "Source" %}{% endif %}</th><th>{% trans "Translation" %}</th><th>{% trans "State" %}</th></tr>
</thead>
<tbody>
{% for item in nearby %}
<tr {% if unit.position == item.position %}class="current_translation"{% endif %}>
<td class="number"><a href="{{ item.get_absolute_url }}">{{ item.position }}</a></td>
{% if unit.translation.is_template %}
<td><a href="{{ item.get_absolute_url }}">{% format_translation item.context unit.translation.component.project.source_language %}</a></td>
{% else %}
<td><a href="{{ item.get_absolute_url }}">{% format_translation item.source unit.translation.component.project.source_language %}</a></td>
{% endif %}
<td><a href="{{ item.get_absolute_url }}">{% format_translation item.target unit.translation.language unit.translation.plural %}</a></td>
<td>{% get_state_flags item %}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>

{% if unit.suggestions %}
<div class="tab-pane" id="suggestions">
<form action="{{ this_unit_url }}" method="post">
    {% csrf_token %}
<input type="hidden" name="checksum" value="{{ unit.checksum }}" />

{% for suggestion in unit.suggestions %}
<h5>
<span class="pull-right flip">{{ suggestion.timestamp|naturaltime }}</span>
<strong>
{% if suggestion.user %}
{% blocktrans with suggestion.get_user_display as user %}{{ user }} has suggested{% endblocktrans %}
{% else %}
{% trans "Anonymous user has suggested" %}
{% endif %}
</strong></h5>
{% format_translation suggestion.target unit.translation.language unit.translation.plural %}
<p class="help-block">{% trans "Suggested change:" %}</p>
{% format_translation suggestion.target unit.translation.language unit.translation.plural unit.target %}
{% if user_can_vote_suggestion %}
<p class="help-block">
{% blocktrans count count=suggestion.get_num_votes %}{{ count }} vote{% plural %}{{ count }} votes{% endblocktrans %}
</p>
{% endif %}
<div class="pull-right flip">
{% if user.is_authenticated and user_can_vote_suggestion %}
<button type="submit" class="btn btn-primary" name="upvote" value="{{ suggestion.id }}"><i class="fa fa-thumbs-up"></i> {% trans "Vote for" %}</button>
<button type="submit" class="btn btn-danger" name="downvote" value="{{ suggestion.id }}"><i class="fa fa-thumbs-down"></i> {% trans "Vote against" %}</button>
{% endif %}
{% if user_can_accept_suggestion %}
<button type="submit" class="btn btn-primary" name="accept" value="{{ suggestion.id }}"><i class="fa fa-check"></i> {% trans "Accept" %}</button>
<button type="submit" class="btn btn-warning" name="accept_edit" value="{{ suggestion.id }}"><i class="fa fa-pencil"></i> {% trans "Accept and edit" %}</button>
{% endif %}
{% perm 'suggestion.delete' suggestion unit.translation as user_can_delete_suggestion %}
{% if user_can_delete_suggestion %}
{% if has_antispam and suggestion.user != user %}
<button type="submit" class="btn btn-danger" name="spam" value="{{ suggestion.id }}"><i class="fa fa-trash"></i> {% trans "Mark as spam" %}</button>
{% endif %}
<button type="submit" class="btn btn-danger" name="delete" value="{{ suggestion.id }}"><i class="fa fa-trash"></i> {% trans "Delete" %}</button>
{% endif %}
</div>
<div class="clearfix"></div>
{% endfor %}
</form>
</div>
{% endif %}

{% if others.total %}
<div class="tab-pane" id="others">
<table class="table table-condensed">
    <thead>
    <tr><th>{% trans "Component" %}</th><th>{% trans "Translation" %}</th><th></th></tr>
    </thead>
    {% if others.same %}
    <tbody>
    {% for item in others.same %}
    {% include "trans/other-row.html" %}
    {% endfor %}
    </tbody>
    {% endif %}
    {% if others.matching %}
    <tr><th colspan="3" class="warning">{% blocktrans count count=others.matching|length %}Following string has same context and same source.{% plural %}Following strings have same context and same source.{% endblocktrans %}</td></tr>
    <tbody>
    {% for item in others.matching %}
    {% include "trans/other-row.html" %}
    {% endfor %}
    </tbody>
    {% endif %}
    {% if others.source %}
    <tr><th colspan="3" class="warning">{% blocktrans count count=others.source|length %}Following string has different context but same source.{% plural %}Following strings have different contexts but same source.{% endblocktrans %}</td></tr>
    <tbody>
    {% for item in others.source %}
    {% include "trans/other-row.html" %}
    {% endfor %}
    </tbody>
    {% endif %}
    {% if others.context %}
    <tr><th colspan="3" class="warning">{% blocktrans count count=others.context|length %}Following string has different source but same context.{% plural %}Following strings have different sources but same context.{% endblocktrans %}</td></tr>
    <tbody>
    {% for item in others.context %}
    {% include "trans/other-row.html" %}
    {% endfor %}
    </tbody>
    {% endif %}
    </table>
</div>
{% endif %}

<div class="tab-pane" id="translations">
<p>{% trans "Loading…" %}</p>
</div>

<div class="tab-pane" id="history">
<p>{% trans "Loading…" %}</p>
</div>

{% if user_can_use_mt %}
<div class="tab-pane" id="machine">
<table class="table table-compact table-striped">
<thead>
<tr>
<th>{% trans "Translation" %}</th>
<th>{% trans "Source" %}</th>
<th>{% trans "Service" %}</th>
<th>{% trans "Quality" %}</th>
<th colspan="2">
<i id="mt-loading" class="fa fa-spinner fa-spin pull-right flip" style="display:none;"></i>
</th>
<tr>
</thead>
<tbody id="machine-translations">
</tbody>
</table>
<ul id="mt-errors">
</ul>
</div>
{% endif %}

{% if comments or user_can_add_comment %}
<div class="tab-pane" id="comments">

{% if comments %}
  {% with this_unit_url as next_url %}
    {% include "list-comments.html" with object=unit.translation %}
  {% endwith %}
{% endif %}

{% if user_can_add_comment %}
<form method="post" action="{% url 'comment' pk=unit.id %}" class="auto-save-translation">
{% csrf_token %}
<input type="hidden" name="next" value="{{ this_unit_url }}#comments" />
<div class="panel panel-primary">
<div class="panel-heading"><h4 class="panel-title">{% trans "New comment" %}</h4></div>
  <div class="panel-body">
  <p class="help-block">{% trans "Comment on this string for fellow translators and developers to read." %}</p>
{{ comment_form|crispy }}
</div>
<div class="panel-footer">
<input type="submit" value="{% trans "Save" %}" class="btn btn-primary" />
</div>
</div>
</form>
{% endif %}

</div>
{% endif %}


</div>

</div>

<div class="col-sm-3 small">

{% with unit.active_checks as checks %}
{% if checks or unit.suggestions %}
<div class="panel panel-danger">
  <div class="panel-heading"><h4 class="panel-title">{% trans "Things to check" %}</h4></div>
  <div class="panel-body">
  {% if unit.suggestions %}
  <div class="alert alert-{% if unit.approved %}danger{% else %}warning{% endif %} check"><a href="#suggestions" data-toggle="tab" class="alert-link">{% trans "Suggestions" %}</a> <span class="badge pull-right flip">{{ unit.suggestions|length }}</span></div>
  {% endif %}
  {% show_checks unit.translation checks user %}
  {% if comments %}
  <div class="alert alert-info check"><a href="#comments" data-toggle="tab" class="alert-link">{% trans "Comments" %}</a> <span class="badge pull-right flip">{{ comments|length }}</span></div>
  {% endif %}
  </div>
</div>
{% endif %}
{% endwith %}

<form action="{% url 'js-add-glossary' unit_id=unit.id %}" method="POST" class="add-dict-inline double-submission">
{% csrf_token %}
{{ addword_form.words }}
<input type="hidden" name="next" value="{{ this_unit_url }}" />
<div class="panel panel-primary">
  <div class="panel-heading">
  <h4 class="panel-title">
    <a class="pull-right flip" title="{% trans "Manage glossary" %}" href="{% url 'show_dictionary' project=unit.translation.component.project.slug lang=unit.translation.language.code %}"><i class="fa fa-pencil-square-o"></i></a>
    <i id="glossary-add-loading" class="fa fa-spinner fa-spin pull-right flip" style="display:none;"></i>
    {% trans "Glossary" %}
  </h4>
  </div>
    <table class="table table-condensed table-striped">
        <thead>
        <tr>
        <th>{% trans "Source" %}</th>
        <th>{% trans "Translation" %}</th>
        </tr>
        </thead>
        <tbody>
        {% include "glossary-embed.html" %}
        </tbody>
    </table>
{% if user_can_add_dictionary %}
    <table class="table table-condensed table-add-glossary">
        <tfoot>
        <tr>
        <th>{% trans "Add word to glossary" %}</th>
        <td>
        <input type="submit" class="btn btn-primary btn-xs pull-right flip" value="{% trans "Add" %}" />
        </td>
        </tr>
        <tr class="form-inline">
        <td colspan="2">{{ addword_form.source }}</td>
        </tr>
        <tr class="form-inline">
        <td colspan="2">{{ addword_form.target }}</td>
        </tr>
        </tfoot>
    </table>
{% endif %}
</div>
</form>

<div class="panel panel-primary">
  <div class="panel-heading">
  <h4 class="panel-title">
    {% documentation_icon 'user/translating' 'source-context' right=True %}
  {% trans "Source information" %}
  </h4>
  </div>
  <table class="table table-striped table-condensed">
    {% with unit.source_info.screenshots.order as screenshots %}
    {% if screenshots or user_can_add_screenshot %}
    <tr>
    <th>
    {% if user_can_add_screenshot %} <a class="button smallbutton pull-right flip" id="edit-screenshot" href="{% url 'review_source' project=unit.translation.component.project.slug component=unit.translation.component.slug  %}?checksum={{ unit.checksum }}"><i class="fa fa-pencil"></i></a>{% endif %}
    {% trans "Screenshot context" %}
    </th>
    </tr>
    <tr>
    <td>
    {% for screenshot in screenshots %}
    {% include "screenshots/screenshot_show.html" %}
    {% empty %}
    {% trans "No screenshot currently associated!" %}
    {% endfor %}
    </td>
    </tr>
    {% endif %} 
    {% endwith %}
    {% if unit.context or unit.source_info.context or user_can_edit_source %}
    <tr>
    <th>
    {% if user_can_edit_source %} <a class="button smallbutton pull-right flip" href="{% url 'review_source' project=unit.translation.component.project.slug component=unit.translation.component.slug  %}?checksum={{ unit.checksum }}"><i class="fa fa-pencil"></i></a>{% endif %}
    {% trans "Context" %}
    </th>
    </tr>
    {% if user_can_edit_source and not unit.source_info.context and not unit.context %}
    <tr>
    <td>{% trans "No context currently associated!" %}</td>
    </tr>
    {% endif %}
    {% if unit.source_info.context %}
    <tr>
    <td>{{ unit.source_info.context }}</td>
    </tr>
    {% endif %}
    {% if unit.context %}
    <tr>
    <td>{% format_translation unit.context unit.translation.component.project.source_language search_match=search_query simple=True %}</td>
    </tr>
    {% endif %}
    {% endif %}
    {% if unit.all_flags or user_can_edit_source %}
    <tr>
    <th>
    {% if user_can_edit_source %} <a class="button smallbutton pull-right flip" href="{% url 'review_source' project=unit.translation.component.project.slug component=unit.translation.component.slug  %}?checksum={{ unit.checksum }}"><i class="fa fa-pencil"></i></a>{% endif %}
    {% trans "Flags" %}
    </th>
    </tr>
    <tr>
    <td>
    {% if unit.all_flags %}
    {{ unit.all_flags.format }}
    {% else %}
    {% trans "No flags currently set!" %}
    {% endif %}
    </td>
    </tr>
    {% endif %}
    {% include "unit-details.html" %}
    <tr>
    <th>
    {% if user_can_edit_source %} <a class="button smallbutton pull-right flip" href="{% url 'review_source' project=unit.translation.component.project.slug component=unit.translation.component.slug  %}?checksum={{ unit.checksum }}"><i class="fa fa-pencil"></i></a>{% endif %}
    {% trans "String priority" %}
    </th>
    </tr>
    <tr>
    <td>
    {{ unit.source_info.get_priority_display }}
    </td>
    </tr>
    {% with unit.active_source_checks as checks %}
    {% if checks %}
    <tr>
    <th>{% trans "Failing checks" %}</th>
    </tr>
    <tr>
    <td>{% show_checks unit.translation checks user %}</td>
    </tr>
    {% endif %}
    {% endwith %}
  </table>
</div>

</div>

</div>
</div>

<a href="{% url 'js-translate' unit_id=unit.id service="__service__" %}" class="hidden" id="js-translate"></a>
<a href="{% url 'js-mt-services' %}" class="hidden" id="js-mt-services"></a>

{% endwith %}

{% endblock %}
