66 lines
1.2 KiB
Python
66 lines
1.2 KiB
Python
from izzylib.http_server import UserLevel, View
|
|
|
|
|
|
class Home(View):
|
|
paths = ['/']
|
|
menu = ('Home', paths[0])
|
|
|
|
async def get(self, request, response):
|
|
return response.template('page/home.haml')
|
|
|
|
|
|
class Register(View):
|
|
paths = ['/register']
|
|
menu = ('Register', paths[0])
|
|
|
|
async def get(self, request, response):
|
|
return response.template('page/register.haml')
|
|
|
|
|
|
async def post(self, request, response):
|
|
pass
|
|
|
|
|
|
class Login(View):
|
|
paths = ['/login']
|
|
menu = ('Login', paths[0])
|
|
|
|
async def get(self, request, response):
|
|
return response.template('page/login.haml')
|
|
|
|
|
|
async def post(self, request, response):
|
|
pass
|
|
|
|
|
|
class Logout(View):
|
|
paths = ['/logout']
|
|
menu = ('Logout', paths[0], UserLevel.USER)
|
|
|
|
async def get(self, request, response):
|
|
return response.template('page/logout.haml')
|
|
|
|
|
|
class Account(View):
|
|
paths = ['/account']
|
|
menu = ('Account', paths[0], UserLevel.USER)
|
|
|
|
async def get(self, request, response):
|
|
return response.template('page/account.haml')
|
|
|
|
|
|
async def post(self, request, response):
|
|
pass
|
|
|
|
|
|
class Admin(View):
|
|
paths = ['/admin']
|
|
menu = ('Admin', paths[0], UserLevel.ADMIN)
|
|
|
|
async def get(self, request, response):
|
|
return response.template('page/admin.haml')
|
|
|
|
|
|
async def post(self, request, response):
|
|
pass
|