From 5d8ca1f27f967c77c384b78f0db7ef2cb196a7e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Sun, 7 Feb 2021 15:10:42 -0500 Subject: [PATCH] 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 page --- templates/account/categories.tpl | 1 + templates/categories.tpl | 4 ++++ templates/flags/list.tpl | 2 +- templates/groups/details.tpl | 16 +++++++-------- .../partials/category-filter-content.tpl | 19 ++++++++++++++++++ templates/partials/category-filter-right.tpl | 3 +++ templates/partials/category-filter.tpl | 20 ++----------------- templates/partials/category-selector.tpl | 14 ++++++------- templates/partials/category/subcategory.tpl | 4 ++++ templates/partials/flags/filters.tpl | 14 ++++--------- templates/popular.tpl | 2 +- templates/post-queue.tpl | 2 +- templates/recent.tpl | 2 +- templates/top.tpl | 2 +- templates/unread.tpl | 2 +- 15 files changed, 58 insertions(+), 49 deletions(-) create mode 100644 templates/partials/category-filter-content.tpl create mode 100644 templates/partials/category-filter-right.tpl diff --git a/templates/account/categories.tpl b/templates/account/categories.tpl index 261e9ff..bab53ac 100644 --- a/templates/account/categories.tpl +++ b/templates/account/categories.tpl @@ -22,6 +22,7 @@ {{{end}}} + diff --git a/templates/categories.tpl b/templates/categories.tpl index d1da411..d94f2e4 100644 --- a/templates/categories.tpl +++ b/templates/categories.tpl @@ -6,7 +6,11 @@
+ {{{ if pagination.pages.length }}} +
+ {{{ else }}}

[[pages:categories]]

+ {{{ end }}}
    {{{each categories}}} diff --git a/templates/flags/list.tpl b/templates/flags/list.tpl index fb0ab5e..b984ca4 100644 --- a/templates/flags/list.tpl +++ b/templates/flags/list.tpl @@ -8,7 +8,7 @@

    - [[flags:filter-reset]] + [[flags:filter-reset]]

    [[flags:filter-active]]
    diff --git a/templates/groups/details.tpl b/templates/groups/details.tpl index 47702ee..5c2db79 100644 --- a/templates/groups/details.tpl +++ b/templates/groups/details.tpl @@ -164,14 +164,14 @@
    - -

    [[groups:details.member-post-cids-help]]

    +
    +
    + +
    +
    + +
    +

    diff --git a/templates/partials/category-filter-content.tpl b/templates/partials/category-filter-content.tpl new file mode 100644 index 0000000..c068ea4 --- /dev/null +++ b/templates/partials/category-filter-content.tpl @@ -0,0 +1,19 @@ + + + \ No newline at end of file diff --git a/templates/partials/category-filter-right.tpl b/templates/partials/category-filter-right.tpl new file mode 100644 index 0000000..917a42b --- /dev/null +++ b/templates/partials/category-filter-right.tpl @@ -0,0 +1,3 @@ +
    + +
    \ No newline at end of file diff --git a/templates/partials/category-filter.tpl b/templates/partials/category-filter.tpl index 3596ef0..3f1d294 100644 --- a/templates/partials/category-filter.tpl +++ b/templates/partials/category-filter.tpl @@ -1,19 +1,3 @@ -
    - - - +
    +
    \ No newline at end of file diff --git a/templates/partials/category-selector.tpl b/templates/partials/category-selector.tpl index 822dc05..98a1350 100644 --- a/templates/partials/category-selector.tpl +++ b/templates/partials/category-selector.tpl @@ -1,7 +1,7 @@ -
    +
\ No newline at end of file diff --git a/templates/partials/category/subcategory.tpl b/templates/partials/category/subcategory.tpl index 86fbfcd..8d47809 100644 --- a/templates/partials/category/subcategory.tpl +++ b/templates/partials/category/subcategory.tpl @@ -1,6 +1,10 @@ {{{ if children.length }}}
+ {{{ if hasMoreSubCategories }}} +
+ {{{ else }}}

[[category:subcategories]]

+ {{{ end }}}
    {{{each children}}} diff --git a/templates/partials/flags/filters.tpl b/templates/partials/flags/filters.tpl index cfd6cc8..13282c1 100644 --- a/templates/partials/flags/filters.tpl +++ b/templates/partials/flags/filters.tpl @@ -25,6 +25,10 @@
    +
    + + +
    - -
    - - -
    - +
    - +
- +