{% load i18n %}
<div id="save_dialog" class="dialog" data-ui-jsclass="SaveDialog">
	<form method="POST" action="#">
    {% csrf_token %}
	<p>{{ forms.text_save.comment.label }}</p>
	<p class="help_text">
		{{ forms.text_save.comment.help_text}}
		<span data-ui-error-for="{{ forms.text_save.comment.name }}"> </span>
	</p>
	{{forms.text_save.comment }}



	{% if request.user.is_anonymous %}
    <table style='margin:0 4%;'>
    <tr>
        <td>{{ forms.text_save.author_name.label }}:</td>
        <td>{{ forms.text_save.author_name }}
        <span class="help_text">{{ forms.text_save.author_name.help_text }}</span>
        <span data-ui-error-for="{{ forms.text_save.author_name.name }}"> </span></td>
    </tr>
    <tr>
        <td>{{ forms.text_save.author_email.label }}:</td>
        <td>{{ forms.text_save.author_email }}
        <span class="help_text">{{ forms.text_save.author_email.help_text }}</span>
        <span data-ui-error-for="{{ forms.text_save.author_email.name }}"> </span></td>
    </tr>
    </table>
    {% endif %}

    <p data-ui-error-for="__all__"> </p>

    <div class="container">
      <button type="submit" class="ok btn btn-primary" data-ui-action="save">Zapisz</button>
      <button type="button" class="cancel btn btn-secondary" data-ui-action="cancel">Anuluj</button>

      {% if request.user.is_authenticated %}
      <div class="row mt-4">
	<div class="col-6">
	  {{ forms.text_save.stage_completed.label }}:
	  {{ forms.text_save.stage_completed }}
	  <span class="help_text">{{ forms.text_save.stage_completed.help_text }}</span>
	  <span data-ui-error-for="{{ forms.text_save.stage_completed.name }}"> </span>
	</div>
	{% if can_pubmark %}
	<div class="col-6">
	  {{ forms.text_save.publishable.label_tag }}
	  {{ forms.text_save.publishable }}
	  <span class="help_text">{{ forms.text_save.publishable.help_text }}</span>
	  <span data-ui-error-for="{{ forms.text_save.publishable.name }}"> </span>
	</div>
	{% endif %}
      </div>

      {% endif %}
    </div>


	{% for f in forms.text_save.hidden_fields %}
		{{ f }}
	{% endfor %}

	</form>
</div>
