Skip to content

Commit

Permalink
#837 Doc matrix structure
Browse files Browse the repository at this point in the history
  • Loading branch information
duker33 committed Jun 12, 2019
1 parent 029838c commit 2ae104e
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions shopelectro/views/catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
from shopelectro.exception import Http400
from shopelectro.views.helpers import set_csrf_cookie


# block numeric indexes to limit
MATRIX_BLOCKS_TO_LIMIT = [3, 5]
MATRIX_BLOCK_SIZE = 7
Expand All @@ -40,7 +39,16 @@ def category_matrix(request, page: str):
matrix = OrderedDict()
for i, root in enumerate(roots):
children = root.children.active()
# @todo #822:30m Doc category matrix blocks.
# Categories matrix is UI element supposed to preview
# the whole catalog structure at with a single page.
# The matrix consists of blocks.
# Every block is a list of categories with links.
# How the matrix looks like:
# https://github.com/fidals/shopelectro/issues/837#issuecomment-501161967

# @todo #837:60m Improve categories matrix arch.
# Now it's untyped data structure with common comments.
# Turn it to the set of object with clear names.
matrix[root.name] = (
children
if i not in MATRIX_BLOCKS_TO_LIMIT
Expand Down

0 comments on commit 2ae104e

Please sign in to comment.