{# vim: set ts=2 et sts=2 sw=2: #}
{% extends "kbforums/base.html" %}
{% from "layout/errorlist.html" import errorlist %}
{# L10n: {t} is the title of the thread. {d} is the name of the document. #}
{% set title = _('Edit thread {t} | {d} Discussion | Knowledge Base')|f(t=thread.title, d=document.title) %}
{% set crumbs = [(url('wiki.category', document.category), document.get_category_display()),
                 (document.get_absolute_url(), document.title),
                 (url('wiki.discuss.threads', document.slug), _('Discuss')),
                 (url('wiki.discuss.posts', document.slug, thread.id), thread.title),
                 (None, _('Edit thread'))] %}

{% block content %}
<article id="edit-thread" class="main">
  <h1>{{ _('Edit thread "{t}"')|f(t=thread.title) }}</h1>

  <form action="{{ url('wiki.discuss.edit_thread', document.slug, thread.id) }}" method="post" class="edit-thread">
    {{ csrf() }}
    {{ errorlist(form) }}

    <div class="form-widget{% if form.title.errors %} invalid{% endif %}">
      {{ form.title.label_tag()|safe }}
      {{ form.title|safe }}
    </div>

    <div class="form-widget submit">
      <input type="submit" value="{{ _('Update thread') }}" />
      <a href="{{ url('wiki.discuss.posts', document.slug, thread.id) }}">{{ _('Cancel') }}</a>
    </div>
  </form>
</article>
{% endblock %}
