44 lines
1.9 KiB
Cheetah
44 lines
1.9 KiB
Cheetah
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
|
|
<title>Foodoles written in Go</title>
|
|
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.2.13/semantic.min.css">
|
|
<script src="https://code.jquery.com/jquery-3.1.1.min.js" integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8=" crossorigin="anonymous"></script>
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.2.13/semantic.min.js"></script>
|
|
<style type="text/css">body { font-family: arial } h2 { margin: 2em 0em; } .ui.container { padding-top: 5em; padding-bottom: 5em; } </style>
|
|
<script type="text/javascript">
|
|
function vote(option){$.post( "/", {option}, ( data ) => { $('.modal').modal('show');});}
|
|
function reload(){document.location.reload(true);}
|
|
</script>
|
|
</head>
|
|
<body>
|
|
<div class="ui container">
|
|
<h1 class="ui header">Foodoles - {{.Foods.Date}}</h1><br/>
|
|
<h2 class="ui header">Pick Your Preferred Lunch's Food For Today</h2><br/>
|
|
<div class="ui ">
|
|
{{ range .Foods.Foods }}
|
|
<a onclick="vote('{{ .Title }}')" class="ui label massive" data-tooltip="{{ .Title }}" data-variation="basic" data-position="bottom left">
|
|
{{$cur := .Title}}
|
|
{{ .Icon }}
|
|
{{ range $.Votes.Votes }}
|
|
{{ if eq .Food $cur }}
|
|
<div class="floating ui blue left label">{{ .Voices }}</div>
|
|
{{end}}
|
|
{{end}}
|
|
</a>
|
|
{{ end }}
|
|
|
|
</div>
|
|
</div>
|
|
<div class="ui modal">
|
|
<div class="header">Foodoles</div>
|
|
<div class="content">
|
|
<p>Vote sent <strong>successfully</strong></p>
|
|
</div>
|
|
<div class="actions">
|
|
<div class="ui cancel button blue" onclick="reload()">Close</div>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html> |