conversation_list.html 4.9 KB

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