From f1e0d1b5dc0ad0dafc872220aa1bee228f01572c Mon Sep 17 00:00:00 2001 From: Nathan Woodburn Date: Fri, 17 Nov 2023 11:17:00 +1100 Subject: [PATCH] feat: Show link owner on admin dash --- main.py | 5 +++-- render.py | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index 9381cf9..cfd24e0 100644 --- a/main.py +++ b/main.py @@ -81,16 +81,17 @@ def edit(): avatar=account.get_avatar(domain) host = request.host - + admin=False if domain.lower() == ADMIN_DOMAIN: links = db.get_all_links() + admin=True else: links = db.get_users_links(domain) link_count = len(links) if links == False: links = "

No links created yet

" else: - links = render.links(links,host) + links = render.links(links,host,admin) return render_template('dash.html',domain=domain,avatar=avatar,host=host,links=links,link_count=link_count) @app.route('/dash', methods=['POST']) diff --git a/render.py b/render.py index 0dd2781..9a74eaf 100644 --- a/render.py +++ b/render.py @@ -1,9 +1,11 @@ -def links(links,host=""): +def links(links,host="",show_domain=False): host = "https://"+host+"/" html = "" for link in links: html += "\n" return html \ No newline at end of file