123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- {% extends "misago/threads/base.html" %}
- {% load i18n misago_stringutils %}
- {% block title %}{% trans "Private threads" %}{% if page.number > 1 %} ({% blocktrans with page=page.number %}Page {{ page }}{% endblocktrans %}){% endif %} | {{ block.super }}{% endblock title %}
- {% block content %}
- <div class="page-header">
- <div class="container">
- <h1>
- {% trans "Private threads" %}
- </h1>
- </div>
- </div>
- {{ block.super }}
- {% endblock content %}
- {% block threads-panel %}
- <div class="table-actions">
- {% include "misago/threads/paginator.html" %}
- {% include "misago/threads/sort.html" %}
- {% include "misago/threads/show.html" %}
- {% include "misago/privatethreads/start_btn.html" %}
- </div>
- {{ block.super }}
- <div class="table-actions">
- {% include "misago/threads/paginator.html" %}
- {% include "misago/privatethreads/start_btn.html" %}
- </div>
- {% endblock threads-panel %}
- {% block thread-flags %}
- <li class="tooltip-top" title="{% trans "Thread participants" %}">
- <button type="button" class="btn-show-participants" data-participants-url="{% url 'misago:private_thread_participants' thread_slug=thread.slug thread_id=thread.id %}">
- <span class="fa fa-users fa-fw fa-lg"></span>
- </button>
- </li>
- {% endblock thread-flags %}
- {% block no-threads %}
- {% if filtering.is_active %}
- {% trans "No threads matching criteria exist, or you don't have permission to see them." %}
- <a href="{% url 'misago:private_threads' %}" class="btn btn-primary">
- {% trans "See all threads" %}
- </a>
- {% else %}
- {% trans "You are not participating in any private threads." %}
- {% endif %}
- {% endblock no-threads %}
- {% block javascripts %}
- {{ block.super }}
- <script lang="JavaScript">
- $(function() {
- var participants_cache = {};
- function enable_participants_popover($e, data) {
- $e.popover({
- html: true,
- content: data,
- placement: 'top',
- trigger: 'focus',
- template: '<div class="popover" role="tooltip"><div class="arrow"></div><div class="popover-content"></div></div>'
- });
- }
- $('.btn-show-participants').click(function() {
- var $btn = $(this);
- var api_url = $btn.data('participants-url');
- if (participants_cache[api_url] == undefined) {
- $.get(api_url, function(data) {
- participants_cache[api_url] = data;
- enable_participants_popover($btn, participants_cache[api_url]);
- $btn.popover('show');
- })
- }
- });
- {% if user.acl.can_start_private_threads %}
- $('.btn-reply').click(function() {
- var $btn = $(this);
- Misago.Posting.load({
- api_url: "{% url 'misago:start_private_thread' %}",
- on_load: function() {
- var participants = new Misago.Participants($('.thread-participants-input'));
- }
- });
- });
- {% endif %}
- });
- </script>
- {% endblock javascripts %}
|