all_topics.html 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. {% extends theme('layout.html') %}
  2. {% from theme('macros.html') import render_pagination %}
  3. {% block content %}
  4. <ul class="breadcrumb">
  5. <li><a href="{{ url_for('forum.index') }}">{% trans %}Forum{% endtrans %}</a></li>
  6. <li ><a href="{{ url_for('user.profile', username=user.username) }}">{{ user.username }}</a></li>
  7. <li class="active">{% trans %}All Topics{% endtrans %}</li>
  8. </ul>
  9. <div class="pull-left">
  10. {{ render_pagination(topics, url_for('user.view_all_topics', username=user.username)) }}
  11. </div> <!-- end span pagination -->
  12. <table class="table table-bordered">
  13. <thead>
  14. <tr>
  15. <th colspan="5">
  16. {% trans %}All Topics created by{% endtrans %} {{ user.username }}
  17. </th>
  18. </tr>
  19. </thead>
  20. <tbody>
  21. <tr>
  22. <td colspan="2">{% trans %}Topic{% endtrans %}</td>
  23. <td>{% trans %}Posts{% endtrans %}</td>
  24. <td>{% trans %}Views{% endtrans %}</td>
  25. <td>{% trans %}Last Post{% endtrans %}</td>
  26. </tr>
  27. {% for topic in topics.items %}
  28. <tr>
  29. <td width="4%"></td>
  30. <td>
  31. <div>
  32. <a href="{{ topic.url }}">{{ topic.title }}</a> <br />
  33. <small>
  34. {% trans %}by{% endtrans %}
  35. {% if topic.user_id %}
  36. <a href="{{ topic.user.url }}">{{ topic.user.username }}</a>
  37. {% else %}
  38. {{ topic.username }}
  39. {% endif %}
  40. </small>
  41. </div>
  42. </td>
  43. <td>
  44. {{ topic.post_count }}
  45. </td>
  46. <td>
  47. {{ topic.views }}
  48. </td>
  49. <td>
  50. <a href="{{ topic.last_post.url }}">{{ topic.last_post.date_created|time_since }}</a><br />
  51. <small>
  52. {% trans %}by{% endtrans %}
  53. {% if topic.last_post.user_id %}
  54. <a href="{{ topic.last_post.user.url }}">{{ topic.last_post.user.username }}</a>
  55. {% else %}
  56. {{ topic.last_post.username }}
  57. {% endif %}
  58. </small>
  59. </td>
  60. </tr>
  61. {% else %}
  62. <tr>
  63. <td colspan="5">
  64. No Topics so far.
  65. </td>
  66. </tr>
  67. {% endfor %}
  68. </tbody>
  69. </table>
  70. {% endblock %}