<xen:require css="discussion_list.css" />
<xen:require js="js/xenforo/discussion_list.js" />
<form action="{xen:link inline-mod/thread/switch}" method="post"
class="DiscussionList InlineModForm"
data-cookieName="threads"
data-controls="#InlineModControls"
data-imodOptions="#ModerationSelect option">
<xen:if hascontent="true">
<div class="discussionListFilters secondaryContent">
<h3 class="filtersHeading">{xen:phrase filters}:</h3>
<dl class="pairsInline filterPairs">
<xen:contentcheck>
<xen:if is="{$displayConditions.prefix_id}">
<dt>{xen:phrase prefix}:</dt>
<dd><a href="{xen:link forums, $forum, '_params={$pageNavParams}', 'prefix_id='}" class="removeFilter Tooltip" title="{xen:phrase remove_filter}">{xen:helper threadPrefix, $displayConditions.prefix_id, escaped, ''} <span class="gadget">x</span></a></dd>
</xen:if>
</xen:contentcheck>
</dl>
<dl class="pairsInline removeAll">
<dt>{xen:phrase remove_all_filters}:</dt>
<dd><a href="{xen:link forums, $forum, 'order={$pageNavParams.order}', 'direction={$pageNavParams.direction}'}" class="removeAllFilters Tooltip" title="{xen:phrase remove_all_filters}">x</a></dd>
</dl>
</div>
</xen:if>
<dl class="sectionHeaders">
<dt class="posterAvatar"><a><span>{xen:phrase sort_by}:</span></a></dt>
<dd class="main">
<a href="{xen:link forums, $forum, '_params={$orderParams.title}'}" class="title"><span>{xen:phrase title}{xen:helper sortArrow, $order, $orderDirection, title}</span></a>
<a href="{xen:link forums, $forum, '_params={$orderParams.post_date}'}" class="postDate"><span>{xen:phrase start_date}{xen:helper sortArrow, $order, $orderDirection, post_date}</span></a>
</dd>
<dd class="stats">
<a href="{xen:link forums, $forum, '_params={$orderParams.reply_count}'}" class="major"><span>{xen:phrase replies}{xen:helper sortArrow, $order, $orderDirection, reply_count}</span></a>
<a href="{xen:link forums, $forum, '_params={$orderParams.view_count}'}" class="minor"><span>{xen:phrase views}{xen:helper sortArrow, $order, $orderDirection, view_count}</span></a>
</dd>
<dd class="lastPost"><a href="{xen:link forums, $forum, '_params={$orderParams.last_post_date}'}"><span>{xen:phrase last_message}{xen:helper sortArrow, $order, $orderDirection, last_post_date}</span></a></dd>
</dl>
<ol class="discussionListItems">
<xen:if is="{$stickyThreads} OR {$threads}">
<xen:set var="$showLastPageNumbers">1</xen:set>
<xen:set var="$linkPrefix">1</xen:set>
<xen:hook name="thread_list_stickies">
<xen:foreach loop="$stickyThreads" value="$thread">
<xen:include template="thread_list_item" />
</xen:foreach>
</xen:hook>
<xen:include template="ad_thread_list_below_stickies" />
<xen:hook name="thread_list_threads">
<xen:foreach loop="$threads" value="$thread">
<xen:include template="thread_list_item" />
</xen:foreach>
</xen:hook>
<xen:edithint template="thread_list_item_edit" />
<xen:else />
<li class="primaryContent">{xen:phrase there_no_threads_to_display}</li>
</xen:if>
</ol>
<xen:if is="{$totalThreads} OR {$inlineModOptions}">
<div class="sectionFooter InlineMod SelectionCountContainer">
<xen:if is="{$totalThreads}"><span class="contentSummary">{xen:phrase showing_threads_x_to_y_of_z, 'start={xen:number $threadStartOffset}', 'end={xen:number $threadEndOffset}', 'total={xen:number $totalThreads}'}</span></xen:if>
<xen:if is="{$inlineModOptions}">
<xen:include template="inline_mod_controls_thread" />
</xen:if>
</div>
</xen:if>
<input type="hidden" name="_xfToken" value="{$visitor.csrf_token_page}" />
</form>
<h3 id="DiscussionListOptionsHandle" class="JsOnly"><a href="#">{xen:phrase thread_display_options}</a></h3>
<form action="{xen:link 'forums', $forum}" method="post" class="DiscussionListOptions secondaryContent">
<xen:hook name="thread_list_options">
<div class="controlGroup">
<label for="ctrl_order">{xen:phrase sort_threads_by}:</label>
<select name="order" id="ctrl_order" class="textCtrl">
<option value="last_post_date" {xen:selected "{$order} == 'last_post_date'"}>{xen:phrase last_message_time}</option>
<option value="post_date" {xen:selected "{$order} == 'post_date'"}>{xen:phrase thread_creation_time}</option>
<option value="title" {xen:selected "{$order} == 'title'"}>{xen:phrase title_alphabetical}</option>
<option value="reply_count" {xen:selected "{$order} == 'reply_count'"}>{xen:phrase number_of_replies}</option>
<option value="view_count" {xen:selected "{$order} == 'view_count'"}>{xen:phrase number_of_views}</option>
<option value="first_post_likes" {xen:selected "{$order} == 'first_post_likes'"}>{xen:phrase first_message_likes}</option>
</select>
</div>
<div class="controlGroup">
<label for="ctrl_direction">{xen:phrase order_threads_in}:</label>
<select name="direction" id="ctrl_direction" class="textCtrl">
<option value="desc" {xen:selected "{$orderDirection} == 'desc'"}>{xen:phrase descending_order}</option>
<option value="asc" {xen:selected "{$orderDirection} == 'asc'"}>{xen:phrase ascending_order}</option>
</select>
</div>
<xen:if is="{$forum.prefixCache}">
<div class="controlGroup">
<label for="ctrl_prefix_id">{xen:phrase prefix}:</label>
<select name="prefix_id" id="ctrl_prefix_id" class="textCtrl">
<option value="0" {xen:selected '!{$displayConditions.prefix_id}'}>({xen:phrase any})</option>
<xen:foreach loop="$forum.prefixCache" key="$prefixGroupId" value="$prefixes">
<xen:if is="{$prefixGroupId}">
<optgroup label="{xen:helper threadPrefixGroup, $prefixGroupId}">
<xen:foreach loop="$prefixes" value="$prefixId">
<option value="{$prefixId}" {xen:selected '{$displayConditions.prefix_id} == {$prefixId}'}>{xen:helper threadPrefix, $prefixId, escaped, ''}</option>
</xen:foreach>
</optgroup>
<xen:else />
<xen:foreach loop="$prefixes" value="$prefixId">
<option value="{$prefixId}" {xen:selected '{$displayConditions.prefix_id} == {$prefixId}'}>{xen:helper threadPrefix, $prefixId, escaped, ''}</option>
</xen:foreach>
</xen:if>
</xen:foreach>
</select>
</div>
</xen:if>
<div class="buttonGroup">
<input type="submit" class="button primary" value="{xen:phrase set_options}" />
<input type="reset" class="button" value="{xen:phrase cancel}" />
</div>
</xen:hook>
<input type="hidden" name="_xfToken" value="{$visitor.csrf_token_page}" />
</form>
<xen:include template="preview_tooltip" />