{% extends 'layout/page.html' %}

{% block head_title %}
  {{ context._classname.capitalize() }} {% trans %}editing{% endtrans %}
{% endblock %}

{% block page_header %}
  {{ context._classname.capitalize() }} {% trans %}editing{% endtrans %}
{% endblock %}

{% block content %}

  {% include 'layout/permission.html' %}

  {% if context.is_view_ok() %}
    <p class="form-help">{% trans %}
     You may edit the contents of the
     class using this form. Commas, newlines and double quotes (") must be
     handled delicately. You may include commas and newlines by enclosing the
     values in double-quotes ("). Double quotes themselves must be quoted by
     doubling ("").
    {% endtrans %}</p>

    <p class="form-help">{% trans %}
     Multilink properties have their multiple values colon (":") separated
     (... ,"one:two:three", ...)
    {% endtrans %}</p>

    <p class="form-help">{% trans %}
     Remove entries by deleting their line. Add new entries by appending
     them to the table - put an X in the id column. If you wish to restore a
     removed item and you know its id then just put that id in the id column.
    {% endtrans %}</p>
    <form method="POST" action='{{ context.designator() }}'>
      <textarea rows="15" style="width:90%" name="rows">{{ context.csv()|u }}</textarea>
      <br>
      <input name="@csrf" type="hidden" value="{{ utils.anti_csrf_nonce() }}">
      <input type="hidden" name="@action" value="editCSV">
      <input class="btn btn-success" type="submit" value="{% trans %}Edit Items{% endtrans %}">
    </form>
  {% endif %}

{%endblock %}
