userqueue.html 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <title>OwnchatBot</title>
  5. <link rel="icon" type="image/x-icon" href="/static/img/favicon.ico">
  6. <link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
  7. </head>
  8. <div class="navbar">
  9. <div class="tab">
  10. <button tabindex="0" class="tablinks" data-tab="ocbinfo" onclick="setActiveTabAndNavigate('ocbinfo', '{{ url_for('web_panels.user_panel', instance=instance, username=username) }}')">OwnchatBot Info</button>
  11. <button tabindex="1" class="tablinks" data-tab="rewards" onclick="setActiveTabAndNavigate('rewards', '{{ url_for('web_panels.user_panel', instance=instance, username=username) }}')">Points and Rewards</button>
  12. <button tabindex="2" style="background-color: #003399; color: white;" class="tablinks" data-tab="queue" onclick="window.location.href='{{ url_for('web_panels.user_queue', activeTab='queue') }}'">Rewards Queue</button>
  13. </div>
  14. <img alt="Ownchat Bot logo, whimsical robot" src="/static/img/ownchatbotwide.png">
  15. </div>
  16. <div id="queue" class="queuecontent">
  17. <body>
  18. <h3>Queue</h3>
  19. {% if queue %}
  20. <table>
  21. <thead>
  22. <tr>
  23. <th>Time</th>
  24. <th>Name</th>
  25. <th>Description</th>
  26. <th>User</th>
  27. <th></th>
  28. </tr>
  29. </thead>
  30. <tbody>
  31. {% for row in queue %}
  32. <tr>
  33. <td>{{ row[1].replace(tzinfo=utc_timezone).astimezone().strftime("%H:%M") }}</td>
  34. {% if row[4] %}
  35. <td><s>{{ prefix }}{{ row[2] }}</s></td>
  36. {% else %}
  37. <td>{{ prefix }}{{ row[2] }}</td>
  38. {% endif %}
  39. <td>{{ all_rewards[row[2]]["info"] }}</td>
  40. {% if row[6] %}
  41. <td>{{ row[6] }}</td>
  42. {% else %}
  43. <td></td>
  44. {% endif %}
  45. </tr>
  46. {% endfor %}
  47. </tbody>
  48. </table>
  49. {% else %}
  50. &nbsp;&nbsp;The queue is currently empty
  51. {% endif %}
  52. </body>
  53. <br><br>
  54. </div>
  55. <script>
  56. window.onload = function() {
  57. var activeTab = 'queue';
  58. localStorage.setItem('activeTab', activeTab);
  59. }
  60. function setActiveTabAndNavigate(tabName, url) {
  61. localStorage.setItem('activeTab', tabName);
  62. window.location.href = url;
  63. }
  64. function refreshPage() {
  65. window.location.reload();
  66. }
  67. setTimeout(refreshPage, 30 * 1000);
  68. </script>
  69. </html>