aboutsummaryrefslogtreecommitdiffstats
path: root/pysite/views/main/info/resources.py
blob: bce162f4ecb0f30399045971f522b57af93399f6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# coding=utf-8
import json
from logging import getLogger

from pysite.base_route import RouteView


try:
    with open("static/resources.json") as fh:
        categories = json.load(fh)
except Exception:
    getLogger("Resources").exception("Failed to load resources.json")
    categories = None


class ResourcesView(RouteView):
    path = "/info/resources"
    name = "info/resources"

    def get(self):
        return self.render("main/info/resources.html", categories=categories)