header.html 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. <script type='text/x-handlebars' data-template-name='list/topic-list-item.raw'>
  2. {{#if bulkSelectEnabled}}
  3. <td class='star'>
  4. <input type='checkbox' class='bulk-select'>
  5. </td>
  6. {{/if}}
  7. <td class='main-link clearfix'>
  8. {{raw "topic-status" topic=topic}}
  9. {{topic-link topic}}
  10. {{#if controller.showTopicPostBadges}}
  11. {{raw "topic-post-badges" unread=topic.unread newPosts=topic.displayNewPosts unseen=topic.unseen url=topic.lastUnreadUrl}}
  12. {{/if}}
  13. {{discourse-tags topic mode="list"}}
  14. {{raw "list/topic-excerpt" topic=model}}
  15. <div class='creator'>
  16. {{#if showCategory}}
  17. {{category-link topic.category}}
  18. {{/if}}
  19. {{~#if topic.creator ~}}
  20. <a href="/users/{{topic.creator.username}}" data-auto-route="true" data-user-card="{{topic.creator.username}}">{{topic.creator.username}}</a> <a href={{topic.url}}>{{format-date topic.createdAt format="tiny"}}</a>
  21. {{~/if ~}}
  22. {{raw "list/action-list" topic=topic postNumbers=topic.liked_post_numbers className="likes" icon="heart"}}
  23. </div>
  24. </td>
  25. {{#if controller.showLikes}}
  26. <td class="num likes">
  27. {{number topic.like_count}} <i class='fa fa-heart'></i>
  28. </td>
  29. {{/if}}
  30. {{#if controller.showOpLikes}}
  31. <td class="num likes">
  32. {{number topic.op_like_count}} <i class='fa fa-heart'></i>
  33. </td>
  34. {{/if}}
  35. {{raw "list/posts-count-column" topic=topic}}
  36. <td class="last-post">
  37. <div class='poster-avatar'>
  38. <a href="{{topic.lastPostUrl}}" data-user-card="{{topic.last_poster_username}}">{{avatar topic.lastPosterUser imageSize="medium"}}</a>
  39. </div>
  40. <div class='poster-info'>
  41. <a href="{{topic.lastPostUrl}}">
  42. {{format-date topic.bumpedAt format="tiny"}}
  43. </a>
  44. <span class='editor'><a href="/users/{{topic.last_poster_username}}" data-auto-route="true" data-user-card="{{topic.last_poster_username}}">{{topic.last_poster_username}}</a></span>
  45. </div>
  46. </td>
  47. </script>
  48. <script type='text/x-handlebars' data-template-name='topic-list-header.raw'>
  49. {{#if bulkSelectEnabled}}
  50. <th class='star'>
  51. {{#if canBulkSelect}}
  52. <button class='btn bulk-select' title='{{i18n "topics.bulk.toggle"}}'><i class='fa fa-list'></i></button>
  53. {{/if}}
  54. </th>
  55. {{/if}}
  56. {{raw "topic-list-header-column" order='default' name='topic.title' bulkSelectEnabled=bulkSelectEnabled showBulkToggle=toggleInTitle canBulkSelect=canBulkSelect}}
  57. {{#if showLikes}}
  58. {{raw "topic-list-header-column" sortable='true' order='likes' number='true' forceName=(theme-i18n 'likes')}}
  59. {{/if}}
  60. {{#if showOpLikes}}
  61. {{raw "topic-list-header-column" sortable='true' order='op_likes' number='true' forceName=(theme-i18n 'likes')}}
  62. {{/if}}
  63. {{raw "topic-list-header-column" sortable='true' number='true' order='posts' forceName=(theme-i18n 'replies') }}
  64. {{raw "topic-list-header-column" sortable='true' order='activity' forceName=(theme-i18n 'last_post')}}
  65. </script>
  66. <script>
  67. (function(){
  68. var TopicListItemView = require('discourse/components/topic-list-item').default;
  69. TopicListItemView.reopen({
  70. showCategory: function(){
  71. return !this.get('controller.hideCategory') &&
  72. this.get('topic.creator') &&
  73. this.get('topic.category.name') !== 'uncategorized';
  74. }.property()
  75. });
  76. })();
  77. </script>