posting.html 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. {% extends "sora/layout.html" %}
  2. {% load i18n %}
  3. {% load url from future %}
  4. {% import "_forms.html" as form_theme with context %}
  5. {% import "sora/editor.html" as editor with context %}
  6. {% import "sora/macros.html" as macros with context %}
  7. {% block title %}{{ macros.page_title(title=_("Post New Thread"), parent=forum.name) }}{% endblock %}
  8. {% block breadcrumb %}{{ super() }} <span class="divider">/</span></li>
  9. {% for parent in parents %}
  10. <li class="first"><a href="{{ parent.type|url(forum=forum.pk, slug=forum.slug) }}">{{ parent.name }}</a> <span class="divider">/</span></li>
  11. {% endfor %}
  12. <li class="active">{% trans %}Post New Thread{% endtrans %}
  13. {%- endblock %}
  14. {% block content %}
  15. <div class="page-header">
  16. <ul class="breadcrumb">
  17. {{ self.breadcrumb() }}</li>
  18. </ul>
  19. <h1>{% trans %}Post New Thread{% endtrans %}</h1>
  20. {% if thread %}
  21. <ul class="unstyled thread-info">
  22. {% if thread.moderated %}<li><i class="icon-eye-close"></i> {% trans %}Not Reviewed{% endtrans %}</li>{% endif %}
  23. <li><i class="icon-time"></i> {{ thread.last|reltimesince }}</li>
  24. <li><i class="icon-user"></i> {% if thread.start_poster_id %}<a href="{% url 'user' user=thread.start_poster_id, username=thread.start_poster_slug %}">{{ thread.start_poster_name }}</a>{% else %}{{ thread.start_poster_name }}{% endif %}</li>
  25. <li><i class="icon-comment"></i> {% if thread.replies > 0 -%}
  26. {% trans count=thread.replies, replies=thread.replies|intcomma %}One reply{% pluralize %}{{ replies }} replies{% endtrans %}
  27. {%- else -%}
  28. {% trans %}No replies{% endtrans %}
  29. {%- endif %}</li>
  30. </ul>
  31. {%- endif %}
  32. </div>
  33. {% if message %}{{ macros.draw_message(message, 'alert-form') }}{% endif %}
  34. <form action="{% url 'thread_new' forum=forum.pk, slug=forum.slug %}" method="post">
  35. <input type="hidden" name="{{ csrf_id }}" value="{{ csrf_token }}">
  36. {{ form_theme.row_widget(form.fields.thread_name) }}
  37. {{ editor.editor(form.fields.post, _('Post Thread'), rows=8) }}
  38. </form>
  39. {% endblock %}