Made it look a bit nicer and added a cascading menu thing
This commit is contained in:
21
functions.py
21
functions.py
@@ -3,3 +3,24 @@ import hashlib
|
||||
def sha512_hash(Password):
|
||||
HashedPassword = hashlib.sha512(Password.encode('utf-8')).hexdigest()
|
||||
return HashedPassword
|
||||
|
||||
|
||||
def dropdown_menu(object_input):
|
||||
html = ''
|
||||
def loop(x, count):
|
||||
html = ''
|
||||
for key,value in x.items():
|
||||
print(' ' * count * 5, key)
|
||||
if type(value) == dict:
|
||||
html += f'<details style="left: {count * 5}px; position: relative">'
|
||||
html += f'<summary>{key}</summary>'
|
||||
html += loop(x[key], count+1)
|
||||
html += f'</details>'
|
||||
else:
|
||||
html += f'<a href="/wiki/{value}" style="left: {count * 5}px; position: relative">{key}</a><br/>'
|
||||
return html
|
||||
|
||||
count = 0
|
||||
html += loop(object_input, count)
|
||||
print(html)
|
||||
return html
|
||||
|
Reference in New Issue
Block a user