index.html 3.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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 in categories.iteritems() %}
  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_category', category_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 in category[1] %}
  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. </td>
  39. <td valign="top" align="center" style="white-space: nowrap">{{ forum[0].topic_count }}</td>
  40. <td valign="top" align="center" style="white-space: nowrap">{{ forum[0].post_count }}</td>
  41. <td valign="top" align="right" style="white-space: nowrap">
  42. {% if forum[0].last_post_id %}
  43. <a href="{{ url_for('forum.view_post', post_id=forum[0].last_post_id) }}" title="{{ forum[0].last_post.topic.title }}">
  44. <strong>{{ forum[0].last_post.topic.title|crop_title }}</strong>
  45. </a>
  46. <br />
  47. {{ forum[0].last_post.date_created|time_since }}<br />
  48. by <a href="{{ url_for('user.profile', username=forum[0].last_post.user.username) }}">{{ forum[0].last_post.user.username }}</a>
  49. {% else %}
  50. No posts
  51. {% endif %}
  52. </td>
  53. </tr>
  54. {% endfor %}
  55. </tbody>
  56. </table>
  57. {% endfor %}
  58. <!-- Forum Stats -->
  59. <table class="table table-bordered">
  60. <thead>
  61. <tr>
  62. <td colspan="2">
  63. <strong>Board Statistics</strong>
  64. [<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>]
  65. </td>
  66. </tr>
  67. </thead>
  68. <tbody>
  69. <tr>
  70. <td>
  71. Total number of registered users: <strong>{{ user_count }}</strong> <br />
  72. Total number of topics: <strong>{{ topic_count }}</strong> <br />
  73. Total number of posts: <strong>{{ post_count }}</strong> <br />
  74. </td>
  75. <td>
  76. 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 />
  77. Registered users online: <strong>{{ online_users }}</strong> <br />
  78. {% if config["REDIS_ENABLED"] %}
  79. Guests online: <strong>{{ online_guests }}</strong> <br />
  80. {% endif %}
  81. </td>
  82. </tr>
  83. </tbody>
  84. </table>
  85. {% endblock %}