Basic profile activity
This commit is contained in:
parent
8cc5a51f76
commit
56e737be3a
@ -31,6 +31,12 @@ menu = {
|
||||
"href":"/login",
|
||||
"roles":[0]
|
||||
},
|
||||
{
|
||||
"name":"Profile",
|
||||
"target":"_self",
|
||||
"href":"/profile",
|
||||
"roles":[1,2,3]
|
||||
},
|
||||
{
|
||||
"name":"Logout",
|
||||
"target":"_self",
|
||||
|
10
handler.py
10
handler.py
@ -22,6 +22,7 @@ import modules.public.login as public_login
|
||||
import modules.public.forgot as public_forgot
|
||||
import modules.public.reset as public_reset
|
||||
|
||||
import modules.public.profile as public_profile
|
||||
import modules.public.roles as public_roles
|
||||
import modules.public.users as public_users
|
||||
import modules.public.accept as public_accept
|
||||
@ -122,6 +123,15 @@ def index():
|
||||
else:
|
||||
redirect('/')
|
||||
|
||||
@app.route('/profile')
|
||||
def index():
|
||||
params = {
|
||||
"mako" : {
|
||||
"website" : template_public.main(directory.page["public"], "profile")
|
||||
}
|
||||
}
|
||||
return public_profile.profile().html(params)
|
||||
|
||||
@app.route('/roles')
|
||||
def index():
|
||||
params = {
|
||||
|
37
modules/public/profile.py
Normal file
37
modules/public/profile.py
Normal file
@ -0,0 +1,37 @@
|
||||
from mako.template import Template
|
||||
from config import globalvar, navigation
|
||||
from scripts import loggorilla
|
||||
|
||||
import procedure.validation as procedure_validation
|
||||
|
||||
class profile:
|
||||
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
def html(self, params):
|
||||
APIADDR = "/profile"
|
||||
|
||||
loggorilla.prcss(APIADDR, "Define page parameters")
|
||||
active_page = "Profile"
|
||||
allowed_roles = [1,2,3]
|
||||
|
||||
loggorilla.prcss(APIADDR, "Account validation")
|
||||
user_validation = procedure_validation.validation().account(APIADDR, allowed_roles)
|
||||
user = user_validation['data']
|
||||
|
||||
return Template(params["mako"]["website"]['index']).render(
|
||||
title = globalvar.title,
|
||||
header = globalvar.header,
|
||||
navbar = Template(params["mako"]["website"]['navbar']).render(
|
||||
menu = navigation.menu['public']['navbar'],
|
||||
user_roles = user['profile']['roles'],
|
||||
active_page = active_page
|
||||
),
|
||||
footer = Template(params["mako"]["website"]['footer']).render(
|
||||
copyright = globalvar.copyright,
|
||||
),
|
||||
container = Template(params["mako"]["website"]['container']).render(
|
||||
profile = user['profile']
|
||||
)
|
||||
)
|
5
pages/public/profile.html
Normal file
5
pages/public/profile.html
Normal file
@ -0,0 +1,5 @@
|
||||
<ul>
|
||||
<li>Username: ${profile['username']}</li>
|
||||
<li>Email: ${profile['email']}</li>
|
||||
<li>Phone: ${profile['Phone']}</li>
|
||||
</ul>
|
Loading…
Reference in New Issue
Block a user