{# vim: set ts=2 et sts=2 sw=2: #}
{% extends "gallery/media.html" %}
{% from "layout/errorlist.html" import errorlist %}
{% if media_type == 'image' %}
  {% set edit_this = _('Edit image') %}
  {% set save_this = _('Save image') %}
  {% set title = _('Edit image | {t} | Media Gallery')|f(t=media.title) %}
{% else %}
  {% set edit_this = _('Edit video') %}
  {% set save_this = _('Save video') %}
  {% set title = _('Edit video | {t} | Media Gallery')|f(t=media.title) %}
{% endif %}
{% set crumbs = [(url('gallery.gallery', media_type), _('Media Gallery')),
                 (url('gallery.media', media_type, media.id), media.title),
                 (None, edit_this)] %}

{% block content %}
  <article id="media-object-edit" class="main">
    <h1>{{ media.title }}</h1>
    <form action="{{ url('gallery.edit_media', media_type, media.id) }}" method="post">
      {{ csrf() }}
      {{ errorlist(form) }}
      <div class="form-item description">
        {{ form.description.label_tag()|safe }}
        {{ form.description|safe }}
      </div>
      <div class="form-actions form-item">
        <a href="{{ url('gallery.media', media_type, media.id) }}">{{ _('Cancel') }}</a>
        <input type="submit" class="btn" value="{{ save_this }}" />
      </div>
    </form>
  </article>
{% endblock %}
