2023-06-20 16:00:12 +00:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html lang="en">
|
|
|
|
<head>
|
|
|
|
<meta charset="UTF-8">
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
2023-08-05 15:50:40 +00:00
|
|
|
<title>Holiday-api | Admin dashboard</title>
|
|
|
|
<link rel="stylesheet" href="/assets/style.css">
|
|
|
|
<script src="/assets/global.js"></script>
|
2023-06-20 16:00:12 +00:00
|
|
|
</head>
|
|
|
|
<body>
|
2023-08-05 15:50:40 +00:00
|
|
|
<div id="dialog-container"></div>
|
|
|
|
<header>
|
|
|
|
<section class="container">
|
|
|
|
<h1><a href="/">Holiday-api | Admin dashboard</a></h1>
|
|
|
|
</section>
|
|
|
|
</header>
|
|
|
|
<nav>
|
|
|
|
<section class="container">
|
|
|
|
<a class="selected" href="#">Search</a>
|
2023-08-05 19:34:09 +00:00
|
|
|
<a href="/admin/countries">Countries</a>
|
2023-08-05 15:50:40 +00:00
|
|
|
<button data-type="dialog" data-trigger="#create-card" data-url="/admin/dialogs/add-holiday">Add new 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">
|
2023-08-05 19:34:09 +00:00
|
|
|
{{range $entry := .Countries}}
|
|
|
|
<option {{if eq $.Search.Country $entry.IsoName}}selected{{end}} value="{{$entry.IsoName}}">{{$entry.Name}}</option>
|
|
|
|
{{end}}
|
2023-08-05 15:50:40 +00:00
|
|
|
</select>
|
|
|
|
</section>
|
|
|
|
<section>
|
|
|
|
<label for="year">Year:</label>
|
|
|
|
<select id="year" name="year">
|
2023-08-05 19:34:09 +00:00
|
|
|
<option value="2020" {{if eq (deferint .Search.Year) 2020}}selected{{end}}>2020</option>
|
|
|
|
<option value="2021" {{if eq (deferint .Search.Year) 2021}}selected{{end}}>2021</option>
|
|
|
|
<option value="2022" {{if eq (deferint .Search.Year) 2022}}selected{{end}}>2022</option>
|
|
|
|
<option value="2023" {{if eq (deferint .Search.Year) 2023}}selected{{end}}>2023</option>
|
|
|
|
<option value="2024" {{if eq (deferint .Search.Year) 2024}}selected{{end}}>2024</option>
|
|
|
|
<option value="2025" {{if eq (deferint .Search.Year) 2025}}selected{{end}}>2025</option>
|
|
|
|
<option value="2026" {{if eq (deferint .Search.Year) 2026}}selected{{end}}>2026</option>
|
|
|
|
<option value="2027" {{if eq (deferint .Search.Year) 2027}}selected{{end}}>2027</option>
|
2023-08-05 15:50:40 +00:00
|
|
|
</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>
|
2023-08-05 19:34:09 +00:00
|
|
|
<input type="hidden" value="{{.Search.StateHoliday}}" name="state_holiday">
|
2023-08-05 15:50:40 +00:00
|
|
|
</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>
|
2023-08-05 19:34:09 +00:00
|
|
|
<input type="hidden" value="{{.Search.ReligiousHoliday}}" name="religious_holiday">
|
2023-08-05 15:50:40 +00:00
|
|
|
</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>
|
2023-06-20 16:00:12 +00:00
|
|
|
<tr>
|
|
|
|
<th>Name</th>
|
|
|
|
<th>Date</th>
|
2023-08-05 15:50:40 +00:00
|
|
|
<th>State</th>
|
|
|
|
<th>Religious</th>
|
2023-06-20 16:00:12 +00:00
|
|
|
<th></th>
|
|
|
|
</tr>
|
2023-08-05 15:50:40 +00:00
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
|
2023-08-05 19:34:09 +00:00
|
|
|
{{range $entry := .Holidays.Holidays}}
|
2023-08-05 15:50:40 +00:00
|
|
|
<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>
|
|
|
|
<td>
|
|
|
|
<button data-type="dialog" data-trigger="#update-card" data-url="/admin/dialogs/edit-holiday?id={{$entry.Id}}" class="icon"><img class="icon" src="/assets/images/edit.svg"></button>
|
|
|
|
<button data-type="dialog" data-trigger="#delete-card" data-url="/admin/dialogs/delete-holiday?id={{$entry.Id}}" class="icon"><img class="icon" src="/assets/images/trash-delete.svg"></button>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
{{end}}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</section>
|
|
|
|
</main>
|
2023-06-20 16:00:12 +00:00
|
|
|
</body>
|
|
|
|
</html>
|