97 lines
4.4 KiB
Plaintext
97 lines
4.4 KiB
Plaintext
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Holiday-api</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</a></h1>
|
|
</section>
|
|
</header>
|
|
<nav>
|
|
<section class="container">
|
|
<a class="selected" href="#">Search</a>
|
|
<a href="/documentation">Documentation</a>
|
|
<button data-type="dialog" data-trigger="#check-is-a-holiday" data-url="/dialogs/check-is-a-holiday">Check is a holiday</button>
|
|
</section>
|
|
</nav>
|
|
<main>
|
|
<section id="search">
|
|
<article class="card">
|
|
<form action="/" method="get">
|
|
<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="year">Year:</label>
|
|
<select id="year" name="year">
|
|
<option {{if intpeq .Search.Year 2020}}selected{{end}} value="2020">2020</option>
|
|
<option {{if intpeq .Search.Year 2021}}selected{{end}} value="2021">2021</option>
|
|
<option {{if intpeq .Search.Year 2022}}selected{{end}} value="2022">2022</option>
|
|
<option {{if intpeq .Search.Year 2023}}selected{{end}} value="2023">2023</option>
|
|
</select>
|
|
</section>
|
|
<section class="radio-group">
|
|
<label>Is state holiday:</label>
|
|
<div>
|
|
<input type="radio" value="true" name="sh" id="sh_true"><label for="sh_true">True
|
|
</label><input type="radio" value="false" name="sh" id="sh_false"><label for="sh_false">False
|
|
</label><input type="radio" value="" name="sh" id="sh_any"><label for="sh_any">All</label>
|
|
</div>
|
|
<input type="hidden" value="{{.Search.StateHoliday}}" name="state_holiday">
|
|
</section>
|
|
<section class="radio-group">
|
|
<label>Is religious holiday:</label>
|
|
<div>
|
|
<input type="radio" value="true" name="rh" id="rh_true"><label for="rh_true">True
|
|
</label><input type="radio" value="false" name="rh" id="rh_false"><label for="rh_false">False
|
|
</label><input type="radio" value="" name="rh" id="rh_any"><label for="rh_any">All</label>
|
|
</div>
|
|
<input type="hidden" value="{{.Search.ReligiousHoliday}}" name="religious_holiday">
|
|
</section>
|
|
<section class="actions">
|
|
<button class="icon primary" type="submit">
|
|
<img class="icon" src="/assets/images/search.svg">
|
|
<span>Search</span>
|
|
</button>
|
|
</section>
|
|
</form>
|
|
</article>
|
|
</section>
|
|
<section id="results">
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Date</th>
|
|
<th>State</th>
|
|
<th>Religious</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{{range $entry := .Holidays}}
|
|
<tr>
|
|
<td>{{$entry.Name}}</td>
|
|
<td>{{$entry.Date.Format "2006-01-02"}}</td>
|
|
<td><img class="icon" src="{{if $entry.IsStateHoliday}}/assets/images/done-v.svg{{else}}/assets/images/close-x.svg{{end}}"></td>
|
|
<td><img class="icon" src="{{if $entry.IsReligiousHoliday}}/assets/images/done-v.svg{{else}}/assets/images/close-x.svg{{end}}"></td>
|
|
</tr>
|
|
{{end}}
|
|
</tbody>
|
|
</table>
|
|
</section>
|
|
</main>
|
|
</body>
|
|
</html> |