holiday-api/templates/admin_dashboard.gohtml

95 lines
4.4 KiB
Plaintext
Raw Normal View History

<!DOCTYPE html>
2024-01-01 11:29:59 +00:00
<html>
<head>
2024-01-01 11:29:59 +00:00
<title>Holiday-api | Admin</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" href="favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="/assets/global.css">
<script src="/assets/global.js"></script>
</head>
<body>
2024-01-01 11:29:59 +00:00
<div class="background-image" style="position: fixed">
</div>
<header>
2024-01-01 11:29:59 +00:00
<h1><a href="/admin?country=HR">Holiday-api | Admin</a></h1>
<div style="flex-grow: 1"></div>
<a style="all: unset;" href="/admin/countries">Države</a>
</header>
2024-01-01 11:29:59 +00:00
<main class="admin-dashboard">
<div class="filter-dialog">
<section class="dialog filter-dialog">
<h2 style="margin-top: 0.5em">Pretraga</h2>
<form action="#" method="get">
2024-01-01 11:29:59 +00:00
<section class="form-field">
<label for="country">Država:</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}}
</select>
</section>
2024-01-01 11:29:59 +00:00
<section class="form-field">
<label for="year">Za godinu:</label>
<select id="year" name="year">
2023-08-05 19:49:33 +00:00
{{range $entry := .Years}}
<option {{if intpeq $.Search.Year $entry}}selected{{end}} value="{{$entry}}">{{$entry}}</option>
{{end}}
</select>
</section>
2024-01-01 11:29:59 +00:00
<section class="radio-group" style="margin-top: 0.5em;">
<label>Državni praznik:</label>
<div>
2024-01-01 11:29:59 +00:00
<input type="radio" value="true" name="sh" id="sh_true"><label for="sh_true">Da
</label><input type="radio" value="false" name="sh" id="sh_false"><label for="sh_false">Ne
</label><input type="radio" value="" name="sh" id="sh_any"><label for="sh_any">Svi</label>
</div>
2024-01-01 11:29:59 +00:00
<input type="hidden" value="{{.Search.StateHoliday}}" id="state-holiday" name="state_holiday">
</section>
<section class="radio-group">
2024-01-01 11:29:59 +00:00
<label>Religiozni praznik:</label>
<div>
2024-01-01 11:29:59 +00:00
<input type="radio" value="true" name="rh" id="rh_true"><label for="rh_true">Da
</label><input type="radio" value="false" name="rh" id="rh_false"><label for="rh_false">Ne
</label><input type="radio" value="" name="rh" id="rh_any"><label for="rh_any">Svi</label>
</div>
2024-01-01 11:29:59 +00:00
<input type="hidden" value="{{.Search.ReligiousHoliday}}" id="religious-holiday" name="religious_holiday">
</section>
2024-01-01 11:29:59 +00:00
<div class="button-actions">
<button class="primary">Pretraži</button>
</div>
</form>
2024-01-01 11:29:59 +00:00
</section>
</div>
2024-01-01 11:29:59 +00:00
<div style="flex-grow: 1">
<button style="float: right; margin-top: 0" data-type="dialog" data-trigger="#create-card" data-url="/admin/dialogs/add-holiday" class="primary">Dodaj novi praznik</button>
<section class="dialog table-results" style="margin: 0; margin-top: 3.5em" id="results">
<table>
<thead>
<tr>
2024-01-01 11:29:59 +00:00
<th>Ime</th>
<th>Datum</th>
<th></th>
</tr>
2024-01-01 11:29:59 +00:00
</thead>
<tbody>
{{range $entry := .Holidays.Holidays}}
<tr>
<td>{{$entry.Name}}</td>
<td>{{$entry.Date.Format "02.01.2006"}}</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/icons/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/icons/trash-delete.svg"></button>
</td>
</tr>
{{end}}
</tbody>
</table>
</section>
</div>
</main>
</body>
</html>