add /leaderboard-state/by-action-id/{action_id} in frontend

This commit is contained in:
norohind 2021-12-19 00:37:21 +03:00
parent 163c5a4a87
commit b6f43292eb
Signed by: norohind
GPG Key ID: 01C3BECC26FB59E1
2 changed files with 21 additions and 3 deletions

View File

@ -0,0 +1,18 @@
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
{{ @json2html_template.html }}
<link type="text/css" rel="stylesheet" href="/js/table_styles.css">
</head>
<body>
<div id="table0div">
</div>
{{ @footer.html }}
<div id=footer1div>
<footer>
<a href="/leaderboard-state/by-action-id/{{ action_id }}">Leaderboard state at that moment</a>
</footer>
</div>
</body>
</html>

6
web.py
View File

@ -3,7 +3,6 @@ import json
import falcon
import os
from EDMCLogging import get_main_logger
import utils
from model.sqlite_cache import cache
from templates_engine import render
@ -87,10 +86,11 @@ class ActivityDiffHtml:
def on_get(self, req: falcon.request.Request, resp: falcon.response.Response, action_id: int) -> None:
resp.content_type = falcon.MEDIA_HTML
resp.text = render(
'table_template.html',
'table_diff_template.html',
{
'target_column_name': 'Tag',
'target_new_url': '/squads/now/by-tag/short/'
'target_new_url': '/squads/now/by-tag/short/',
'action_id': action_id
}
)