PageRenderTime 27ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/templates/tiki-view_forum_thread.tpl

https://gitlab.com/ElvisAns/tiki
Smarty Template | 228 lines | 214 code | 12 blank | 2 comment | 3 complexity | 3814c4e13ed124027214b2c6638059a4 MD5 | raw file
  1. {* $Id$ *}
  2. {$forum_info.name}
  3. {block name=title}
  4. {title help="forums" admpage="forums"}
  5. {$forum_info.name}
  6. {if $prefs.feature_forum_topics_archiving eq 'y' && $thread_info.archived eq 'y'}({tr}Archived{/tr}){/if}
  7. {/title}
  8. {/block}
  9. <div class="t_navbar mb-4">
  10. {if $tiki_p_admin_forum eq "y"}
  11. {button href="tiki-admin_forums.php?forumId=$forumId" _type="link" _icon_name="wrench" _text="{tr}Edit Forum{/tr}"}
  12. {/if}
  13. {if $tiki_p_admin_forum eq 'y' or (!isset($all_forums) and $tiki_p_forum_read eq "y") or $all_forums|@count > 1}
  14. {button href="tiki-forums.php" _type="link" _icon_name="list" _text="{tr}Forum List{/tr}"}
  15. {/if}
  16. {if $tiki_p_forum_read eq "y"}
  17. {button href="tiki-view_forum.php?forumId=$forumId" _type="link" _icon_name="list" _text="{tr}Topic List{/tr}"}
  18. {/if}
  19. </div>
  20. {if $post_reported eq 'y'}
  21. {remarksbox type=warning title="{tr}The post has been reported and will be reviewed by a moderator.{/tr}"}{/remarksbox}
  22. {/if}
  23. <br>
  24. <div id="thread-breadcrumb" class="breadcrumb d-flex justify-content-between mb-4">
  25. <div>
  26. <a class="link" href="{if $prefs.feature_sefurl eq 'y'}forums{else}tiki-forums.php{/if}">
  27. {tr}Forums{/tr}
  28. </a>
  29. {$prefs.site_crumb_seper}
  30. <a class="link" href="{$forumId|sefurl:'forum'}">
  31. {$forum_info.name|escape}
  32. </a>{if isset($thread_info.topic.threadId) and $thread_info.topic.threadId}
  33. {$prefs.site_crumb_seper}
  34. <a class="link" href="{$thread_info.topic.threadId|sefurl:'forumthread'}{if $smarty.request.topics_offset}&amp;topics_offset={$smarty.request.topics_offset}{/if}{$topics_sort_mode_param}{$topics_threshold_param}{$topics_find_param}">
  35. {$thread_info.topic.title}
  36. </a>
  37. {/if}
  38. {$prefs.site_crumb_seper}
  39. {$thread_info.title|escape}
  40. <div>
  41. {if empty($thread_info.topic.threadId)}
  42. <span>
  43. {if ($prev_topic and $prev_topic ne $comments_parentId) or $next_topic}{if $prev_topic and $prev_topic ne $comments_parentId}<a href="tiki-view_forum_thread.php?comments_parentId={$prev_topic}&amp;topics_offset={$topics_prev_offset}{$topics_sort_mode_param}{$topics_threshold_param}{$topics_find_param}{$comments_per_page_param}{$thread_style_param}{$thread_sort_mode_param}{$comments_threshold_param}" class="link">{icon name="angle-left"}{tr}Previous topic{/tr}</a>{if $next_topic} | {/if}{/if}
  44. {if $next_topic}<a href="tiki-view_forum_thread.php?comments_parentId={$next_topic}&amp;topics_offset={$topics_next_offset}{$topics_sort_mode_param}{$topics_threshold_param}{$topics_find_param}{$comments_per_page_param}{$thread_style_param}{$thread_sort_mode_param}{$comments_threshold_param}" class="link">{tr}Next topic{/tr} {icon name="angle-right"}</a>{/if}{/if}
  45. </span>
  46. {else}
  47. <span>
  48. {tr}You are viewing a reply to{/tr} <a class="link" href="tiki-view_forum_thread.php?comments_parentId={$thread_info.topic.threadId}{if $smarty.request.topics_offset}&amp;topics_offset={$smarty.request.topics_offset}{/if}{$topics_sort_mode_param}{$topics_threshold_param}{$topics_find_param}">{$thread_info.topic.title}</a>
  49. </span>
  50. {/if}
  51. </div>
  52. </div>
  53. <div class="text-end">
  54. {block name=thread_actions}
  55. &nbsp;
  56. <div class="btn-group">
  57. {if ! $js}<ul class="cssmenu_horiz"><li>{/if}
  58. <a class="btn btn-info btn-sm dropdown-toggle" data-bs-toggle="dropdown" data-hover="dropdown" href="#" title="{tr}Forum actions{/tr}">
  59. {icon name="menu-extra"}
  60. </a>
  61. <div class="dropdown-menu dropdown-menu-right">
  62. <h6 class="dropdown-title">
  63. {tr}Thread actions{/tr}
  64. </h6>
  65. <div class="dropdown-divider"></div>
  66. {if $pdf_export eq 'y'}
  67. <a class="dropdown-item" href="{$smarty.server.SCRIPT_NAME}?{query display='pdf'}">
  68. {icon name="pdf"} {tr}PDF{/tr}
  69. </a>
  70. {/if}
  71. <a class="dropdown-item" href="{$smarty.server.SCRIPT_NAME}?{query display='print'}">
  72. {icon name="print"} {tr}Print this page{/tr}
  73. </a>
  74. </li>
  75. <li class="dropdown-item">
  76. <a href="{$smarty.server.SCRIPT_NAME}?{query display='print_all'}">
  77. {icon name="print"} {tr}Print all pages{/tr}
  78. </a>
  79. {if $prefs.sefurl_short_url eq 'y'}
  80. <a class="dropdown-item" id="short_url_link" href="#" onclick="(function() { $(document.activeElement).attr('href', 'tiki-short_url.php?url=' + encodeURIComponent(window.location.href) + '&title=' + encodeURIComponent(document.title)); })();">
  81. {icon name="link"} {tr}Get a short URL{/tr}
  82. {assign var="hasPageAction" value="1"}
  83. </a>
  84. {/if}
  85. {if $prefs.feature_forum_topics_archiving eq 'y' && $tiki_p_admin_forum eq 'y'}
  86. {if $thread_info.archived eq 'y'}
  87. <a class="dropdown-item" href="{$smarty.server.SCRIPT_NAME}?{query archive="n"}">
  88. {icon name="file-archive-open"} {tr}Unarchive{/tr}
  89. </a>
  90. {else}
  91. <a class="dropdown-item" href="{$smarty.server.SCRIPT_NAME}?{query archive='y'}">
  92. {icon name="file-archive"} {tr}Archive{/tr}
  93. </a>
  94. {/if}
  95. {/if}
  96. {* TODO the tiki_p_forum_lock permission has not been implemented so these actions never show*}
  97. {if isset($tiki_p_forum_lock) and $tiki_p_forum_lock eq 'y'}
  98. {if $thread_info.locked eq 'y'}
  99. <a class="dropdown-item" href="{query _type='relative' lock='n'}">
  100. {icon name="unlock"} {tr}Unlock{/tr}
  101. </a>
  102. {else}
  103. <a class="dropdown-item" href="{query _type='relative' lock='y'}">
  104. {icon name="lock"} {tr}Lock{/tr}
  105. </a>
  106. {/if}
  107. {/if}
  108. </div>
  109. {if ! $js}</li></ul>{/if}
  110. </div>
  111. </div>
  112. </div>
  113. {/block}
  114. {if $openpost eq 'y'}
  115. {assign var="postclass" value="forumpostopen"}
  116. {else}
  117. {assign var="postclass" value="forumpost"}
  118. {/if}
  119. <section class="top_post">
  120. {if $prefs.feature_freetags eq 'y' and $tiki_p_view_freetags eq 'y' and $prefs.freetags_show_middle eq 'y'
  121. and !$thread_info.topic.threadId}
  122. {include file='freetag_list.tpl'}
  123. <div class="text-end mb-4">
  124. {wikiplugin _name="addfreetag" object="forum post:$comments_parentId"}{/wikiplugin}
  125. </div>
  126. {/if}
  127. {include file='comment.tpl' first='y' comment=$thread_info thread_style='commentStyle_plain'}
  128. </section>
  129. {include file='comments.tpl'}
  130. <form role="form" id='time_control' method="get" action="tiki-view_forum_thread.php">
  131. <div class="mb-3 row mx-0">
  132. <input type="hidden" name="comments_offset" value="0"><!--Reset offset to 0 when applying a new filter -->
  133. <input type="hidden" name="comments_threadId" value="{$comments_threadId|escape}">
  134. <input type="hidden" name="comments_parentId" value="{$comments_parentId|escape}">
  135. <input type="hidden" name="comments_threshold" value="{$comments_threshold|escape}" />
  136. <input type="hidden" name="thread_sort_mode" value="{$thread_sort_mode|escape}">
  137. <input type="hidden" name="topics_offset" value="{$smarty.request.topics_offset|escape}">
  138. <input type="hidden" name="topics_find" value="{$smarty.request.topics_find|escape}">
  139. <input type="hidden" name="topics_sort_mode" value="{$smarty.request.topics_sort_mode|escape}">
  140. <input type="hidden" name="topics_threshold" value="{$smarty.request.topics_threshold|escape}">
  141. <input type="hidden" name="forumId" value="{$forumId|escape}">
  142. <label class="col-form-label" for="userfile1">{tr}Show posts:{/tr}</label>
  143. <div class="col-sm-3">
  144. <select class="form-select" name="time_control" onchange="javascript:document.getElementById('time_control').submit();">
  145. <option value="" {if empty($smarty.request.time_control)}selected="selected"{/if}>
  146. {tr}All posts{/tr}
  147. </option>
  148. <option value="3600" {if isset($smarty.request.time_control) and $smarty.request.time_control eq 3600}selected="selected"{/if}>
  149. {tr}Last hour{/tr}
  150. </option>
  151. <option value="86400" {if isset($smarty.request.time_control) and $smarty.request.time_control eq 86400}selected="selected"{/if}>
  152. {tr}Last 24 hours{/tr}
  153. </option>
  154. <option value="172800" {if isset($smarty.request.time_control) and $smarty.request.time_control eq 172800}selected="selected"{/if}>
  155. {tr}Last 48 hours{/tr}
  156. </option>
  157. </select>
  158. </div>
  159. </div>
  160. </form>
  161. <div class="mb-3 float-sm-end">
  162. {if $prefs.feature_forum_quickjump eq 'y' && $all_forums|@count > 1}
  163. <form role="form" id='quick' method="get" action="tiki-view_forum.php">
  164. <label class="col-sm-6 col-form-label" for="forumId">{tr}Jump to forum:{/tr}</label>
  165. <div class="col-sm-6">
  166. <select id="forumId" class="form-control" name="forumId" onchange="javascript:document.getElementById('quick').submit();">
  167. {section name=ix loop=$all_forums}
  168. <option value="{$all_forums[ix].forumId|escape}" {if $all_forums[ix].forumId eq $forumId}selected="selected"{/if}>
  169. {$all_forums[ix].name}
  170. </option>
  171. {/section}
  172. </select>
  173. </div>
  174. </form>
  175. {else}
  176. &nbsp;
  177. {/if}
  178. </div>
  179. {if isset($view_atts) and $view_atts eq 'y'}
  180. <h2 id="attachments">{tr}Attachments{/tr}</h2>
  181. <div class="table-responsive">
  182. <table class="table table-striped table-hover">
  183. <tr>
  184. <th>{tr}Type{/tr}</th>
  185. <th>{tr}Filename{/tr}</th>
  186. <th>{tr}Size{/tr}</th>
  187. <th>{tr}Created{/tr}</th>
  188. <th>{tr}Action{/tr}</th>
  189. </tr>
  190. {foreach from=$atts.data item=att}
  191. <tr>
  192. <td class="icon">
  193. {$att.filename|iconify}
  194. </td>
  195. <td class="text">
  196. <a href="tiki-download_forum_attachment.php?attId={$att.attId}" title="{tr}Download{/tr}">
  197. {$att.filename|escape}
  198. </a>
  199. </td>
  200. <td class="integer">
  201. {$att.filesize|kbsize}
  202. </td>
  203. <td class="date">
  204. {$att.created|tiki_short_datetime}
  205. </td>
  206. <td class="action">
  207. <a href="tiki-download_forum_attachment.php?attId={$att.attId}" class="tips" title="{$att.filename|escape}:{tr}Download{/tr}">
  208. {icon name='floppy'}
  209. </a>
  210. </td>
  211. </tr>
  212. {/foreach}
  213. </table>
  214. </div>
  215. {pagination_links cant=$atts.cant offset=$atts.offset offset_arg='fa_offset' step=$atts.maxRecords _anchor='attachments'}{/pagination_links}
  216. {/if}