aboutsummaryrefslogtreecommitdiffstats
path: root/pysite/views/staff/jams/index.py
blob: 40a8387c3a17fa300952946a73077598dbf0eadb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
from pysite.base_route import RouteView
from pysite.constants import ALL_STAFF_ROLES, JAM_STATES
from pysite.decorators import require_roles
from pysite.mixins import DBMixin


class StaffView(RouteView, DBMixin):
    path = "/jams"
    name = "jams.index"
    table_name = "code_jams"

    @require_roles(*ALL_STAFF_ROLES)
    def get(self):
        jams = self.db.get_all(self.table_name)
        return self.render("staff/jams/index.html", jams=jams, states=JAM_STATES)