dropdown.html 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. {% load i18n misago_avatars misago_capture %}
  2. <div class="dropdown-title">
  3. {% if user.new_notifications %}
  4. {% capture trimmed as notifications %}
  5. <span class="label label-danger">{{ user.new_notifications }}</span>
  6. {% endcapture %}
  7. {% blocktrans trimmed with notifications=notifications|safe count counter=user.new_notifications%}
  8. {{ notifications }} new notification
  9. {% plural %}
  10. {{ notifications }} new notifications
  11. {% endblocktrans %}
  12. {% else %}
  13. {% capture trimmed as notifications %}
  14. <span class="label label-default">{{ notifications_count }}</span>
  15. {% endcapture %}
  16. {% blocktrans trimmed with notifications=notifications|safe count counter=user.new_notifications%}
  17. {{ notifications }} notification
  18. {% plural %}
  19. {{ notifications }} notifications
  20. {% endblocktrans %}
  21. {% endif %}
  22. </div>
  23. <ul class="list-unstyled scrollable">
  24. {% for item in items %}
  25. <li{% if item.is_new %} class="new"{% endif %}>
  26. <div class="state-icon">
  27. {% if item.is_new %}
  28. <span class="fa fa-circle"></span>
  29. {% else %}
  30. <span class="fa fa-circle-o"></span>
  31. {% endif %}
  32. </div>
  33. <a href="{{ item.get_absolute_url }}">
  34. {% if item.is_valid %}
  35. <a href="{{ item.get_absolute_url }}">
  36. {{ item.message|safe }}
  37. </a>
  38. {% else %}
  39. <a href="#">
  40. <em>{% trans "Notification is not available." %}</em>
  41. </a>
  42. {% endif %}
  43. <footer class="text-muted">
  44. {% if item.sender_username %}
  45. {% if item.sender_id %}
  46. <a href="{% url USER_PROFILE_URL user_slug=item.sender_slug user_id=item.sender_id %}" class="item-title">{{ item.sender_username }}</a>
  47. {% else %}
  48. <strong class="item-title">{{ item.sender_username }}</strong>
  49. {% endif %}
  50. {% endif %}
  51. <abbr class="tooltip-top dynamic time-ago" title="{{ item.date }}" data-timestamp="{{ item.date|date:"c" }}">
  52. {{ item.date|date }}
  53. </abbr>
  54. </footer>
  55. </li>
  56. {% empty %}
  57. <li class="empty">
  58. <span class="text-success fa fa-check fa-2x"></span>
  59. {% trans "You don't have any new notifications." %}
  60. </li>
  61. {% endfor %}
  62. </ul>
  63. <div class="dropdown-footer">
  64. <form action="{% url 'misago:notifications' %}" class="read-all-notifications" method="POST">
  65. {% csrf_token %}
  66. <a href="{% url 'misago:notifications' %}" name="read-all" class="btn btn-default btn-sm">
  67. {% trans "See all" %}
  68. </a>
  69. <button type="button" class="btn btn-default btn-refresh btn-sm" style="display: none;">
  70. {% trans "Refresh" %}
  71. </button>
  72. </form>
  73. </div>