web: view raw leaderboard by action_id

This commit is contained in:
norohind 2021-12-15 21:21:52 +03:00
parent 3f1efe0ac7
commit b3449c7c63
No known key found for this signature in database
GPG Key ID: 93F01ED4F5A20178

13
web.py
View File

@ -129,6 +129,18 @@ class LeaderboardByActionID:
resp.text = json.dumps(model.get_diff_action_id(action_id))
class LeaderboardByActionIDHTML:
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',
{
'target_column_name': 'Tag',
'target_new_url': '/squads/now/by-tag/short/'
}
)
class MainPage:
def on_get(self, req: falcon.request.Request, resp: falcon.response.Response) -> None:
raise falcon.HTTPMovedPermanently('/index.html')
@ -153,6 +165,7 @@ app.add_route('/api/leaderboard-state/by-action-id/{action_id}', LeaderboardByAc
app.add_route('/leaderboard/{leaderboard}/platform/{platform}', ActivityHtml())
app.add_route('/diff/{action_id}', ActivityDiffHtml())
app.add_route('/leaderboard-history/leaderboard/{leaderboard}/platform/{platform}', SumLeaderboardHistoryHtml())
app.add_route('/leaderboard-state/by-action-id/{action_id}', LeaderboardByActionIDHTML())
app.add_route('/api/cache/{action}', Cache())