aboutsummaryrefslogtreecommitdiffstats
path: root/pysite/views/main/info/resources.py
blob: ceb88b65acc55bb841e8269a8fa51a21c156a29a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# 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)