fix css for html views

This commit is contained in:
norohind 2021-11-21 14:30:01 +03:00
parent f41625c160
commit c51d8a1b3b
Signed by: norohind
GPG Key ID: 01C3BECC26FB59E1
2 changed files with 9 additions and 6 deletions

View File

@ -200,25 +200,27 @@ activity_table_html_template = """
document.body.appendChild(buildHtmlTable(JSON.parse({items})));
}
</script>
<link type="text/css" rel="stylesheet" href="/js/table_styles.css">
</head>
<body>
</body>
</html>"""
activity_table_html_styles = """
.table {
width: 100%;
table {
margin-bottom: 20px;
border: 1px solid #dddddd;
border-collapse: collapse;
}
.table th {
table th {
font-weight: bold;
padding: 5px;
background: #efefef;
border: 1px solid #dddddd;
}
.table td {
table td {
border: 1px solid #dddddd;
padding: 5px;
}""" # TODO: fix css for table
text-align:center;
}
"""

3
web.py
View File

@ -66,11 +66,12 @@ class ActivityDiffHtml:
class JS:
def on_get(self, req: falcon.request.Request, resp: falcon.response.Response, file: str) -> None:
resp.content_type = falcon.MEDIA_JS
if file == 'json2htmltable.js':
resp.content_type = falcon.MEDIA_JS
resp.text = utils.html_table_generator
elif file == 'table_styles.css':
resp.content_type = 'text/css'
resp.text = utils.activity_table_html_styles
else: