stats
This commit is contained in:
parent
52f76dad12
commit
539c172f43
2 changed files with 56 additions and 0 deletions
|
@ -306,6 +306,11 @@ pub fn (mut app App) banner() vweb.Result {
|
|||
return $vweb.html()
|
||||
}
|
||||
|
||||
@['/stats'; get]
|
||||
pub fn (mut app App) stats() vweb.Result {
|
||||
return $vweb.html()
|
||||
}
|
||||
|
||||
@['/status_update'; post]
|
||||
pub fn (mut app App) status_update() vweb.Result {
|
||||
if person := app.do_status_update(app.form['id'].int()) {
|
||||
|
|
51
src/templates/stats.html
Normal file
51
src/templates/stats.html
Normal file
|
@ -0,0 +1,51 @@
|
|||
<!doctype html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.5">
|
||||
<title>🥞 stats</title>
|
||||
<link rel="stylesheet" href="https://unpkg.com/charts.css/dist/charts.min.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table class="charts-css bar">
|
||||
|
||||
<caption> 2016 Summer Olympics Medal Table </caption>
|
||||
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col"> Country </th>
|
||||
<th scope="col"> Gold </th>
|
||||
<th scope="col"> Silver </th>
|
||||
<th scope="col"> Bronze </th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row"> USA </th>
|
||||
<td style="--size: 0.46"> 46 </td>
|
||||
<td style="--size: 0.37"> 37 </td>
|
||||
<td style="--size: 0.38"> 38 </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"> GBR </th>
|
||||
<td style="--size: 0.27"> 27 </td>
|
||||
<td style="--size: 0.23"> 23 </td>
|
||||
<td style="--size: 0.17"> 17 </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"> CHN </th>
|
||||
<td style="--size: 0.26"> 26 </td>
|
||||
<td style="--size: 0.18"> 18 </td>
|
||||
<td style="--size: 0.26"> 26 </td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
Loading…
Reference in a new issue