index.html 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. {% extends "layout.html" %}
  2. {% block content %}
  3. <ol class="breadcrumb">
  4. <li><a href="{{ url_for('forum.index') }}">Forum</a></li>
  5. </ol>
  6. {% for category, forums in categories.items() %}
  7. <table class="table table-bordered">
  8. <thead class="categoryhead">
  9. <tr>
  10. <td colspan="5">
  11. <div><strong><a href="{{ url_for('forum.view_forum', forum_id=category[0].id) }}">{{ category[0].title }}</a></strong></div>
  12. </td>
  13. </tr>
  14. </thead>
  15. <tbody class="forumbody">
  16. <tr class="forum_stats">
  17. <td colspan="2"><strong>Forum</strong></td>
  18. <td width="85" align="center" style="white-space: nowrap"><strong>Topics</strong></td>
  19. <td width="85" align="center" style="white-space: nowrap"><strong>Posts</strong></td>
  20. <td width="200" align="center" style="white-space: nowrap"><strong>Last Post</strong></td>
  21. </tr>
  22. {% for forum, subforums in forums.items() %}
  23. <tr>
  24. <td align="center" valign="center" width="4%">
  25. {% if forum[0]|forum_is_unread(forum[1], current_user) %}
  26. <span class="fa fa-comments" style="font-size: 2em"></span>
  27. {% else %}
  28. <span class="fa fa-comments-o" style="font-size: 2em"></span>
  29. {% endif %}
  30. </td>
  31. <td valign="top">
  32. <strong><a href="{{ url_for('forum.view_forum', forum_id=forum[0].id) }}">{{ forum[0].title }}</a></strong>
  33. <div class="forum-description">
  34. {% autoescape false %}
  35. {{ forum[0].description|markup }}
  36. {% endautoescape %}
  37. </div>
  38. {% if subforums|length %}
  39. <div class="forum-subforums">
  40. <ul class="list-inline">
  41. <li><strong>Subforums:</strong></li>
  42. {% for subforum in subforums %}
  43. <li>
  44. <a href="{{ url_for('forum.view_forum', forum_id=subforum[0].id) }}">{{ subforum[0].title }}</a>
  45. </li>
  46. {% endfor %}
  47. </ul>
  48. </div>
  49. {% endif %}
  50. </td>
  51. <td valign="top" align="center" style="white-space: nowrap">{{ forum[0].topic_count }}</td>
  52. <td valign="top" align="center" style="white-space: nowrap">{{ forum[0].post_count }}</td>
  53. <td valign="top" align="right" style="white-space: nowrap">
  54. {% if forum[0].last_post_id %}
  55. <a href="{{ url_for('forum.view_post', post_id=forum[0].last_post_id) }}" title="{{ forum[0].last_post.topic.title }}">
  56. <strong>{{ forum[0].last_post.topic.title|crop_title }}</strong>
  57. </a>
  58. <br />
  59. {{ forum[0].last_post.date_created|time_since }}<br />
  60. by <a href="{{ url_for('user.profile', username=forum[0].last_post.user.username) }}">{{ forum[0].last_post.user.username }}</a>
  61. {% else %}
  62. No posts
  63. {% endif %}
  64. </td>
  65. </tr>
  66. {% endfor %}
  67. </tbody>
  68. </table>
  69. {% endfor %}
  70. <!-- Forum Stats -->
  71. <table class="table table-bordered">
  72. <thead>
  73. <tr>
  74. <td colspan="2">
  75. <strong>Board Statistics</strong>
  76. [<a href="{{ url_for('forum.who_is_online') }}" onclick="window.open(this.href, 'wio_window','width=500,height=500'); return false;">Who is online?</a>]
  77. </td>
  78. </tr>
  79. </thead>
  80. <tbody>
  81. <tr>
  82. <td>
  83. Total number of registered users: <strong>{{ user_count }}</strong> <br />
  84. Total number of topics: <strong>{{ topic_count }}</strong> <br />
  85. Total number of posts: <strong>{{ post_count }}</strong> <br />
  86. </td>
  87. <td>
  88. Newest registered user: {% if newest_user %}<a href="{{ url_for('user.profile', username=newest_user.username) }}">{{ newest_user.username }}</a>{% else %}No users{% endif %}<br />
  89. Registered users online: <strong>{{ online_users }}</strong> <br />
  90. {% if config["REDIS_ENABLED"] %}
  91. Guests online: <strong>{{ online_guests }}</strong> <br />
  92. {% endif %}
  93. </td>
  94. </tr>
  95. </tbody>
  96. </table>
  97. {% endblock %}