thread.html 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. {% extends "misago/base.html" %}
  2. {% load i18n misago_absoluteurl %}
  3. {% block title %}
  4. {% if paginator.page > 1 %}
  5. {{ thread.title }} ({% blocktrans with page=paginator.page %}page: {{ page }}{% endblocktrans %}) | {{ category.name }} | {{ block.super }}
  6. {% else %}
  7. {{ thread.title }} | {{ category.name }} | {{ block.super }}
  8. {% endif %}
  9. {% endblock title %}
  10. {% block og-title %}{{ thread.title }}{% endblock %}
  11. {% block twitter-title %}{{ thread.title }}{% endblock %}
  12. {% block og-description %}
  13. {% blocktrans trimmed with starter=thread.starter_name started_on=thread.started_on|date category=category.name %}
  14. Started by {{ starter }} on {{ started_on }} in the {{ category }} category.
  15. {% endblocktrans %} {% blocktrans trimmed count replies=thread.replies with last_post_on=thread.last_post_on|date %}
  16. {{ replies }} reply, last one from {{ last_post_on }}.
  17. {% plural %}
  18. {{ replies }} replies, last one from {{ last_post_on }}.
  19. {% endblocktrans %}{% if thread.has_best_answer %} {% trans "Answered." %}{% endif %}{% if thread.has_best_answer %} {% trans "Closed." %}{% endif %}
  20. {% endblock og-description %}
  21. {% block twitter-description %}
  22. {% blocktrans trimmed with starter=thread.starter_name started_on=thread.started_on|date category=category.name %}
  23. Started by {{ starter }} on {{ started_on }} in the {{ category }} category.
  24. {% endblocktrans %} {% blocktrans trimmed count replies=thread.replies with last_post_on=thread.last_post_on|date %}
  25. {{ replies }} reply, last one from {{ last_post_on }}.
  26. {% plural %}
  27. {{ replies }} replies, last one from {{ last_post_on }}.
  28. {% endblocktrans %}{% if thread.has_best_answer %} {% trans "Answered." %}{% endif %}{% if thread.has_best_answer %} {% trans "Closed." %}{% endif %}
  29. {% endblock twitter-description %}
  30. {% block og-url %}{% absoluteurl thread.get_absolute_url %}{% endblock %}
  31. {% block twitter-url %}{% absoluteurl thread.get_absolute_url %}{% endblock %}
  32. {% block og-image %}
  33. {% if settings.og_image_avatar_on_thread and thread.starter %}
  34. {% with thread.starter.avatars|first as og_image %}
  35. <meta name="twitter:image" content="{% absoluteurl og_image.url %}" />
  36. <meta property="og:image" content="{% absoluteurl og_image.url %}" />
  37. <meta property="og:image:width" content="{{ og_image.size }}" />
  38. <meta property="og:image:height" content="{{ og_image.size }}" />
  39. {% endwith %}
  40. {% else %}
  41. {{ block.super }}
  42. {% endif %}
  43. {% endblock og-image %}
  44. {% block meta-extra %}
  45. {% if paginator.page > 1 %}
  46. <link rel="canonical" href="{% url url_name slug=thread.slug pk=thread.pk page=paginator.page %}" />
  47. {% else %}
  48. <link rel="canonical" href="{% url url_name slug=thread.slug pk=thread.pk %}" />
  49. {% endif %}
  50. {% if paginator.previous > 1 %}
  51. <link rel="prev" href="{% url url_name slug=thread.slug pk=thread.pk page=paginator.previous %}" />
  52. {% elif paginator.first %}
  53. <link rel="prev" href="{% url url_name slug=thread.slug pk=thread.pk %}" />
  54. {% endif %}
  55. {% if paginator.next %}
  56. <link rel="next" href="{% url url_name slug=thread.slug pk=thread.pk page=paginator.next %}" />
  57. {% endif %}
  58. {% endblock meta-extra %}
  59. {% block content %}
  60. <div class="page page-thread {% if category.css_class %}page-thread-{{ category.css_class }}{% endif %}">
  61. <div class="page-header-bg">
  62. <div class="page-header">
  63. {% include "misago/thread/breadcrumbs.html" %}
  64. <div class="container">
  65. <h1>{{ thread.title }}</h1>
  66. </div>
  67. {% include "misago/thread/stats.html" %}
  68. </div>
  69. </div>
  70. <div class="container">
  71. {% include "misago/thread/toolbar-top.html" %}
  72. {% if thread.poll %}
  73. {% include "misago/poll/index.html" with poll=thread.poll %}
  74. {% endif %}
  75. {% include "misago/thread/posts/index.html" %}
  76. {% include "misago/thread/paginator.html" %}
  77. </div>
  78. </div>
  79. {% endblock content %}