{# vim: set ts=2 et sts=2 sw=2: #}
{% extends "forums/base.html" %}
{% from "layout/errorlist.html" import errorlist %}
{# L10n: {f} is the name of the forum, {t} is the name of the thread. #}
{% set title = _('Edit thread "{t}" | {f} | Forums')|f(t=thread.title, f=forum.name) %}
{% set crumbs = [(url('forums.forums'), _('Forums')),
                 (url('forums.threads', forum.slug), forum.name),
                 (url('forums.posts', forum.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('forums.edit_thread', forum.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('forums.posts', forum.slug, thread.id) }}">{{ _('Cancel') }}</a>
    </div>
  </form>
</article>
{% endblock %}
