-
Notifications
You must be signed in to change notification settings - Fork 0
/
template.html
76 lines (71 loc) · 2.19 KB
/
template.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<!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">
<title>pollbc</title>
<link href="css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<div class="navbar">
<div class="container">
<div class="navbar-header">
<a class="navbar-brand" href="/">pollbc</a>
</div>
<form class="navbar-form" action="/">
{{if .PrintDpts}}
<select class="form-control" name="departmentPK">
{{range $dep := .Departments}}
<option value="{{$dep.PK}}">{{$dep.Name}}</option>
{{end}}
</select>
{{else}}
<select class="form-control" name="placePK">
{{$dpt := index .Departments 0}}
{{range $place := .Places}}
{{if $place.City}}
<option value="{{$place.PK}}">
{{$place.City}}
</option>
{{else if $place.Arrondissement}}
<option value="{{$place.PK}}">
{{$dpt.Name}} {{$place.Arrondissement}}
</option>
{{end}}
{{end}}
</select>
{{end}}
<button class="btn btn-default" type="submit">Filter</button>
</form>
</div>
</div>
{{$placeMap := .PlaceMap}}
{{$dptMap := .DptMap}}
{{$loc := .Location}}
<div class="container">
{{range .Announces}}
<div>
<hr>
{{$fetched := .Fetched.In $loc}}
{{.Date.Format "Monday January 2 15:04"}} (fetched at {{$fetched.Format "15:04"}})
<br>
<a href={{.URL}}>{{.Title}}</a>
<br>
{{$place := index $placeMap .PlacePK}}
{{$dpt := index $dptMap $place.DepartmentPK}}
{{if $place.City}}
<a href="/?placePK={{.PlacePK}}">{{$place.City}}</a> / <a href="/?departmentPK={{$place.DepartmentPK}}">{{$dpt.Name}}</a>
{{else if $place.Arrondissement}}
<a href="/?departmentPK={{$place.DepartmentPK}}">{{$dpt.Name}}</a> <a href="/?placePK={{.PlacePK}}">{{$place.Arrondissement}}</a>
{{else}}
<a href="/?departmentPK={{$place.DepartmentPK}}">{{$dpt.Name}}</a>
{{end}}
{{if .Price}}<br><strong>{{.Price}}</strong>{{end}}
</div>
{{end}}
</div>
<script src="js/jquery-1.11.3.min.js"></script>
<script src="js/bootstrap.min.js"></script>
</body>
</html>