{% extends "cranefly/layout.html" %} {% 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() }} {{ macros.parents_list(parents) }}
  • {{ forum.name }}
  • {% if thread %}
  • {{ thread.name|short_string(35) }}
  • {% endif %}
  • {{ get_title() }} {%- endblock %} {% block container %}

    {{ get_title() }}

    {% if message %}
    {{ macros.draw_message(message) }}
    {% endif %} {% if preview %}
    {{ preview|markdown_final|safe }}
    {% endif %}
    {% if 'thread_name' in form.fields %} {{ form_theme.row(form.thread_name, attrs={'class': 'span8'}) }}

    {% trans %}Message Body{% endtrans %}

    {% endif %} {{ editor.editor(form.post, get_button(), rows=8, extra=get_extra()) }} {% if intersect(form.fields, ('edit_reason', 'thread_weight', 'close_thread')) %}
    {% if 'edit_reason' in form.fields %} {{ form_theme.row(form.edit_reason, attrs={'class': 'span8'}) }} {% endif %} {% if intersect(form.fields, ('thread_weight', 'close_thread')) %}
    {% if 'thread_weight' in form.fields %} {{ form_theme.field(form.thread_weight, attrs={'class': 'span8'}) }} {% endif %} {% if 'close_thread' in form.fields %} {% endif %}
    {% endif %}
    {% endif %}
    {% endblock %} {% block stylesheets %}{{ super() }} {% endblock %} {% block javascripts %}{{ super() }} {{ editor.js() }} {% endblock %} {% macro get_action() -%} {% if action == 'new_thread' -%} {{ url('thread_start', forum=forum.pk, slug=forum.slug) }} {%- elif action == 'edit_thread' -%} {{ url('thread_edit', thread=thread.pk, slug=thread.slug) }} {%- elif action in 'new_reply' -%} {%- 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 action == 'edit_reply' -%} {{ url('post_edit', thread=thread.pk, slug=thread.slug, post=post.pk) }} {%- endif %} {%- endmacro %} {% macro get_title() -%} {% if action == 'new_thread' -%} {% trans %}Post New Thread{% endtrans %} {%- elif action == 'edit_thread' -%} {% trans %}Edit Thread{% endtrans %} {%- elif action == 'new_reply' -%} {% trans %}Post New Reply{% endtrans %} {%- elif action == 'edit_reply' -%} {% trans %}Edit Reply{% endtrans %} {%- endif %} {%- endmacro %} {% macro get_info() -%} {% if action == 'edit_reply' -%} {% 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 edits=post.edits %}One edit{% pluralize %}{{ edits }} edits{% endtrans %} {%- else -%} {% trans %}First edit{% endtrans %} {%- endif %}
  • {%- else -%} {% if thread.moderated %}
  • {% trans %}Not Reviewed{% endtrans %}
  • {% endif %} {% if action == 'edit_thread' %}
  • {{ thread.start|reltimesince }}
  • {% else %}
  • {{ thread.last|reltimesince }}
  • {% endif %}
  • {% 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 %} {% if thread.closed %}
  • {% trans %}Locked{% endtrans %}
  • {% endif %} {%- endmacro %} {% macro get_button() -%} {% if action == 'new_thread' -%} {% trans %}Post Thread{% endtrans %} {%- elif action == 'new_reply' -%} {% trans %}Post Reply{% endtrans %} {%- else -%} {% trans %}Save Changes{% endtrans %} {%- endif %} {%- endmacro %} {% macro get_extra() %} {% endmacro %}