united subcategory and categories into one partial, requires tjs 0.2x

main
psychobunny 10 years ago
parent 1c9a46b4a7
commit fa75a1970d

@ -2,38 +2,6 @@
<p>Categories</p>
<!-- BEGIN categories -->
<li component="categories/category" data-cid="{categories.cid}" data-numRecentReplies="1" class="row clearfix">
<meta itemprop="name" content="{categories.name}">
<div class="col-md-7 col-sm-9 col-xs-11 content">
<div class="icon hidden-sm hidden-xs pull-left" style="{function.generateCategoryBackground}">
<i class="fa fa-fw {categories.icon}"></i>
</div>
<h1 class="title pull-left">
<!-- IMPORT partials/categories/link.tpl --><br />
<small>{categories.description}</small>
</h1>
</div>
<!-- IF !categories.link -->
<div class="col-md-1 hidden-sm hidden-xs stats">
<span class="{categories.unread-class} human-readable-number" title="{categories.topic_count}">{categories.topic_count}</span><br />
<small>[[global:topics]]</small>
</div>
<div class="col-md-1 hidden-sm hidden-xs stats">
<span class="{categories.unread-class} human-readable-number" title="{categories.post_count}">{categories.post_count}</span><br />
<small>[[global:posts]]</small>
</div>
<div class="col-md-3 col-sm-3 col-xs-1 teaser">
<!-- IMPORT partials/categories/lastpost.tpl -->
</div>
<!-- ELSE -->
<div class="col-md-2 hidden-sm-hidden-xs"></div>
<div class="col-md-3 col-sm-3 col-xs-1 teaser">
<div class="card" style="border-color: {categories.bgColor}"></div>
</div>
<!-- ENDIF !categories.link -->
</li>
<!-- IMPORT partials/categories/item.tpl -->
<!-- END categories -->
</ul>

@ -0,0 +1,33 @@
<li component="categories/category" data-cid="{../cid}" data-numRecentReplies="1" class="row clearfix">
<meta itemprop="name" content="{../name}">
<div class="col-md-7 col-sm-9 col-xs-11 content">
<div class="icon hidden-sm hidden-xs pull-left" style="{function.generateCategoryBackground}">
<i class="fa fa-fw {../icon}"></i>
</div>
<h1 class="title pull-left">
<!-- IMPORT partials/categories/link.tpl --><br />
<small>{../description}</small>
</h1>
</div>
<!-- IF !../link -->
<div class="col-md-1 hidden-sm hidden-xs stats">
<span class="{../unread-class} human-readable-number" title="{../topic_count}">{../topic_count}</span><br />
<small>[[global:topics]]</small>
</div>
<div class="col-md-1 hidden-sm hidden-xs stats">
<span class="{../unread-class} human-readable-number" title="{../post_count}">{../post_count}</span><br />
<small>[[global:posts]]</small>
</div>
<div class="col-md-3 col-sm-3 col-xs-1 teaser">
<!-- IMPORT partials/categories/lastpost.tpl -->
</div>
<!-- ELSE -->
<div class="col-md-2 hidden-sm-hidden-xs"></div>
<div class="col-md-3 col-sm-3 col-xs-1 teaser">
<div class="card" style="border-color: {../bgColor}"></div>
</div>
<!-- ENDIF !../link -->
</li>

@ -1,25 +1,25 @@
<div class="card" style="border-color: {categories.bgColor}">
<div class="card" style="border-color: {../bgColor}">
<!-- BEGIN posts -->
<!-- IF @first -->
<div component="category/posts">
<p>
<strong>{categories.posts.user.username}</strong>
<a class="permalink" href="{config.relative_path}/topic/{categories.posts.topic.slug}<!-- IF categories.posts.index -->/{categories.posts.index}<!-- ENDIF categories.posts.index -->">
<small class="timeago" title="{categories.posts.relativeTime}"></small>
<strong>{../user.username}</strong>
<a class="permalink" href="{config.relative_path}/topic/{../topic.slug}<!-- IF ../index -->/{../index}<!-- ENDIF ../index -->">
<small class="timeago" title="{../relativeTime}"></small>
</a>
</p>
<div class="post-content">
{categories.posts.content}
{../content}
</div>
</div>
<!-- ENDIF @first -->
<!-- END posts -->
<!-- IF !posts.length -->
<!-- IF !../posts.length -->
<div component="category/posts">
<div class="post-content">
No new posts.
</div>
<div>
<!-- ENDIF !posts.length -->
<!-- ENDIF !../posts.length -->
</div>

@ -1,7 +1,7 @@
<!-- IF categories.link -->
<a href="{categories.link}" itemprop="url" target="_blank">
<!-- IF ../link -->
<a href="{../link}" itemprop="url" target="_blank">
<!-- ELSE -->
<a href="{config.relative_path}/category/{categories.slug}" itemprop="url">
<!-- ENDIF categories.link -->
{categories.name}
<a href="{config.relative_path}/category/{../slug}" itemprop="url">
<!-- ENDIF ../link -->
{../name}
</a>

@ -3,65 +3,7 @@
<ul class="categories" itemscope itemtype="http://www.schema.org/ItemList">
<!-- BEGIN children -->
<li data-cid="{children.cid}" data-numRecentReplies="{children.numRecentReplies}" class="row clearfix">
<meta itemprop="name" content="{children.name}">
<div class="col-md-7 col-sm-9 col-xs-11 content">
<div class="icon hidden-sm hidden-xs pull-left" style="{function.generateCategoryBackground}">
<i class="fa fa-fw {children.icon}"></i>
</div>
<h1 class="title pull-left">
<!-- IF children.link -->
<a href="{children.link}" itemprop="url" target="_blank">
<!-- ELSE -->
<a href="{config.relative_path}/category/{children.slug}" itemprop="url">
<!-- ENDIF children.link -->
{children.name}
</a><br />
<small>{children.description}</small>
</h1>
</div>
<!-- IF !children.link -->
<div class="col-md-1 hidden-sm hidden-xs stats">
<span class="{children.unread-class} human-readable-number" title="{children.topic_count}">{children.topic_count}</span><br />
<small>[[global:topics]]</small>
</div>
<div class="col-md-1 hidden-sm hidden-xs stats">
<span class="{children.unread-class} human-readable-number" title="{children.post_count}">{children.post_count}</span><br />
<small>[[global:posts]]</small>
</div>
<div class="col-md-3 col-sm-3 col-xs-1 teaser">
<div class="card" style="border-color: {children.bgColor}">
<!-- BEGIN posts -->
<!-- IF @first -->
<p>
<strong>{children.posts.user.username}</strong>
<a class="permalink" href="{config.relative_path}/topic/{children.posts.topic.slug}<!-- IF children.posts.index -->/{children.posts.index}<!-- ENDIF children.posts.index -->">
<small class="timeago" title="{children.posts.relativeTime}"></small>
</a>
</p>
<div class="post-content">
{children.posts.content}
</div>
<!-- ENDIF @first -->
<!-- END posts -->
<!-- IF !posts.length -->
<div class="post-content">
No new posts.
</div>
<!-- ENDIF !posts.length -->
</div>
</div>
<!-- ELSE -->
<div class="col-md-2 hidden-sm-hidden-xs"></div>
<div class="col-md-3 col-sm-3 col-xs-1 teaser">
<div class="card" style="border-color: {children.bgColor}"></div>
</div>
<!-- ENDIF !children.link -->
</li>
<!-- IMPORT partials/categories/item.tpl -->
<!-- END children -->
</ul>
</div>
Loading…
Cancel
Save