diff --git a/iwm_browser/main.py b/iwm_browser/main.py index fad9176..1521a79 100644 --- a/iwm_browser/main.py +++ b/iwm_browser/main.py @@ -119,6 +119,24 @@ async def showLevel(level_id: int): THUMB_URL=THUMB_URL, ) +@app.get("/user/{user_id}", response_class=HTMLResponse) +async def showUser(user_id: int): + template = template_env.get_template("userInfo.html") + + try: + rq = httpx.get(BASE_URL + "/api/v1/user/" + str(user_id), timeout=10) + searchResults = rq.json() + print(rq.url) + except httpx.ReadTimeout: + return "Server timed out" + + + + return template.render( + user=searchResults, + THUMB_URL=THUMB_URL, + ) + diff --git a/iwm_browser/static/user.css b/iwm_browser/static/user.css new file mode 100644 index 0000000..f25e089 --- /dev/null +++ b/iwm_browser/static/user.css @@ -0,0 +1,10 @@ +.UserInfo { + margin: 1rem; + font-size: large; +} + +.Username { + font-weight: bold; + border-bottom: 0.1rem solid white; + margin-bottom: 1rem; +} diff --git a/iwm_browser/templates/userInfo.html b/iwm_browser/templates/userInfo.html new file mode 100644 index 0000000..e5de305 --- /dev/null +++ b/iwm_browser/templates/userInfo.html @@ -0,0 +1,31 @@ + + +
+