list.html 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. {% extends "misago/threads/base.html" %}
  2. {% load i18n misago_stringutils %}
  3. {% block title %}{% trans "Private threads" %}{% if page.number > 1 %} ({% blocktrans with page=page.number %}Page {{ page }}{% endblocktrans %}){% endif %} | {{ block.super }}{% endblock title %}
  4. {% block content %}
  5. <div class="page-header">
  6. <div class="container">
  7. <h1>
  8. {% trans "Private threads" %}
  9. </h1>
  10. </div>
  11. </div>
  12. {{ block.super }}
  13. {% endblock content %}
  14. {% block threads-panel %}
  15. <div class="table-actions">
  16. {% include "misago/threads/paginator.html" %}
  17. {% include "misago/threads/sort.html" %}
  18. {% include "misago/threads/show.html" %}
  19. {% include "misago/privatethreads/start_btn.html" %}
  20. </div>
  21. {{ block.super }}
  22. <div class="table-actions">
  23. {% include "misago/threads/paginator.html" %}
  24. {% include "misago/privatethreads/start_btn.html" %}
  25. </div>
  26. {% endblock threads-panel %}
  27. {% block thread-flags %}
  28. <li class="tooltip-top" title="{% trans "Thread participants" %}">
  29. <button type="button" class="btn-show-participants" data-participants-url="{% url 'misago:private_thread_participants' thread_slug=thread.slug thread_id=thread.id %}">
  30. <span class="fa fa-users fa-fw fa-lg"></span>
  31. </button>
  32. </li>
  33. {% endblock thread-flags %}
  34. {% block no-threads %}
  35. {% if filtering.is_active %}
  36. {% trans "No threads matching criteria exist, or you don't have permission to see them." %}
  37. <a href="{% url 'misago:private_threads' %}" class="btn btn-primary">
  38. {% trans "See all threads" %}
  39. </a>
  40. {% else %}
  41. {% trans "You are not participating in any private threads." %}
  42. {% endif %}
  43. {% endblock no-threads %}
  44. {% block javascripts %}
  45. {{ block.super }}
  46. <script lang="JavaScript">
  47. $(function() {
  48. var participants_cache = {};
  49. function enable_participants_popover($e, data) {
  50. $e.popover({
  51. html: true,
  52. content: data,
  53. placement: 'top',
  54. trigger: 'focus',
  55. template: '<div class="popover" role="tooltip"><div class="arrow"></div><div class="popover-content"></div></div>'
  56. });
  57. }
  58. $('.btn-show-participants').click(function() {
  59. var $btn = $(this);
  60. var api_url = $btn.data('participants-url');
  61. if (participants_cache[api_url] == undefined) {
  62. $.get(api_url, function(data) {
  63. participants_cache[api_url] = data;
  64. enable_participants_popover($btn, participants_cache[api_url]);
  65. $btn.popover('show');
  66. })
  67. }
  68. });
  69. {% if user.acl.can_start_private_threads %}
  70. $('.btn-reply').click(function() {
  71. var $btn = $(this);
  72. Misago.Posting.load({
  73. api_url: "{% url 'misago:start_private_thread' %}",
  74. on_load: function() {
  75. var participants = new Misago.Participants($('.thread-participants-input'));
  76. }
  77. });
  78. });
  79. {% endif %}
  80. });
  81. </script>
  82. {% endblock javascripts %}