Updated design + added documentation page
This commit is contained in:
1 parent
c33a883c34
commit
76a3c446da
25 files changed
+1080
-448
No files matched your search
@@ -2,104 +2,105 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Holiday-api</title>
|
||||
<title>Holiday-api | Admin dashboard</title>
|
||||
<link rel="stylesheet" href="/assets/style.css">
|
||||
<script src="/assets/global.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<style>
|
||||
* {font-family: system-ui}
|
||||
</style>
|
||||
<h1><a href="/admin">Holiday-api</a></h1>
|
||||
<p>Welcome to admin interface for holiday api</p>
|
||||
|
||||
<div>
|
||||
<a href="/admin/holiday">Add a holiday</a>
|
||||
</div>
|
||||
<div>
|
||||
<form id="filter-holidays" action="/admin" method="get">
|
||||
<label for="country">Country</label>
|
||||
<select id="country" name="country">
|
||||
<option value="HR" {{if eq .search.Country "HR"}}selected{{end}}>Croatia</option>
|
||||
<option value="GB" {{if eq .search.Country "GB"}}selected{{end}}>Great Britain</option>
|
||||
<option value="US" {{if eq .search.Country "US"}}selected{{end}}>USA</option>
|
||||
<option value="FR" {{if eq .search.Country "FR"}}selected{{end}}>France</option>
|
||||
</select>
|
||||
|
||||
|
||||
<label for="year">Year</label>
|
||||
<select id="year" name="year">
|
||||
<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>
|
||||
</select>
|
||||
|
||||
<div>
|
||||
<label>State holiday</label>
|
||||
|
||||
<label for="state-holiday-true">True</label>
|
||||
<input type="radio" value="true" {{if boolcmp .search.StateHoliday "true"}}checked{{end}} id="state-holiday-true" name="state_holiday">
|
||||
|
||||
<label for="state-holiday-false">False</label>
|
||||
<input type="radio" value="false" {{if boolcmp .search.StateHoliday "false"}}checked{{end}} id="state-holiday-false" name="state_holiday">
|
||||
|
||||
<label for="state-holiday-any">Any</label>
|
||||
<input type="radio" value="" {{if boolcmp .search.StateHoliday "nil"}}checked{{end}} id="state-holiday-any" name="state_holiday">
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label>Religious holiday</label>
|
||||
|
||||
<label for="religious-holiday-true">True</label>
|
||||
<input type="radio" value="true" {{if boolcmp .search.ReligiousHoliday "true"}}checked{{end}} id="religious-holiday-true" name="religious_holiday">
|
||||
|
||||
<label for="religious-holiday-false">False</label>
|
||||
<input type="radio" value="false" {{if boolcmp .search.ReligiousHoliday "false"}}checked{{end}} id="religious-holiday-false" name="religious_holiday">
|
||||
|
||||
<label for="religious-holiday-any">Any</label>
|
||||
<input type="radio" value="" {{if boolcmp .search.ReligiousHoliday "nil"}}checked{{end}} id="religious-holiday-any" name="religious_holiday">
|
||||
|
||||
</div>
|
||||
|
||||
<button type="submit">Search</button>
|
||||
</form>
|
||||
</div>
|
||||
<div>
|
||||
<table>
|
||||
<thead>
|
||||
<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>
|
||||
<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">
|
||||
<option value="HR" {{if eq .search.Country "HR"}}selected{{end}}>Croatia</option>
|
||||
<option value="GB" {{if eq .search.Country "GB"}}selected{{end}}>Great Britain</option>
|
||||
<option value="US" {{if eq .search.Country "US"}}selected{{end}}>USA</option>
|
||||
<option value="FR" {{if eq .search.Country "FR"}}selected{{end}}>France</option>
|
||||
</select>
|
||||
</section>
|
||||
<section>
|
||||
<label for="year">Year:</label>
|
||||
<select id="year" name="year">
|
||||
<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>
|
||||
</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>Description</th>
|
||||
<th>Date</th>
|
||||
<th>State holiday</th>
|
||||
<th>Religious holiday</th>
|
||||
<th>State</th>
|
||||
<th>Religious</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{range $entry := .holidays.Holidays}}
|
||||
<tr>
|
||||
<td>{{$entry.Name}}</td>
|
||||
<td>{{$entry.Description}}</td>
|
||||
<td>{{$entry.Date.Format "2006-01-02"}}</td>
|
||||
<td>{{$entry.IsStateHoliday}}</td>
|
||||
<td>{{$entry.IsReligiousHoliday}}</td>
|
||||
<td>
|
||||
<a href="/admin/holiday?id={{$entry.Id}}">Edit</a>
|
||||
<form action="/admin/holiday/delete" method="post">
|
||||
<input id="id" type="hidden" name="id" value="{{$entry.Id}}">
|
||||
<button type="submit">Delete</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
{{end}}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
{{range $entry := .holidays.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>
|
||||
<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>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,36 @@
|
||||
<dialog class="card" id="create-card">
|
||||
<h3 class="card-title">Create holiday</h3>
|
||||
<form method="post" action="/admin/holidays">
|
||||
<section>
|
||||
<label for="country">Country:</label>
|
||||
<select id="country" required name="country">
|
||||
<option value="HR">Croatia</option>
|
||||
<option value="US">United states</option>
|
||||
<option value="FR">France</option>
|
||||
<option value="GB">Great Britain</option>
|
||||
</select>
|
||||
</section>
|
||||
<section>
|
||||
<label for="name">Name:</label>
|
||||
<input required id="name" name="name" type="text">
|
||||
</section>
|
||||
<section>
|
||||
<label for="description">Description:</label>
|
||||
<textarea id="description" name="description"></textarea>
|
||||
</section>
|
||||
<section>
|
||||
<label for="date">Date:</label>
|
||||
<input required id="date" name="date" type="date">
|
||||
</section>
|
||||
<section>
|
||||
<label class="checkbox"><span>State holiday</span><input id="state_holiday" value="true" name="state_holiday" type="checkbox"></label>
|
||||
</section>
|
||||
<section>
|
||||
<label class="checkbox"><span>Religious holiday</span><input id="religious_holiday" value="true" name="religious_holiday" type="checkbox"></label>
|
||||
</section>
|
||||
<section class="actions">
|
||||
<button type="submit">Create</button>
|
||||
<button type="button" onclick="closeDialog('#create-card')">Cancel</button>
|
||||
</section>
|
||||
</form>
|
||||
</dialog>
|
||||
@@ -0,0 +1,24 @@
|
||||
<dialog class="card" data-closeable id="check-is-a-holiday">
|
||||
<div style="display: flex;">
|
||||
<h2 style="margin-right: 1em;">Is it a holiday?</h2>
|
||||
<button onclick="closeDialog('#check-is-a-holiday')" class="clean icon"><img class="icon" src="/assets/images/close-x.svg"></button>
|
||||
</div>
|
||||
<form method="get" action="/search">
|
||||
<section>
|
||||
<label for="country">Country:</label>
|
||||
<select id="country" name="country">
|
||||
<option value="HR">Croatia</option>
|
||||
<option value="US">United states</option>
|
||||
<option value="FR">France</option>
|
||||
<option value="GB">Great Britain</option>
|
||||
</select>
|
||||
</section>
|
||||
<section>
|
||||
<label for="date">Date:</label>
|
||||
<input id="date" name="date" type="date" required>
|
||||
</section>
|
||||
<section class="actions">
|
||||
<button style="width: 100%;" type="submit">Check is a holiday</button>
|
||||
</section>
|
||||
</form>
|
||||
</dialog>
|
||||
@@ -0,0 +1,11 @@
|
||||
|
||||
<dialog class="card" id="delete-card">
|
||||
<h3 class="card-title">Delete holiday</h3>
|
||||
<p>Are you sure you want to delete "{{.Holiday.Name}}"?</p>
|
||||
<form method="post" action="/admin/holidays/{{.Holiday.Id}}/delete">
|
||||
<section class="actions">
|
||||
<button type="submit">Delete</button>
|
||||
<button type="button" onclick="closeDialog('#delete-card')">Cancel</button>
|
||||
</section>
|
||||
</form>
|
||||
</dialog>
|
||||
@@ -0,0 +1,37 @@
|
||||
<dialog class="card" id="update-card">
|
||||
<h3 class="card-title">Edit holiday</h3>
|
||||
<form method="post" action="/admin/holidays">
|
||||
<input type="hidden" name="id" value="{{.Holiday.Id}}">
|
||||
<section>
|
||||
<label for="country">Country:</label>
|
||||
<select id="country" required name="country">
|
||||
<option {{if eq .Holiday.Country "HR"}}selected{{end}} value="HR">Croatia</option>
|
||||
<option {{if eq .Holiday.Country "US"}}selected{{end}} value="US">United states</option>
|
||||
<option {{if eq .Holiday.Country "FR"}}selected{{end}} value="FR">France</option>
|
||||
<option {{if eq .Holiday.Country "GB"}}selected{{end}} value="GB">Great Britain</option>
|
||||
</select>
|
||||
</section>
|
||||
<section>
|
||||
<label for="name">Name:</label>
|
||||
<input required id="name" value="{{.Holiday.Name}}" name="name" type="text">
|
||||
</section>
|
||||
<section>
|
||||
<label for="description">Description:</label>
|
||||
<textarea id="description" name="description">{{.Holiday.Description}}</textarea>
|
||||
</section>
|
||||
<section>
|
||||
<label for="date">Date:</label>
|
||||
<input required id="date" value="{{.Holiday.Date.Format "2006-01-02"}}" name="date" type="date">
|
||||
</section>
|
||||
<section>
|
||||
<label class="checkbox"><span>State holiday</span><input id="state_holiday" value="true" {{if .Holiday.IsStateHoliday}}checked{{end}} name="state_holiday" type="checkbox"></label>
|
||||
</section>
|
||||
<section>
|
||||
<label class="checkbox"><span>Religious holiday</span><input id="religious_holiday" value="true" {{if .Holiday.IsReligiousHoliday}}checked{{end}} name="religious_holiday" type="checkbox"></label>
|
||||
</section>
|
||||
<section class="actions">
|
||||
<button type="submit">Update</button>
|
||||
<button type="button" onclick="closeDialog('#update-card')">Cancel</button>
|
||||
</section>
|
||||
</form>
|
||||
</dialog>
|
||||
@@ -1,104 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Holiday-api</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1><a href="/">Holiday-api</a></h1>
|
||||
<p>Create query</p>
|
||||
|
||||
<form>
|
||||
<label for="country">Country</label>
|
||||
<select id="country" name="country">
|
||||
<option value="HR">Croatia</option>
|
||||
<option value="GB">Great Britain</option>
|
||||
<option value="US">USA</option>
|
||||
<option value="FR">France</option>
|
||||
</select>
|
||||
|
||||
<div>
|
||||
<label>Date selector</label>
|
||||
<br>
|
||||
|
||||
<div style="border: 1px solid black">
|
||||
<label for="date-year">Select year</label>
|
||||
<input type="radio" id="date-year" name="date-selector" value="year">
|
||||
|
||||
<label for="date-year-year">Year</label>
|
||||
<select id="date-year-year" name="year">
|
||||
<option value="2020">2020</option>
|
||||
<option value="2021">2021</option>
|
||||
<option value="2022">2022</option>
|
||||
<option value="2023">2023</option>
|
||||
<option value="2024">2024</option>
|
||||
<option value="2025">2025</option>
|
||||
<option value="2026">2026</option>
|
||||
<option value="2027">2027</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div style="border: 1px solid black">
|
||||
<label for="date-date">Select date</label>
|
||||
<input type="radio" id="date-date" name="date-selector" value="date">
|
||||
|
||||
<label for="date-date-date">Date</label>
|
||||
<input type="date" id="date-date-date" name="date-date-date">
|
||||
</div>
|
||||
|
||||
<div style="border: 1px solid black">
|
||||
<label for="date-date-range">Select date range</label>
|
||||
<input type="radio" id="date-date-range" name="date-selector" value="date-range">
|
||||
|
||||
<label for="date-date-start-range">Start range</label>
|
||||
<input type="date" id="date-date-start-range" name="date-date-start-range">
|
||||
|
||||
<label for="date-date-start-range-required">Required</label>
|
||||
<input type="checkbox" id="date-date-start-range-required" name="date-date-start-range-required">
|
||||
|
||||
<label for="date-date-end-range">End range</label>
|
||||
<input type="date" id="date-date-end-range" name="date-date-end-range">
|
||||
|
||||
<label for="date-date-end-range-required">Required</label>
|
||||
<input type="checkbox" id="date-date-end-range-required" name="date-date-end-range-required">
|
||||
|
||||
</div>
|
||||
|
||||
<div style="border: 1px solid black">
|
||||
<label for="date-all">All</label>
|
||||
<input type="radio" id="date-all" name="date-selector" value="all">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label>State holiday</label>
|
||||
<br>
|
||||
|
||||
<label for="state-holiday-true">True</label>
|
||||
<input type="radio" value="true" id="state-holiday-true" name="stateHoliday">
|
||||
|
||||
<label for="state-holiday-false">False</label>
|
||||
<input type="radio" value="false" id="state-holiday-false" name="stateHoliday">
|
||||
|
||||
<label for="state-holiday-any">Any</label>
|
||||
<input type="radio" value="" id="state-holiday-any" name="stateHoliday">
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label>Religious holiday</label>
|
||||
<br>
|
||||
|
||||
<label for="religious-holiday-true">True</label>
|
||||
<input type="radio" value="true" id="religious-holiday-true" name="religiousHoliday">
|
||||
|
||||
<label for="religious-holiday-false">False</label>
|
||||
<input type="radio" value="false" id="religious-holiday-false" name="religiousHoliday">
|
||||
|
||||
<label for="religious-holiday-any">Any</label>
|
||||
<input type="radio" value="" id="religious-holiday-any" name="religiousHoliday">
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,133 @@
|
||||
<!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>
|
||||
<script src="/assets/documentation.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 href="/">Search</a>
|
||||
<a class="selected" href="#">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="query">
|
||||
<article class="card" style="margin: 1em;">
|
||||
<form id="query-generator">
|
||||
<section>
|
||||
<label for="country">Country</label>
|
||||
<select id="country" name="country">
|
||||
<option value="HR">Croatia</option>
|
||||
<option value="GB">Great Britain</option>
|
||||
<option value="US">USA</option>
|
||||
<option value="FR">France</option>
|
||||
</select>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<label for="content-type">Content type</label>
|
||||
<select id="content-type" name="content-type">
|
||||
<option value="application/json">JSON</option>
|
||||
<option value="application/xml">XML</option>
|
||||
<option value="text/csv">CSV</option>
|
||||
</select>
|
||||
</section>
|
||||
|
||||
<article class="optional-selector">
|
||||
<div class="header">
|
||||
<section>
|
||||
<label for="date-selector">Date selector</label>
|
||||
<select data-type="section-selector" data-selector-prefix="date-selector" id="date-selector" name="date-selector">
|
||||
<option value="year">Select year</option>
|
||||
<option value="date">Select date</option>
|
||||
<option value="range">Select date range</option>
|
||||
<option value="all">All</option>
|
||||
</select>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<div data-section-id="date-selector-year">
|
||||
<section>
|
||||
<label for="dsy-year">Year</label>
|
||||
<select id="dsy-year" name="year">
|
||||
<option value="2020">2020</option>
|
||||
<option value="2021">2021</option>
|
||||
<option value="2022">2022</option>
|
||||
<option value="2023">2023</option>
|
||||
<option value="2024">2024</option>
|
||||
<option value="2025">2025</option>
|
||||
<option value="2026">2026</option>
|
||||
<option value="2027">2027</option>
|
||||
</select>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<div data-section-id="date-selector-date">
|
||||
<section>
|
||||
<label for="dsd-date">Date</label>
|
||||
<input type="date" id="dsd-date" name="dsd-date">
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<div data-section-id="date-selector-range">
|
||||
<section>
|
||||
<label for="dsr-start-range">Start range</label>
|
||||
<input type="date" id="dsr-start-range" name="dsr-start-range">
|
||||
</section>
|
||||
<section>
|
||||
<label for="dsr-start-range-required">Required</label>
|
||||
<input type="checkbox" id="dsr-start-range-required" name="dsr-start-range-required">
|
||||
</section>
|
||||
<section>
|
||||
<label for="dsr-end-range">End range</label>
|
||||
<input type="date" id="dsr-end-range" name="dsr-end-range">
|
||||
</section>
|
||||
<section>
|
||||
<label for="dsr-end-range-required">Required</label>
|
||||
<input type="checkbox" id="dsr-end-range-required" name="dsr-end-range-required">
|
||||
</section>
|
||||
</div>
|
||||
</article>
|
||||
|
||||
<section class="radio-group" style="margin-top: 0.5em;">
|
||||
<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" id="state-holiday" 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" id="religious-holiday" name="religious_holiday">
|
||||
</section>
|
||||
</form>
|
||||
</article>
|
||||
</section>
|
||||
<section id="result" style="flex-grow: 1; margin: 1em;">
|
||||
<h3 style="margin-bottom: 1em;">Query</h3>
|
||||
<article id="result-content" class="card source-code">
|
||||
Loading...
|
||||
</article>
|
||||
</section>
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,5 +0,0 @@
|
||||
<html>
|
||||
<body>
|
||||
<h1>Test for error</h1>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,44 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Holiday-api holiday</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Holiday-api - {{if .Id}}Updating{{else}}Creating{{end}}</h1>
|
||||
<p>Page for creating or editing holidays</p>
|
||||
<a href="/admin">Back</a>
|
||||
<form method="post" action="/admin/holiday">
|
||||
{{if .Id}}
|
||||
<input type="hidden" id="id" name="id" value="{{.Id}}">
|
||||
{{end}}
|
||||
|
||||
<label for="country">Country</label>
|
||||
<select id="country" name="country">
|
||||
<option value="HR" {{if eq .Country "HR"}}selected{{end}}>Croatia</option>
|
||||
<option value="US" {{if eq .Country "US"}}selected{{end}}>USA</option>
|
||||
<option value="GB" {{if eq .Country "GB"}}selected{{end}}>Great Britain</option>
|
||||
<option value="FR" {{if eq .Country "FR"}}selected{{end}}>France</option>
|
||||
</select>
|
||||
|
||||
<label for="name">Name</label>
|
||||
<input type="text" id="name" name="name" value="{{.Name}}">
|
||||
|
||||
<label for="description">Description</label>
|
||||
<textarea id="description" name="description">{{.Description}}</textarea>
|
||||
|
||||
<label for="date">Date</label>
|
||||
<input type="date" id="date" name="date" value="{{.Date.String}}">
|
||||
|
||||
<label for="state-holiday">State holiday</label>
|
||||
<input type="checkbox" id="state-holiday" value="true" name="stateHoliday" {{if .IsStateHoliday}}checked{{end}}>
|
||||
|
||||
<label for="religious-holiday">Religious holiday</label>
|
||||
<input type="checkbox" id="religious-holiday" value="true" name="religiousHoliday" {{if .IsReligiousHoliday}}checked{{end}}>
|
||||
|
||||
<button type="submit">{{if .Id}}Update{{else}}Create{{end}}</button>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
+87
-52
@@ -2,61 +2,96 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<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>
|
||||
<h1><a href="/">Holiday-api</a></h1>
|
||||
<p>Welcome to holiday api - simple page for tracking holidays</p>
|
||||
<div>
|
||||
<h2>Is a holiday?</h2>
|
||||
<form method="get" action="/search/date">
|
||||
<label for="country">Country</label>
|
||||
<select id="country" name="country">
|
||||
<option value="HR">Croatia</option>
|
||||
<option value="GB">Great Britain</option>
|
||||
<option value="US">USA</option>
|
||||
<option value="FR">France</option>
|
||||
</select>
|
||||
|
||||
<label for="date">Date</label>
|
||||
<input id="date" name="date" type="date">
|
||||
|
||||
<button type="submit">Check is a holiday</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<h2>Find holidays for</h2>
|
||||
<form method="get" action="/search">
|
||||
<label for="country">Country</label>
|
||||
<select id="country" name="country">
|
||||
<option value="HR">Croatia</option>
|
||||
<option value="GB">Great Britain</option>
|
||||
<option value="US">USA</option>
|
||||
<option value="FR">France</option>
|
||||
</select>
|
||||
|
||||
<label for="year">Year</label>
|
||||
<select id="year" name="year">
|
||||
<option value="2020">2020</option>
|
||||
<option value="2021">2021</option>
|
||||
<option value="2022">2022</option>
|
||||
<option value="2023">2023</option>
|
||||
<option value="2024">2024</option>
|
||||
<option value="2025">2025</option>
|
||||
<option value="2026">2026</option>
|
||||
<option value="2027">2027</option>
|
||||
</select>
|
||||
<button type="submit">Find holidays</button>
|
||||
</form>
|
||||
</div>
|
||||
<!--
|
||||
<div>
|
||||
<h2>Create api query</h2>
|
||||
<a href="/docs">Goto query editor</a>
|
||||
</div>
|
||||
-->
|
||||
<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>
|
||||
+66
-27
@@ -2,37 +2,76 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Holiday-api</title>
|
||||
<title>Holiday-api | Admin dashboard</title>
|
||||
<link rel="stylesheet" href="/assets/style.css">
|
||||
<script src="/assets/global.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<h1><a href="/">Holiday-api</a></h1>
|
||||
<p>Search results</p>
|
||||
|
||||
<div>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Description</th>
|
||||
<th>Date</th>
|
||||
<th>State holiday</th>
|
||||
<th>Religious holiday</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<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}}
|
||||
<tr>
|
||||
<td>{{$entry.Name}}</td>
|
||||
<td>{{$entry.Description}}</td>
|
||||
<td>{{$entry.Date.Format "2006-01-02"}}</td>
|
||||
<td>{{$entry.IsStateHoliday}}</td>
|
||||
<td>{{$entry.IsReligiousHoliday}}</td>
|
||||
</tr>
|
||||
<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}}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,43 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Holiday-api</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1><a href="/">Holiday-api</a></h1>
|
||||
|
||||
<p>{{if .Holidays}}Yes it is a holday{{else}}No it isn't a holiday{{end}}</p>
|
||||
|
||||
<p>Search results</p>
|
||||
|
||||
<div>
|
||||
{{if .Holidays}}
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Description</th>
|
||||
<th>Date</th>
|
||||
<th>State holiday</th>
|
||||
<th>Religious holiday</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{range $entry := .Holidays}}
|
||||
<tr>
|
||||
<td>{{$entry.Name}}</td>
|
||||
<td>{{$entry.Description}}</td>
|
||||
<td>{{$entry.Date.Format "2006-01-02"}}</td>
|
||||
<td>{{$entry.IsStateHoliday}}</td>
|
||||
<td>{{$entry.IsReligiousHoliday}}</td>
|
||||
</tr>
|
||||
{{end}}
|
||||
</tbody>
|
||||
</table>
|
||||
{{end}}
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Reference in new issue
Block a user