holiday-api/templates/admin_dashboard.gohtml

98 lines
4.8 KiB
Plaintext

<!DOCTYPE html>
<html>
<head>
<title>Holiday-api | Admin</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" href="/assets/favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="/assets/global.css">
<script src="/assets/global.js"></script>
</head>
<body>
<div class="background-image" style="position: fixed">
</div>
<header>
<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>
<main class="admin-dashboard">
<div class="filter-dialog" style="background: transparent">
<section class="dialog filter-dialog">
<h2 style="margin-top: 0.5em">Pretraga</h2>
<form action="#" method="get">
<section class="form-field">
<label for="country">Država:</label>
<select id="country" name="country">
{{range $entry := .Countries}}
<option {{if eq $.Search.Country $entry.IsoName}}selected{{end}} value="{{$entry.IsoName}}">{{$entry.Name}}</option>
{{end}}
</select>
</section>
<section class="form-field">
<label for="year">Za godinu:</label>
<select id="year" name="year">
{{range $entry := .Years}}
<option {{if intpeq $.Search.Year $entry}}selected{{end}} value="{{$entry}}">{{$entry}}</option>
{{end}}
</select>
</section>
<section class="radio-group" style="margin-top: 0.5em;">
<label>Državni praznik:</label>
<div>
<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>
<input type="hidden" value="{{.Search.StateHoliday}}" id="state-holiday" name="state_holiday">
</section>
<section class="radio-group">
<label>Religiozni praznik:</label>
<div>
<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>
<input type="hidden" value="{{.Search.ReligiousHoliday}}" id="religious-holiday" name="religious_holiday">
</section>
<div class="button-actions">
<button class="primary">Pretraži</button>
</div>
</form>
</section>
</div>
<div style="flex-grow: 1; background: transparent">
<div style="display: flex; flex-direction: row; flex-wrap: wrap; justify-content: end; background: transparent; gap: 0.5em">
<button data-type="dialog" data-trigger="#copy-year" data-url="/admin/dialogs/copy-year?year={{$.Search.Year}}&country={{$.Search.Country}}" class="secondary">Kopiraj godinu</button>
<button data-type="dialog" data-trigger="#create-card" data-url="/admin/dialogs/add-holiday" class="primary">Dodaj novi praznik</button>
</div>
<section class="dialog table-results" style="margin: 0; margin-top: 0.5em" id="results">
<table>
<thead>
<tr>
<th>Ime</th>
<th>Datum</th>
<th></th>
</tr>
</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"><span class="icon edit-icon"></span></button>
<button data-type="dialog" data-trigger="#delete-card" data-url="/admin/dialogs/delete-holiday?id={{$entry.Id}}" class="icon"><span class="icon delete-icon"></span></button>
</td>
</tr>
{{end}}
</tbody>
</table>
</section>
</div>
</main>
</body>
</html>