{% extends "cranefly/layout.html" %} {% load i18n %} {% load url from future %} {% import "_forms.html" as form_theme with context %} {% import "cranefly/editor.html" as editor with context %} {% import "cranefly/macros.html" as macros with context %} {% block title %}{% if thread -%} {{ macros.page_title(title=_(get_title()), parent=thread.name) }} {%- else -%} {{ macros.page_title(title=_(get_title()), parent=forum.name) }} {%- endif %}{% endblock %} {% block breadcrumb %}{{ super() }} / {% for parent in parents %}
  • {{ parent.name }} /
  • {% endfor %} {% if thread %}
  • {{ thread.name }} /
  • {% endif %}
  • {{ get_title() }} {%- endblock %} {% block content %} {% if message %}{{ macros.draw_message(message, 'alert-form') }}{% endif %} {% if preview %}
    {{ preview|markdown_final|safe }}

    {% endif %}
    {% if 'thread_name' in form.fields %}{{ form_theme.row_widget(form.fields.thread_name) }}{% endif %} {% if 'edit_reason' in form.fields %}{{ form_theme.row_widget(form.fields.edit_reason) }}{% endif %} {{ editor.editor(form.fields.post, get_button(), rows=8, extra=get_extra()) }}
    {% endblock %} {% block stylesheets %}{{ super() }} {% endblock %} {% block javascripts %}{{ super() }} {{ editor.js() }} {% endblock %} {% macro get_action() -%} {% if mode == 'new_thread' -%} {% url 'thread_new' forum=forum.pk, slug=forum.slug %} {%- elif mode == 'edit_thread' -%} {% url 'thread_edit' thread=thread.pk, slug=thread.slug %} {%- elif mode in ['new_post', 'new_post_quick'] -%} {%- if quote -%} {% url 'thread_reply' thread=thread.pk, slug=thread.slug, quote=quote.pk %} {%- else -%} {% url 'thread_reply' thread=thread.pk, slug=thread.slug %} {%- endif -%} {%- elif mode == 'edit_post' -%} {% url 'post_edit' thread=thread.pk, slug=thread.slug, post=post.pk %} {%- endif %} {%- endmacro %} {% macro get_title() -%} {% if mode == 'new_thread' -%} {% trans %}Post New Thread{% endtrans %} {%- elif mode == 'edit_thread' -%} {% trans %}Edit Thread{% endtrans %} {%- elif mode in ['new_post', 'new_post_quick'] -%} {% trans %}Post New Reply{% endtrans %} {%- elif mode == 'edit_post' -%} {% trans %}Edit Reply{% endtrans %} {%- endif %} {%- endmacro %} {% macro get_info() -%} {% if mode == 'edit_post' -%} {% if post.moderated %}
  • {% trans %}Not Reviewed{% endtrans %}
  • {% endif %}
  • {{ post.date|reltimesince }}
  • {% if post.user %}{{ post.user.username }}{% else %}{{ post.user_name }}{% endif %}
  • {% if post.edits > 0 -%} {% trans count=post.edits %}One edit{% pluralize %}{{ count }} edits{% endtrans %} {%- else -%} {% trans %}First edit{% endtrans %} {%- endif %}
  • {%- else -%} {% if thread.moderated %}
  • {% trans %}Not Reviewed{% endtrans %}
  • {% endif %}
  • {{ thread.last|reltimesince }}
  • {% if thread.start_poster_id %}{{ thread.start_poster_name }}{% else %}{{ thread.start_poster_name }}{% endif %}
  • {% if thread.replies > 0 -%} {% trans count=thread.replies, replies=thread.replies|intcomma %}One reply{% pluralize %}{{ replies }} replies{% endtrans %} {%- else -%} {% trans %}No replies{% endtrans %} {%- endif %}
  • {%- endif %} {%- endmacro %} {% macro get_button() -%} {% if mode == 'new_thread' -%} {% trans %}Post Thread{% endtrans %} {%- elif mode == 'edit_thread' -%} {% trans %}Edit Thread{% endtrans %} {%- elif mode in ['new_post', 'new_post_quick'] -%} {% trans %}Post Reply{% endtrans %} {%- elif mode == 'edit_post' -%} {% trans %}Edit Reply{% endtrans %} {%- endif %} {%- endmacro %} {% macro get_extra() %} {% endmacro %}