conversation_list.html 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. {% from "macros.html" import generate_obj_id %}
  2. <div class="panel conversation-panel">
  3. <div class="panel-heading conversation-head">
  4. <div class="row">
  5. <div class="col-md-12 col-sm-12 col-xs-12">
  6. <div class="pull-left">
  7. <span class="fa fa-comment"></span> {% trans %}Conversations{% endtrans %}
  8. </div>
  9. <div class="pull-right">
  10. <span class="label label-info" title="The amount of all conversations" data-toggle="tooltip" data-placement="top">{{ current_user.message_count }}/{{ flaskbb_config["MESSAGE_QUOTA"] }}</span>
  11. </div>
  12. </div>
  13. </div>
  14. </div>
  15. <div class="panel-body conversation-body">
  16. {% for conversation in conversations.items %}
  17. <div class="row conversation-row hover {% if conversation.unread %}unread{% endif %}">
  18. <!-- avatar -->
  19. <div class="col-md-1 col-sm-2 col-xs-2 conversation-avatar">
  20. {% if conversation.from_user and conversation.from_user.avatar %}
  21. <img src="{{ conversation.from_user.avatar }}" class="img-circle" alt="avatar" width="65px" height="65px" />
  22. {% else %}
  23. <img src="{{ url_for('static', filename='img/avatar80x80.png') }}" class="img-circle" alt="avatar" width="65px" height="65px" />
  24. {% endif %}
  25. </div>
  26. <!-- other stuff -->
  27. <div class="col-md-11 col-sm-10 col-xs-10 conversation-info">
  28. <!-- subject -->
  29. <div class="conversation-subject">
  30. <a href="{{ url_for('message.view_conversation', conversation_id=conversation.id) }}">
  31. {% if conversation.unread %}
  32. <strong>{{ conversation.subject }}</strong>
  33. {% else %}
  34. {{ conversation.subject }}
  35. {% endif %}
  36. </a>
  37. <div class="pull-right">
  38. <strong><small>#{{ generate_obj_id(conversations, loop.index, flaskbb_config["TOPICS_PER_PAGE"]) }}</small></strong>
  39. </div>
  40. </div>
  41. <!-- meta info (date, user) -->
  42. <div class="conversation-meta">
  43. {% trans %}From{% endtrans %}
  44. {% if conversation.from_user %}
  45. <a href="{{ conversation.from_user.url }}">{{ conversation.from_user.username }}</a>
  46. {% else %}
  47. {% trans %}Deleted User{% endtrans %}
  48. {% endif %}
  49. {% trans %}to{% endtrans %}
  50. {% if conversation.to_user %}
  51. <a href="{{ conversation.to_user.url }}">{{ conversation.to_user.username }}</a>
  52. {% else %}
  53. {% trans %}Deleted User{% endtrans %}
  54. {% endif %}
  55. {% trans %}on{% endtrans %} {{ conversation.last_message.date_created|format_date("%d %B %Y - %H:%M") }}
  56. </div>
  57. <!-- actual content -->
  58. <div class="conversation-content">
  59. {{ conversation.last_message.message|crop_title(150)|markup }}
  60. </div>
  61. <!-- actions -->
  62. <div class="conversation-actions">
  63. {% if include_move %}
  64. <form class="inline-form" method="POST" action="{{ url_for('message.move_conversation', conversation_id=conversation.id) }}">
  65. <input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
  66. <button type="submit" class="btn btn-info btn-xs" title="Move to Trash" data-toggle="tooltip" data-placement="top">
  67. <span class="fa fa-archive"></span>
  68. </button>
  69. </form>
  70. {% endif %}
  71. {% if include_delete %}
  72. <form class="inline-form" method="POST" action="{{ url_for('message.delete_conversation', conversation_id=conversation.id) }}">
  73. <input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
  74. <button type="submit" class="btn btn-danger btn-xs" title="Delete this conversation" data-toggle="tooltip" data-placement="top">
  75. <span class="fa fa-trash"></span>
  76. </button>
  77. </form>
  78. {% endif %}
  79. {% if include_restore %}
  80. <form class="inline-form" method="POST" action="{{ url_for('message.restore_conversation', conversation_id=conversation.id) }}">
  81. <input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
  82. <button type="submit" class="btn btn-success btn-xs" title="Restore this conversation" data-toggle="tooltip" data-placement="top">
  83. <span class="fa fa-undo"></span>
  84. </button>
  85. </form>
  86. {% endif %}
  87. {% if include_edit %}
  88. <a class="btn btn-success btn-xs" alt="Edit" title="Edit this conversation" href="{{ url_for('message.edit_conversation', conversation_id = conversation.id) }}" data-toggle="tooltip" data-placement="top">
  89. <span class="fa fa-pencil"></span>
  90. </a>
  91. {% endif %}
  92. </div>
  93. </div>
  94. </div>
  95. {% else %}
  96. <div class="row conversation-row">
  97. <div class="col-md-12 col-sm-12 col-xs-12">
  98. {% trans %}No conversations found.{% endtrans %}
  99. </div>
  100. </div>
  101. {% endfor %}
  102. </div>
  103. </div>