forums.html 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. {% extends "admin/layout.html" %}
  2. {% load i18n %}
  3. {% load humanize %}
  4. {% load url from future %}
  5. {% from "admin/macros.html" import page_title %}
  6. {% from "admin/overview/plot.html" import draw_plot_tooltips, draw_plot with context %}
  7. {% block title %}{{ page_title(title=_('Forums Overview')) }}{% endblock %}
  8. {% block content %}
  9. <div class="page-header">
  10. <h1>{% trans %}Forums Overview{% endtrans %} <small></small></h1>
  11. </div>
  12. <div class="row">
  13. <div class="span6">
  14. <h2 style="text-align: center;">{{ posts|intcomma }}
  15. <small>{% trans %}Posts{% endtrans %}</small></h2>
  16. </div>
  17. <div class="span6">
  18. <h2 style="text-align: center;">{{ threads|intcomma }}
  19. <small>{% trans %}Threads{% endtrans %}</small></h2>
  20. </div>
  21. </div>
  22. <hr>
  23. <h2>New Posts</h2>
  24. <div class="graph">
  25. <canvas id="graph-posts" height="150px"></canvas>
  26. {{ draw_plot_tooltips('graph-posts', graph_posts) }}
  27. <div class="timeline">
  28. <div class="pull-left">{{ graph_posts.start|date }}</div>
  29. <div class="pull-right">{{ graph_posts.end|date(graph_posts.format) }}</div>
  30. </div>
  31. </div>
  32. <p class="sub-graph pull-right">{% trans count=graph_posts.total|int, total=graph_posts.total|intcomma -%}One new post found in period requested
  33. {%- pluralize -%}
  34. {{ total }} new posts found in period requested
  35. {%- endtrans %}</p>
  36. <ul class="nav nav-pills sub-graph">
  37. <li{% if mode == "day" %} class="active"{% endif %}><a href="{% url 'admin_forums_overview' %}">{% trans %}Last 24h{% endtrans %}</a></li>
  38. <li{% if mode == "week" %} class="active"{% endif %}><a href="{% url 'admin_forums_overview_week' %}">{% trans %}Last Week{% endtrans %}</a></li>
  39. <li{% if mode == "month" %} class="active"{% endif %}><a href="{% url 'admin_forums_overview_month' %}">{% trans %}Last Month{% endtrans %}</a></li>
  40. <li{% if mode == "year" %} class="active"{% endif %}><a href="{% url 'admin_forums_overview_year' %}">{% trans %}Last Year{% endtrans %}</a></li>
  41. </ul>
  42. <hr>
  43. <h2>New Threads</h2>
  44. <div class="graph">
  45. <canvas id="graph-threads" height="150px"></canvas>
  46. {{ draw_plot_tooltips('graph-threads', graph_threads) }}
  47. <div class="timeline">
  48. <div class="pull-left">{{ graph_threads.start|date }}</div>
  49. <div class="pull-right">{{ graph_threads.end|date(graph_threads.format) }}</div>
  50. </div>
  51. </div>
  52. <p class="sub-graph pull-right">{% trans count=graph_threads.total|int, total=graph_threads.total|intcomma -%}One new thread found in period requested
  53. {%- pluralize -%}
  54. {{ total }} new threads found in period requested
  55. {%- endtrans %}</p>
  56. <ul class="nav nav-pills sub-graph">
  57. <li{% if mode == "day" %} class="active"{% endif %}><a href="{% url 'admin_forums_overview' %}">{% trans %}Last 24h{% endtrans %}</a></li>
  58. <li{% if mode == "week" %} class="active"{% endif %}><a href="{% url 'admin_forums_overview_week' %}">{% trans %}Last Week{% endtrans %}</a></li>
  59. <li{% if mode == "month" %} class="active"{% endif %}><a href="{% url 'admin_forums_overview_month' %}">{% trans %}Last Month{% endtrans %}</a></li>
  60. <li{% if mode == "year" %} class="active"{% endif %}><a href="{% url 'admin_forums_overview_year' %}">{% trans %}Last Year{% endtrans %}</a></li>
  61. </ul>
  62. {% endblock %}
  63. {% block javascripts %}
  64. <script type="text/javascript">
  65. {{ draw_plot('draw_posts', 'graph-posts', graph_posts.max, graph_posts.stat) }}
  66. {{ draw_plot('draw_threads', 'graph-threads', graph_threads.max, graph_threads.stat) }}
  67. </script>
  68. {% endblock %}