# Path: elephantblog/navigation_extensions/common.py
# def date_of_first_entry():
# def date_tree():
#     def children(self, page, **kwargs):
# class BlogCategoriesNavigationExtension(NavigationExtension):


from django.conf import settings
from django.utils.translation import gettext as _, gettext_lazy
from .common import Category, NavigationExtension, PagePretender, all_months, date_tree
                        url="%s%04d/%02d/" % (page.get_absolute_url(), year, month),
                        tree_id=page.tree_id,
                        level=page.level + 2,
                        language=getattr(page, "language", settings.LANGUAGE_CODE),
                        slug="%04d/%02d" % (year, month),
                        lft=0,
                        rght=0,
                        _mptt_meta=page._mptt_meta,
                    )

            yield PagePretender(
                title="%s" % year,
                url=f"{page.get_absolute_url()}{year}/",
                tree_id=page.tree_id,
                language=getattr(page, "language", settings.LANGUAGE_CODE),
                level=page.level + 1,
                slug="%s" % year,
                parent=page,
                parent_id=page.id,
                get_children=return_months,
                lft=page.lft + 1,
                rght=len(months) + 1,
                _mptt_meta=page._mptt_meta,
            )


class RCategoryAndDateNavigationExtension(NavigationExtension):
    name = gettext_lazy("Blog category and date")

    def children(self, page, **kwargs):

# Path: elephantblog/navigation_extensions/common.py
# def date_of_first_entry():
# def date_tree():
#     def children(self, page, **kwargs):
# class BlogCategoriesNavigationExtension(NavigationExtension):


# Path: elephantblog/navigation_extensions/recursetree.py
from django.conf import settings
from django.utils.translation import gettext as _, gettext_lazy
from .common import Category, NavigationExtension, PagePretender, all_months, date_tree

                        url="%s%04d/%02d/" % (page.get_absolute_url(), year, month),
                        tree_id=page.tree_id,
                        level=page.level + 2,
                        language=getattr(page, "language", settings.LANGUAGE_CODE),
                        slug="%04d/%02d" % (year, month),
                        lft=0,
                        rght=0,
                        _mptt_meta=page._mptt_meta,
                    )

            yield PagePretender(
                title="%s" % year,
                url=f"{page.get_absolute_url()}{year}/",
                tree_id=page.tree_id,
                language=getattr(page, "language", settings.LANGUAGE_CODE),
                level=page.level + 1,
                slug="%s" % year,
                parent=page,
                parent_id=page.id,
                get_children=return_months,
                lft=page.lft + 1,
                rght=len(months) + 1,
                _mptt_meta=page._mptt_meta,
            )


class RCategoryAndDateNavigationExtension(NavigationExtension):
    name = gettext_lazy("Blog category and date")

    def children(self, page, **kwargs):

        all_categories = Category.objects.all()