holiday-api/templates/search.gohtml

77 lines
3.0 KiB
Plaintext
Raw Normal View History

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Holiday-api | Admin dashboard</title>
<link rel="stylesheet" href="/assets/style.css">
<script src="/assets/global.js"></script>
</head>
<body>
<div id="dialog-container"></div>
<header>
<section class="container">
<h1><a href="/">Holiday-api | {{.Search.Date.Format "2006-01-02"}}</a></h1>
</section>
</header>
<nav>
<section class="container">
<a href="/">Search</a>
<a href="/documentation">Documentation</a>
<a class="selected" href="#">For date</a>
</section>
</nav>
<main>
<section id="search">
<article class="card">
<h2 style="margin-right: 1em;">Is it a holiday?</h2>
<form method="get" action="/search">
<section>
<label for="country">Country:</label>
<select id="country" name="country">
<option {{if eq .Search.Country "HR"}}selected{{end}} value="HR">Croatia</option>
<option {{if eq .Search.Country "US"}}selected{{end}} value="US">United states</option>
<option {{if eq .Search.Country "FR"}}selected{{end}} value="FR">France</option>
<option {{if eq .Search.Country "GB"}}selected{{end}} value="GB">Great Britain</option>
</select>
</section>
<section>
<label for="date">Date:</label>
<input id="date" value="{{.Search.Date.Format "2006-01-02"}}" name="date" type="date" required>
</section>
<section class="actions">
<button style="width: 100%;" type="submit">Check is a holiday</button>
</section>
</form>
</article>
</section>
<section id="results">
<h2 style="margin-bottom: 1em;">Results</h2>
{{range $entry := .Holidays}}
<article class="single-holiday">
<table class="clean">
<tbody>
<tr>
<th>Name: </th>
<td>{{$entry.Name}}</td>
</tr>
<tr>
<th>Description: </th>
<td>{{$entry.Description}}</td>
</tr>
<tr>
<th>Is state holiday: </th>
<td><img class="icon" src="{{if $entry.IsStateHoliday}}/assets/images/done-v.svg{{else}}/assets/images/close-x.svg{{end}}"></td>
</tr>
<tr>
<th>Is religious holiday: </th>
<td><img class="icon" src="{{if $entry.IsReligiousHoliday}}/assets/images/done-v.svg{{else}}/assets/images/close-x.svg{{end}}"></td>
</tr>
</tbody>
</table>
</article>
{{end}}
</section>
</main>
</body>
</html>