{% load i18n %}
{% load addons %}
{% load submissions %}
{% url component_submit_file pofile.object.project.slug pofile.object.slug pofile.filename as file_submit_url %}
{% with pofile.filename as pofile_filename %}
  <span class="i16 nodecoration_icon send_file submit_button buttonized_simple houdini_toggler" title="{% blocktrans %}Submit a translation for {{ pofile_filename }}{% endblocktrans %}"></span>
{% endwith %}
<form class="submit_form compact houdini" method="POST" action="{{ file_submit_url }}" enctype="multipart/form-data">
<fieldset>
  <legend>{% trans "Submit file" %}</legend>
    <input type="file" name="submitted_file">
    <p>
    {% if perms.projects.submit_file or can_submit_file %}
    <input type="submit" class="i16 send_file" size="10" value="{% trans "Send" %}">
    {% else %}
    <script type="text/javascript">
    $(document).ready(function() { $('#pofile-submit-{{pofile.language_code}}').attr('disabled','true'); });
    </script>
    {% endif %}
    <input type="submit" class="i16 send_file" size="10" name="submit_for_review" value="{% trans "Send for Review" %}">
    </p>

{% comment %}Temporarily hooks are disabled here, until we improve the compontent detail view{% endcomment %}

{% load locks_tags %}
{% with pofile.locks.valid.get as lock %}
{% if lock %}
      {% ifequal request.user lock.owner %}
      <input type="checkbox" name="lock_extend"/> Keep file locked
      {% else %}
      <p style="margin: 0px; color:#C27878;">{% trans "This file is locked by someone else." %}</p>
      <script type="text/javascript">
      $(document).ready(function() { $('#pofile-submit-{{pofile.language_code}}').attr('disabled','true'); });
      </script>
      {% endifequal %}
{% endif %}
{% endwith %}

{% comment %}{% hook "component.html" submit %}{% endcomment %}
</fieldset>
</form>
