post.tpl 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. {% macro comment_template(item) %}
  2. <div class="media {{ item.iid }}">
  3. <div class="media-left">
  4. <a href="{{ item.user_info.profile_url }}">
  5. <img class="media-object thumbnail avatar"
  6. src="{{ item.user_info.avatar }}"
  7. alt="{{ item.user_info.complete_name }}">
  8. </a>
  9. </div>
  10. <div class="media-body">
  11. <div class="pull-right">
  12. {{ item.actions }}
  13. </div>
  14. <h4 class="media-heading"
  15. id="comment-{{ item.iid }}-title">{{ item.title }}</h4>
  16. <ul class="info-post list-inline">
  17. <li class="date">
  18. <i class="fa fa-clock-o"></i> {{ item.comment_date }}
  19. </li>
  20. <li class="autor">
  21. <i class="fa fa-user"></i>
  22. <a href="{{ item.user_info.profile_url }}">
  23. {{ item.user_info.complete_name }}
  24. </a>
  25. </li>
  26. <li class="score">
  27. <i class="fa fa-star"
  28. aria-hidden="true"></i> {{ item.score_ranking }}
  29. </li>
  30. </ul>
  31. <div id="comment-{{ item.iid }}-content">
  32. {{ item.content }}
  33. </div>
  34. {% if item.files %}
  35. <aside class="well well-sm files">
  36. <i class="fa fa-paperclip" aria-hidden="true"></i>
  37. <a href="download.php?file={{ item.files.path }}">{{ item.files.filename }}</a>
  38. <p>{{ item.files.comment }}</p>
  39. </aside>
  40. {% endif %}
  41. <div class="ranking">
  42. {{ item.form_ranking }}
  43. </div>
  44. {% import _self as nested %}
  45. {% for item2 in item.comments %}
  46. {{ nested.comment_template(item2) }}
  47. {% endfor %}
  48. </div>
  49. </div>
  50. {% endmacro %}
  51. {% import _self as nested %}
  52. <div class="row">
  53. <div class="col-md-3">
  54. <div class="sidebar">
  55. <div id="calendar-blog" class="panel panel-default">
  56. <div class="panel-heading">
  57. {{ 'Calendar'|get_lang }}
  58. </div>
  59. <div class="panel-body">
  60. {{ calendar }}
  61. </div>
  62. </div>
  63. <div id="search-blog" class="panel panel-default">
  64. <div class="panel-heading">
  65. {{ 'Search'|get_lang }}
  66. </div>
  67. <div class="panel-body">
  68. <form action="blog.php" method="get" enctype="multipart/form-data">
  69. <div class="form-group">
  70. <input type="hidden" name="blog_id" value="{{ id_blog }}"/>
  71. <input type="hidden" name="action" value="view_search_result"/>
  72. <input type="text" class="form-control" size="20" name="q" value="{{ search }}"/>
  73. </div>
  74. <button class="btn btn-default btn-block" type="submit">
  75. <em class="fa fa-search"></em> {{ 'Search'|get_lang }}
  76. </button>
  77. </form>
  78. </div>
  79. </div>
  80. <div id="task-blog" class="panel panel-default">
  81. <div class="panel-heading">
  82. {{ 'MyTasks'|get_lang }}
  83. </div>
  84. <div class="panel-body">
  85. {{ task }}
  86. </div>
  87. </div>
  88. </div>
  89. </div>
  90. <div class="col-md-9">
  91. <div class="blog" id="post-{{ post.id_post }}">
  92. <div class="panel panel-default" id="blog-header">
  93. <div class="panel-heading">
  94. <div id="post-action" class="text-right">
  95. <div class="btn-group btn-group-sm" role="group" aria-label="{{ 'Actions'|get_lang }}">
  96. {{ post.actions }}
  97. </div>
  98. </div>
  99. </div>
  100. <div class="panel-body">
  101. <article>
  102. <div class="article-header">
  103. <div class="title">
  104. <h1 title="{{ post.title }}">{{ post.title }}</h1>
  105. </div>
  106. <ul class="info-post list-inline">
  107. <li class="date">
  108. <i class="fa fa-clock-o" aria-hidden="true"></i> {{ post.post_date }}
  109. </li>
  110. <li class="comments">
  111. <i class="fa fa-comment-o"
  112. aria-hidden="true"></i> {{ 'XComments'|get_lang|format(post.n_comments) }}
  113. </li>
  114. <li class="autor">
  115. <i class="fa fa-user" aria-hidden="true"></i>
  116. <a href="{{ _p.web }}main/social/profile.php?u={{ post.id_author }}">{{ post.author }}</a>
  117. </li>
  118. <li class="score">
  119. <i class="fa fa-star" aria-hidden="true"></i> {{ post.score_ranking }}
  120. </li>
  121. </ul>
  122. </div>
  123. <div class="content-post">
  124. {{ post.content }}
  125. </div>
  126. {% if post.files %}
  127. <aside class="well well-sm files">
  128. <i class="fa fa-paperclip" aria-hidden="true"></i>
  129. <a href="download.php?file={{ post.files.path }}">{{ post.files.filename }}</a>
  130. </aside>
  131. {% endif %}
  132. {{ post.frm_rating ?: '' }}
  133. </article>
  134. <div class="comments-post">
  135. <h3 class="title">{{ 'XComments'|get_lang|format(post.n_comments) }}</h3>
  136. <div id="list-comments" class="media-list">
  137. {% for item in post.comments %}
  138. {{ nested.comment_template(item) }}
  139. {% endfor %}
  140. </div>
  141. </div>
  142. <div class="form-post">
  143. {{ post.form_html }}
  144. </div>
  145. </div>
  146. </div>
  147. </div>
  148. </div>
  149. </div>
  150. <script>
  151. $(document).on('ready', function () {
  152. $('.btn-reply-to').on('click', function (e) {
  153. e.preventDefault();
  154. var id = $(this).data('id') || 0;
  155. if (!id) {
  156. return;
  157. }
  158. var $frm = $('form#add_post'),
  159. title = $('#comment-' + id + '-title'),
  160. content = $('#comment-' + id + '-content');
  161. $frm.find('[name="comment_parent_id"]').val(id);
  162. $frm.find('[name="title"]').val('Re: ' + title.text().trim());
  163. CKEDITOR.instances.comment.setData('<blockquote>' + content.text().trim() + '</blockquote><br>');
  164. });
  165. });
  166. </script>