Source

zine-main / zine / templates / admin / edit_entry.html

{% extends "admin/layout.html" %}
{% from "admin/_form_helpers.html" import render_formbox, render_post_actions %}
{% set title_suffix = _("New Entry") if form.new else _("Edit Entry") %}
{% block title %}{% if form.post.title %}{{ form.post.title|e }}{%
  endif %}​{{ title_suffix }}{% endblock %}
{% block contents %}
  <h1>{{ self.title() }}{% if not form.new %} <a href="{{ url_for(form.post)
    }}" class="preview">{{ _("View Entry") }}</a>{% endif %}</h1>
  {% if form.preview %}
    <div class="preview" id="preview">
      <h2 class="title">{{ _('Preview') }} (<a href="#post_form">{{ _('skip') }}</a>)</h2>
      <div class="text">
        {{ form.render_preview() }}
      </div>
    </div>
  {% endif %}
  {% call form(id="post_form") %}
    {%- if form.parser_missing %}
      <ul class="errors">
        <li><strong>{{ _("Important:") }}</strong>
        {% trans %}This post was created with a parser that is no longer
        available.  You won't be able to save the post with the same parser
        unless you re-activate the plugin that provided it.{% endtrans %}
      </ul>
    {%- endif %}
    <div class="formbox formbox-title">
      <h3>{{ form.title.label() }}</h3>
      {{ form.title(size=36) }}
    </div>
    <div class="formbox">
      <h3>{{ form.text.label() }}</h3>
      {{ form.text(rows=12, class='resizable') }}
    </div>
    <div class="secondary">{{ render_post_actions(form) }}</div>
    {{ render_formbox(form.status, collapsed=false) }}
    {{ render_formbox(form.tags) }}
    <div class="formbox toggleable collapsed">
      <h3>{{ form.categories.label() }}</h3>
      {{ form.categories(empty_msg=_('No categories.')) }}
    </div>
    {{ render_formbox(form.parser) }}
    <div class="formbox toggleable collapsed">
      <h3>{{ _("Discussion") }}</h3>
      <ul>
        {{ form.comments_enabled.as_li() }}
        {{ form.pings_enabled.as_li() }}
        {{ form.ping_links.as_li() }}
      </ul>
    </div>
    {{ render_formbox(form.pub_date) }}
    {{ render_formbox(form.slug, collapsed=not form.slug.value) }}
    {{ render_formbox(form.author) }}
    {% if not form.new %}
      <p class="preview">
        <a href="{{ url_for(form.post) }}">{{ _("View Entry") }}</a>
      </p>
    {% endif %}
    <div class="post-bookmarklets"></div>
    {{ render_post_actions(form) }}
  {% endcall %}
{% endblock %}