Added index and user search + docs init
This commit is contained in:
1 parent
2172b8232e
commit
eb91033eb7
6 files changed
+295
-80
No files matched your search
@@ -0,0 +1,102 @@
|
||||
<!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="/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="stateHoliday">
|
||||
|
||||
<label for="state-holiday-false">False</label>
|
||||
<input type="radio" value="false" {{if boolcmp .search.StateHoliday "false"}}checked{{end}} id="state-holiday-false" name="stateHoliday">
|
||||
|
||||
<label for="state-holiday-any">Any</label>
|
||||
<input type="radio" value="" {{if boolcmp .search.StateHoliday "nil"}}checked{{end}} id="state-holiday-any" name="stateHoliday">
|
||||
</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="religiousHoliday">
|
||||
|
||||
<label for="religious-holiday-false">False</label>
|
||||
<input type="radio" value="false" {{if boolcmp .search.ReligiousHoliday "false"}}checked{{end}} id="religious-holiday-false" name="religiousHoliday">
|
||||
|
||||
<label for="religious-holiday-any">Any</label>
|
||||
<input type="radio" value="" {{if boolcmp .search.ReligiousHoliday "nil"}}checked{{end}} id="religious-holiday-any" name="religiousHoliday">
|
||||
|
||||
</div>
|
||||
|
||||
<button type="submit">Search</button>
|
||||
</form>
|
||||
</div>
|
||||
<div>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Description</th>
|
||||
<th>Date</th>
|
||||
<th>State holiday</th>
|
||||
<th>Religious holiday</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>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,22 @@
|
||||
<!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>
|
||||
<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>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
+37
-78
@@ -7,96 +7,55 @@
|
||||
<title>Holiday-api</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Holiday-api</h1>
|
||||
<p>Welcome to admin interface for holiday api</p>
|
||||
|
||||
<h1><a href="/">Holiday-api</a></h1>
|
||||
<p>Welcome to holiday api - simple page for tracking holidays</p>
|
||||
<div>
|
||||
<a href="/admin/holiday">Add a holiday</a>
|
||||
</div>
|
||||
<div>
|
||||
<form id="filter-holidays" action="/admin" method="get">
|
||||
<h2>Is a holiday?</h2>
|
||||
<form method="get" action="/search/date">
|
||||
<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>
|
||||
<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" {{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>
|
||||
<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>
|
||||
<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="stateHoliday">
|
||||
|
||||
<label for="state-holiday-false">False</label>
|
||||
<input type="radio" value="false" {{if boolcmp .search.StateHoliday "false"}}checked{{end}} id="state-holiday-false" name="stateHoliday">
|
||||
|
||||
<label for="state-holiday-any">Any</label>
|
||||
<input type="radio" value="" {{if boolcmp .search.StateHoliday "nil"}}checked{{end}} id="state-holiday-any" name="stateHoliday">
|
||||
</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="religiousHoliday">
|
||||
|
||||
<label for="religious-holiday-false">False</label>
|
||||
<input type="radio" value="false" {{if boolcmp .search.ReligiousHoliday "false"}}checked{{end}} id="religious-holiday-false" name="religiousHoliday">
|
||||
|
||||
<label for="religious-holiday-any">Any</label>
|
||||
<input type="radio" value="" {{if boolcmp .search.ReligiousHoliday "nil"}}checked{{end}} id="religious-holiday-any" name="religiousHoliday">
|
||||
|
||||
</div>
|
||||
|
||||
<button type="submit">Search</button>
|
||||
<button type="submit">Find holidays</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Description</th>
|
||||
<th>Date</th>
|
||||
<th>State holiday</th>
|
||||
<th>Religious holiday</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>
|
||||
<h2>Create api query</h2>
|
||||
<a href="/docs">Goto query editor</a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,38 @@
|
||||
<!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>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>
|
||||
{{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>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,43 @@
|
||||
<!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