2024-06-17 17:33:29 +07:00
|
|
|
from mako.template import Template
|
2024-06-19 06:53:25 +07:00
|
|
|
from config import globalvar
|
|
|
|
from bottle import request
|
2024-06-17 17:33:29 +07:00
|
|
|
|
|
|
|
class register:
|
|
|
|
|
|
|
|
def __init__(self):
|
2024-06-19 06:53:25 +07:00
|
|
|
pass
|
2024-06-17 17:33:29 +07:00
|
|
|
|
|
|
|
def html(self, params):
|
2024-06-19 06:53:25 +07:00
|
|
|
roles = params["roles"]
|
|
|
|
active_page = "Register"
|
|
|
|
user_roles = [0]
|
|
|
|
beaker_session = request.environ.get('beaker.session')
|
|
|
|
jwt = beaker_session["token"] if "token" in beaker_session else None
|
|
|
|
if jwt is not None:
|
|
|
|
return redirect('/')
|
|
|
|
else:
|
|
|
|
return Template(params["mako"]["website"]['index']).render(
|
|
|
|
title = globalvar.title,
|
|
|
|
header = globalvar.header,
|
|
|
|
navbar = Template(params["mako"]["website"]['navbar']).render(
|
|
|
|
menu = globalvar.menu['public']['navbar'],
|
|
|
|
user_roles = user_roles,
|
|
|
|
active_page = active_page
|
|
|
|
),
|
|
|
|
footer = Template(params["mako"]["website"]['footer']).render(
|
|
|
|
copyright = globalvar.copyright,
|
|
|
|
),
|
|
|
|
container = Template(params["mako"]["website"]['container']).render(
|
|
|
|
title = globalvar.title,
|
|
|
|
reCAPTCHA_client = globalvar.reCAPTCHA['client'],
|
|
|
|
roles = roles,
|
|
|
|
production = globalvar.production
|
|
|
|
)
|
2024-06-17 17:33:29 +07:00
|
|
|
)
|