blog.tpl 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. <div class="row">
  2. <div class="col-md-3">
  3. <div class="sidebar">
  4. <div id="calendar-blog" class="panel panel-default">
  5. <div class="panel-heading">
  6. {{ 'Calendar'|get_lang }}
  7. </div>
  8. <div class="panel-body">
  9. {{ calendar }}
  10. </div>
  11. </div>
  12. <div id="search-blog" class="panel panel-default">
  13. <div class="panel-heading">
  14. {{ 'Search'|get_lang }}
  15. </div>
  16. <div class="panel-body">
  17. <form action="blog.php" method="get" enctype="multipart/form-data">
  18. <div class="form-group">
  19. <input type="hidden" name="blog_id" value="{{ id_blog }}"/>
  20. <input type="hidden" name="action" value="view_search_result"/>
  21. <input type="text" class="form-control" size="20" name="q" value="{{ search }}"/>
  22. </div>
  23. <button class="btn btn-default btn-block" type="submit">
  24. <em class="fa fa-search"></em> {{ 'Search'|get_lang }}
  25. </button>
  26. </form>
  27. </div>
  28. </div>
  29. <div id="task-blog" class="panel panel-default">
  30. <div class="panel-heading">
  31. {{ 'MyTasks'|get_lang }}
  32. </div>
  33. <div class="panel-body">
  34. {{ task }}
  35. </div>
  36. </div>
  37. </div>
  38. </div>
  39. <div class="col-md-9">
  40. <div class="blog">
  41. <div id="blog-header">
  42. {% if not search %}
  43. <div class="title">
  44. <h1>{{ title }}</h1>
  45. </div>
  46. <div class="description">
  47. {{ description }}
  48. </div>
  49. {% else %}
  50. <div class="title">
  51. <h1>{{ search }}</h1>
  52. </div>
  53. {% endif %}
  54. </div>
  55. <div id="list-articles">
  56. {% for item in articles %}
  57. <article id="post-{{ item.id_post }}" class="article-post">
  58. <div class="panel panel-default">
  59. <div class="panel-body">
  60. <h3 class="title-post">
  61. <a href="{{ _p.web_self ~ '?' ~ _p.web_cid_query ~ '&' ~ {'action':'view_post', 'blog_id':item.id_blog, 'post_id':item.id_post}|url_encode }}#add_comment"
  62. title="{{ item.title }}">{{ item.title }}</a>
  63. </h3>
  64. <div class="info-post">
  65. <span class="date"><i class="fa fa-clock-o"></i> {{ item.post_date }}</span>
  66. <span class='comments'>
  67. <i class="fa fa-comment-o"></i> {{ item.n_comments }} {{ 'Comments' | get_lang }}
  68. </span>
  69. <span class="autor"><i class="fa fa-user"></i> {{ item.autor }}</span>
  70. <span class="score"><i class="fa fa-star"></i> {{ item.score_ranking }}</span>
  71. </div>
  72. {% if item.extract %}
  73. <div id="post-extract-{{ item.id_post }}" class="show">
  74. <p>
  75. {{ item.extract }}
  76. <button type="button" class="btn btn-link btn-read-more" data-id="{{ item.id_post }}">
  77. {{ 'ReadMore'|get_lang }}
  78. </button>
  79. </p>
  80. </div>
  81. {% endif %}
  82. <div id="post-content-{{ item.id_post }}" class="{{ item.extract ? 'hidden' : '' }}">
  83. {{ item.content }}
  84. </div>
  85. {% if item.files %}
  86. <div class="well well-sm files">
  87. <i class="fa fa-paperclip" aria-hidden="true"></i>
  88. <a href="download.php?file={{ item.files.path }}">{{ item.files.filename }}</a>
  89. </div>
  90. {% endif %}
  91. </div>
  92. </div>
  93. </article>
  94. {% endfor %}
  95. </div>
  96. </div>
  97. </div>
  98. </div>
  99. <script>
  100. $(function () {
  101. $('.btn-read-more').on('click', function (e) {
  102. e.preventDefault();
  103. var postId = $(this).data('id') || 0;
  104. if (!postId) {
  105. return;
  106. }
  107. $('#post-extract-' + postId).removeClass('show').addClass('hidden');
  108. $('#post-content-' + postId).removeClass('hidden').addClass('show');
  109. });
  110. });
  111. </script>