Skip to content
This repository has been archived by the owner on Feb 23, 2020. It is now read-only.

Commit

Permalink
#663 Create breadcrumbs for series (#666)
Browse files Browse the repository at this point in the history
* #663  Create breadcrumbs for series

* #663  Subtask series crumbs testing

* #663  Refresh fixtures
  • Loading branch information
duker33 authored Jun 9, 2019
1 parent 3448689 commit 0b828af
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion stroyprombeton/fixtures/dump.json

Large diffs are not rendered by default.

12 changes: 8 additions & 4 deletions stroyprombeton/management/commands/test_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,18 +177,22 @@ def create_category(id: int, pattern: str):

@staticmethod
def create_series():
def create(id: int, pattern: str):
def create(id: int, pattern: str, parent):
return stb_models.Series.objects.create(
name=pattern.format(id),
page=ModelPage.objects.create(name=pattern.format(id)),
page=ModelPage.objects.create(
name=pattern.format(id),
parent=parent,
),
)

parent = CustomPage.objects.get(slug='series')
real_series = [
create(id=i, pattern=SERIES_PATTERN)
create(id=i, pattern=SERIES_PATTERN, parent=parent)
for i in range(REAL_SERIES_COUNT)
]
for i in range(EMPTY_SERIES_COUNT):
create(id=i, pattern=EMPTY_SERIES_PATTERN)
create(id=i, pattern=EMPTY_SERIES_PATTERN, parent=parent)
# return only real series, because only they should have children
return real_series

Expand Down
2 changes: 2 additions & 0 deletions templates/catalog/series.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{% extends 'layout/inner_page.html' %}

{% block content %}
{# @todo #663:30m Test series crumbs. #}
{% include 'components/breadcrumbs.html' with page=page base_url=base_url only %}
{% include 'components/page_h1.html' with page=page only %}

<section class="category-search">
Expand Down

1 comment on commit 0b828af

@0pdd
Copy link
Collaborator

@0pdd 0pdd commented on 0b828af Jun 9, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Puzzle 663-0bea6a89 discovered in templates/catalog/series.html and submitted as #688. Please, remember that the puzzle was not necessarily added in this particular commit. Maybe it was added earlier, but we discovered it only now.

Please sign in to comment.