forked from bEsPoKeN-tOkEns/token-tester
-
Notifications
You must be signed in to change notification settings - Fork 0
/
htmltemplate.py
86 lines (84 loc) · 1.77 KB
/
htmltemplate.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
table_record = """
<tr>
<td>{test_name}</td>
<td><a href="vscode://file{dir_path}/lib/weird-erc20/src/{token_file}.sol">{token_name}</a></td>
<td><span class="{status}">{status_emoji}</span></td>
</tr>
"""
sub_header = """
<tr>
<th class="subheader">{test_name}</th>
<th class="subheader"></th>
<th class="subheader"></th>
</tr>
"""
html_template ="""
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Token Tester Results</title>
<style>
/* Add some basic styling to the table */
table {{
border-collapse: collapse;
width: 100%;
}}
th {{
text-align: left;
padding: 8px;
font-size: 1.2em;
}}
td {{
text-align: left;
padding: 8px;
}}
th {{
background-color: #777;
color: white;
}}
tr:nth-child(even) {{
background-color: #444;
}}
tr:nth-child(odd) {{
background-color: #333;
}}
/* Add some styling to the status column */
.subheader {{
background-color: #565f89;
color: white;
}}
.success {{
color: #9ece6a;
font-size: 1.5em;
}}
.failure {{
color: #f7768e;
font-size: 1.5em;
}}
body {{
width: 66%;
text-align: center;
margin: 0 auto;
color: #fff;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
background-color: #222;
}}
a {{
color: #00a3ff;
}}
</style>
</head>
<body>
<h1>Token Tester Results</h1>
<table>
<tr>
<th>Test</th>
<th>Token</th>
<th>Status</th>
</tr>
{table_records}
</table>
</body>
</html>
"""