Categories refactor (#517)
* feat: pagination on /categories and /category page for sub categories * feat: show subcategories left * fix: rename categories to allCategories on /search * feat: add component for subcategory container * feat: update filter/selector tpls * feat: change multi to regular input entire category list is no longer returned on group page * feat: add pagination to user/:slug/categories * feat: flags category selector * feat: left/right filter * feat: move filter right * feat: add selector to /categories and /category only when categories dont fit on one page * fix: show title if only one pagemain
parent
12f122ee37
commit
5d8ca1f27f
@ -0,0 +1,19 @@
|
|||||||
|
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||||
|
{{{ if selectedCategory }}}<span class="fa-stack" style="{function.generateCategoryBackground, selectedCategory}"><i class="fa fa-fw fa-stack-1x {selectedCategory.icon}" style="color: {selectedCategory.color};"></i></span> <span class="visible-sm-inline visible-md-inline visible-lg-inline">{selectedCategory.name}</span>{{{ else }}}
|
||||||
|
<span class="visible-sm-inline visible-md-inline visible-lg-inline">[[unread:all_categories]]</span><span class="visible-xs-inline"><i class="fa fa-fw fa-list"></i></span>{{{ end }}} <span class="caret"></span>
|
||||||
|
</button>
|
||||||
|
<div component="category-selector-search" class="hidden">
|
||||||
|
<input type="text" class="form-control" autocomplete="off">
|
||||||
|
</div>
|
||||||
|
<ul component="category/list" class="dropdown-menu category-dropdown-menu" role="menu">
|
||||||
|
{{{ if allCategoriesUrl }}}
|
||||||
|
<li role="presentation" class="category" data-all="all">
|
||||||
|
<a role="menu-item" href="{config.relative_path}/{allCategoriesUrl}"><i component="category/select/icon" class="fa fa-fw fa-check {{{if selectedCategory}}}invisible{{{end}}}"></i> [[unread:all_categories]]</a>
|
||||||
|
</li>
|
||||||
|
{{{ end }}}
|
||||||
|
{{{each categoryItems}}}
|
||||||
|
<li role="presentation" class="category {{{ if ../disabledClass }}}disabled{{{ end }}}" data-cid="{../cid}" data-parent-cid="{../parentCid}" data-name="{../name}">
|
||||||
|
<a role="menu-item" href="#">{../level}<i component="category/select/icon" class="fa fa-fw fa-check {{{ if !../selected }}}invisible{{{ end }}}"></i><span component="category-markup" style="{{{ if ../match }}}font-weight: bold;{{{end}}}">{{{ if ../icon }}}<span class="fa-stack" style="{function.generateCategoryBackground}"><i class="fa fa-fw fa-stack-1x {../icon}" style="color: {../color};"></i></span>{{{ end }}} {../name}</span></a>
|
||||||
|
</li>
|
||||||
|
{{{end}}}
|
||||||
|
</ul>
|
@ -0,0 +1,3 @@
|
|||||||
|
<div component="category/dropdown" class="btn-group pull-right category-dropdown-container bottom-sheet">
|
||||||
|
<!-- IMPORT partials/category-filter-content.tpl -->
|
||||||
|
</div>
|
@ -1,19 +1,3 @@
|
|||||||
<div component="category/dropdown" class="btn-group pull-right category-dropdown-container bottom-sheet {{{ if !categories.length }}}hidden{{{end}}}">
|
<div component="category/dropdown" class="btn-group category-dropdown-container bottom-sheet">
|
||||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
<!-- IMPORT partials/category-filter-content.tpl -->
|
||||||
{{{ if selectedCategory }}}<span class="fa-stack" style="{function.generateCategoryBackground, selectedCategory}"><i class="fa fa-fw fa-stack-1x {selectedCategory.icon}" style="color: {selectedCategory.color};"></i></span> <span class="visible-sm-inline visible-md-inline visible-lg-inline">{selectedCategory.name}</span>{{{ else }}}
|
|
||||||
<span class="visible-sm-inline visible-md-inline visible-lg-inline">[[unread:all_categories]]</span><span class="visible-xs-inline"><i class="fa fa-fw fa-list"></i></span>{{{ end }}} <span class="caret"></span>
|
|
||||||
</button>
|
|
||||||
<div component="category-selector-search" class="hidden">
|
|
||||||
<input type="text" class="form-control" autocomplete="off">
|
|
||||||
</div>
|
|
||||||
<ul component="category/list" class="dropdown-menu category-dropdown-menu" role="menu">
|
|
||||||
<li role="presentation" class="category">
|
|
||||||
<a role="menu-item" href="{config.relative_path}/{allCategoriesUrl}"><i component="category/select/icon" class="fa fa-fw fa-check {{{if selectedCategory}}}invisible{{{end}}}"></i> [[unread:all_categories]]</a>
|
|
||||||
</li>
|
|
||||||
{{{each categories}}}
|
|
||||||
<li role="presentation" class="category {{{ if categories.disabledClass }}}disabled{{{ end }}}" data-cid="{categories.cid}" data-parent-cid="{categories.parentCid}" data-name="{categories.name}">
|
|
||||||
<a role="menu-item" href="#">{categories.level}<i component="category/select/icon" class="fa fa-fw fa-check {{{ if !categories.selected }}}invisible{{{ end }}}"></i><span component="category-markup">{{{ if categories.icon }}}<span class="fa-stack" style="{function.generateCategoryBackground}"><i class="fa fa-fw fa-stack-1x {categories.icon}" style="color: {categories.color};"></i></span>{{{ end }}} {categories.name}</span></a>
|
|
||||||
</li>
|
|
||||||
{{{end}}}
|
|
||||||
</ul>
|
|
||||||
</div>
|
</div>
|
Loading…
Reference in New Issue