async def profile(req,res): if req.wildcards.keys(): uid = req.wildcards['uid'] else: uid = 'none' res.body = render_template('profile.html', nav_list= await content.get_nav(), uid=uid) return res
async def page(req,res): page = await content.get_asset(req.wildcards['aid']) if page: hcontent = await content.get_html_asset(page['content']) res.body = render_template('page.html', nav_list= await content.get_nav(), page_data=page, content=hcontent) return res else: res.body = 'no page' return res
async def index(req,res): res.body = render_template('index.html', nav_list= await content.get_nav(), courses= await content.get_courses()) return res
async def course(req, res): course = await content.get_asset(req.wildcards['aid']) res.body = render_template('course.html', nav_list= await content.get_nav(), page_data=course, pages=course['pages']) return res
async def root(request, response): response.body = render_template('root.html', nav_list= await content.get_nav()) return response