viewer.html 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. {% from "util.html" import render_message %}
  4. <head>
  5. <meta charset="UTF-8">
  6. <title>Slack Export - #{{ name }}</title>
  7. {% if not no_external_references %}
  8. <link rel=stylesheet type=text/css
  9. href="{{ url_for('static', filename='viewer.css') }}">
  10. {% endif %}
  11. </head>
  12. <body>
  13. <div id="slack-archive-viewer">
  14. {% if not no_sidebar %}
  15. <div id="sidebar">
  16. <h3 id="channel-title">Public Channels</h3>
  17. <ul class="list" id="channel-list">
  18. {% for channel in channels %}
  19. <li class="channel{% if channel == name %} active{% endif %}">
  20. <a href="{{ url_for('channel_name', name=channel) }}">
  21. # {{ channel }}
  22. </a>
  23. </li>
  24. {% endfor %}
  25. </ul>
  26. <h3 id="group-title">Private Channels</h3>
  27. <ul class="list" id="group-list">
  28. {% for group in groups %}
  29. <li class="group{% if group == name %} active{% endif %}">
  30. <a href="{{ url_for('group_name', name=group) }}">
  31. &#128274; {{ group }}
  32. </a>
  33. </li>
  34. {% endfor %}
  35. </ul>
  36. <h3 id="dm-title">Direct Messages</h3>
  37. <ul class="list" id="dms-list">
  38. {% for dm in dm_users %}
  39. <li class="dm{% if dm['id'] == id %} active{% endif %}">
  40. <a href="{{ url_for('dm_id', id=dm['id']) }}">
  41. &#128100; {{ dm["users"][0].real_name if dm["users"][0].real_name else dm["users"][0].name }}
  42. {% if dm["users"][1] %}, {{ dm["users"][1].real_name if dm["users"][1].real_name else dm["users"][1].name }}{% endif %}
  43. </a>
  44. </li>
  45. {% endfor %}
  46. </ul>
  47. <h3 id="mpim-title">Group Direct Messages</h3>
  48. <ul class="list" id="mpims-list">
  49. {% for mpim in mpim_users %}
  50. <li class="mpim{% if mpim['name'] == name %} active{% endif %}">
  51. <a href="{{ url_for('mpim_name', name=mpim['name']) }}">
  52. &#128101;
  53. {% for user in mpim["users"] %}
  54. {{ user.real_name if user.real_name else user.name }},
  55. {% endfor %}
  56. </a>
  57. </li>
  58. {% endfor %}
  59. </ul>
  60. </div>
  61. {% endif %}
  62. <div class="messages">
  63. {% for message in messages %}
  64. {{render_message(message, None, no_external_references)}}
  65. {% endfor %}
  66. </div>
  67. </div>
  68. <script>
  69. (function() {
  70. var sidebar = document.querySelector('#sidebar');
  71. var selected = document.querySelector('.active');
  72. sidebar.scrollTop = selected.offsetTop - 200;
  73. // make dropdown from channel title
  74. var channel_title = document.querySelector("#channel-title");
  75. var channel_dropdown = document.querySelector("#channel-list");
  76. channel_title.addEventListener('click', function() {
  77. channel_title.classList.toggle('arrow');
  78. channel_dropdown.classList.toggle('close');
  79. });
  80. // make dropdown from group title
  81. var group_title = document.querySelector("#group-title");
  82. var group_dropdown = document.querySelector("#group-list");
  83. group_title.addEventListener('click', function() {
  84. group_title.classList.toggle('arrow');
  85. group_dropdown.classList.toggle('close');
  86. });
  87. // make dropdown from dm title
  88. var dm_title = document.querySelector("#dm-title");
  89. var dm_dropdown = document.querySelector("#dms-list");
  90. dm_title.addEventListener('click', function() {
  91. dm_title.classList.toggle('arrow');
  92. dm_dropdown.classList.toggle('close');
  93. });
  94. // make dromdown from group dm title
  95. var mpim_title = document.querySelector("#mpim-title");
  96. var mpim_dropdown = document.querySelector("#mpims-list");
  97. mpim_title.addEventListener('click', function() {
  98. mpim_title.classList.toggle('arrow');
  99. mpim_dropdown.classList.toggle('close');
  100. });
  101. })()
  102. </script>
  103. </body>
  104. </html>