aboutsummaryrefslogtreecommitdiffstats
path: root/pysite/views/main/info/resources.py
blob: f3ff8283090420aae1d46960defa9eb36dffb4b5 (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)