{% load i18n %}

<form class="aloha" method="post" action="{% if post_url %}{{ post_url }}{% else %}{% if object_name %}{% url aloha_save_content %}{% endif %}{% endif %}">
  <div class="aloha-editable">
    {{ content|safe }}
  </div>
  {% csrf_token %}
  {% if object_name %}
      <input type="hidden" name="field_name" value="{{ field_name }}"/>
      <input type="hidden" name="object_name" value="{{ object_name }}"/>
      <input type="hidden" name="object_pk" value="{{ object_pk }}"/>
  {% endif %}
  <input type="hidden" name="next" value="{{ request.path }}"/>
  {% if post_url or object_name %}
     {# Separate submit not to interfere with site's submit button styles #}
     <input type="submit" style="display: none" value=""/>
     <input type="button" name="save-content" style="display: none;" value="{% trans 'Save' %}" />
  {% endif %}
</form>
