aboutsummaryrefslogtreecommitdiffstats
path: root/pydis_site/apps/content/views/pages.py
blob: 11ac0eeb83c9f3e838a35da748804f6743acec06 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from django.views.generic import TemplateView

from pydis_site.apps.content.utils import get_pages, get_categories


class PagesView(TemplateView):
    """Shows all pages and categories."""

    template_name = "content/listing.html"

    def get_context_data(self, **kwargs) -> dict:
        """Add page and category data to template context."""
        context = super().get_context_data(**kwargs)
        context["content"] = get_pages()
        context["categories"] = get_categories()
        return context