foodoles/templates/index.tmpl

50 lines
2.1 KiB
Cheetah
Raw Normal View History

2019-11-21 13:54:40 +01:00
<!DOCTYPE html>
<html lang="en">
<head>
2019-11-28 11:17:06 +01:00
<meta charset="utf-8">
2019-11-21 13:54:40 +01:00
<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>
2019-11-28 11:17:06 +01:00
<script src="https://twemoji.maxcdn.com/v/latest/twemoji.min.js" crossorigin="anonymous"></script>
<style type="text/css">h2 { margin: 2em 0em; } .ui.container { padding-top: 5em; padding-bottom: 5em; } </style>
2019-11-27 14:42:08 +01:00
<script type="text/javascript">
2019-11-28 14:36:49 +01:00
var key = "{{ .Key }}";
function vote(option){$.post( "/", {option, key}, ( data ) => { $('.modal').modal('show');});}
2019-11-27 14:42:08 +01:00
function reload(){document.location.reload(true);}
2019-11-28 11:17:06 +01:00
2019-11-27 14:42:08 +01:00
</script>
2019-11-21 13:54:40 +01:00
</head>
<body>
<div class="ui container">
2019-11-27 14:42:08 +01:00
<h1 class="ui header">Foodoles - {{.Foods.Date}}</h1><br/>
2019-11-21 13:54:40 +01:00
<h2 class="ui header">Pick Your Preferred Lunch's Food For Today</h2><br/>
2019-11-28 10:46:32 +01:00
<div class="ui ">
2019-11-27 14:42:08 +01:00
{{ range .Foods.Foods }}
2019-11-28 11:17:06 +01:00
<a onclick="vote('{{ .Title }}')" class="ui label massive" data-tooltip="{{ .Title }}" data-variation="basic" data-position="bottom center">
2019-11-27 14:42:08 +01:00
{{$cur := .Title}}
{{ .Icon }}
{{ range $.Votes.Votes }}
{{ if eq .Food $cur }}
<div class="floating ui blue left label">{{ .Voices }}</div>
{{end}}
{{end}}
</a>
2019-11-21 13:54:40 +01:00
{{ end }}
2019-11-27 14:42:08 +01:00
2019-11-21 13:54:40 +01:00
</div>
</div>
2019-11-27 14:42:08 +01:00
<div class="ui modal">
2019-11-21 13:54:40 +01:00
<div class="header">Foodoles</div>
<div class="content">
2019-11-27 14:42:08 +01:00
<p>Vote sent <strong>successfully</strong></p>
2019-11-21 13:54:40 +01:00
</div>
<div class="actions">
2019-11-27 14:42:08 +01:00
<div class="ui cancel button blue" onclick="reload()">Close</div>
2019-11-21 13:54:40 +01:00
</div>
</div>
</body>
2019-11-28 11:17:06 +01:00
<script type="text/javascript">
twemoji.parse(document.body);
</script>
2019-11-21 13:54:40 +01:00
</html>