-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Create Page context class Instantiate page context Bump rf to temp version fix missed import Remove excess import Fix Page context class Bump refarm-site version Remove dangling optional_context * Fix name of context import
- Loading branch information
1 parent
ce492b1
commit 2543dcd
Showing
4 changed files
with
42 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
from functools import partial | ||
|
||
from catalog.newcontext import Context, Tags | ||
|
||
|
||
class Page(Context): | ||
|
||
def __init__(self, page, tags: Tags): | ||
self._page = page | ||
self._tags = tags | ||
|
||
def context(self): | ||
def template_context(page, tag_titles, tags): | ||
return { | ||
'page': page, | ||
'tag_titles': tag_titles, | ||
'tags': tags, | ||
} | ||
|
||
tags_qs = self._tags.qs() | ||
self._page.get_template_render_context = partial( | ||
template_context, self._page, tags_qs.as_title(), tags_qs | ||
) | ||
|
||
return { | ||
'page': self._page, | ||
'skip_canonical': tags_qs.exists(), | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2543dcd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Puzzle
683-b33e7e30
disappeared fromshopelectro/views/catalog.py
, that's why I closed #701. Please, remember that the puzzle was not necessarily removed in this particular commit. Maybe it happened earlier, but we discovered this fact only now.