-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathform.html
76 lines (76 loc) · 3.66 KB
/
form.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
<html>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootswatch/4.5.2/superhero/bootstrap.min.css" integrity="sha384-HnTY+mLT0stQlOwD3wcAzSVAZbrBp141qwfR4WfTqVQKSgmcgzk+oP0ieIyrxiFO" crossorigin="anonymous">
<link rel="stylesheet" href="/static/css/all.css">
<body>
<div class="container">
{{if not .ShowForm}}
<div class="row justify-content-center mt-5">
<h1>{{.PriceDetails.OverallPrice}} to watch the {{.PriceDetails.NumFilms}} movies of {{.DirectorName}} ({{.PriceDetails.PricePerFilm}} per movie!)</h1>
<table class="table table-hover">
<tr>
<th>Movie</th>
<th>Year</th>
<th>Streaming At</th>
<th>Price</th>
</tr>
{{range .Films}}
{{$film := .FilmName}}
{{range .Streaming}}
{{if .ServiceName}}
<tr>
<td>{{$film}}</td>
<td>{{.Year}}</td>
<td>{{.ServiceName}}</td>
<td>${{.Price}}</td>
</tr>
{{end}}
{{end}}
{{if .CheapestRental.ServiceName}}
<tr>
<td>{{$film}}</td>
<td>{{.CheapestRental.Year}}</td>
<td>{{.CheapestRental.ServiceName}}</td>
<td>${{.CheapestRental.Price}}</td>
</tr>
{{end}}
{{end}}
</table>
</div>
{{else}}
<div>
<div class="row justify-content-center mt-5">
<h1>Where can I stream this director's filmography?</h1>
</div>
<div class="justify-content-center">
<form method="POST">
<div class="col-auto">
<div class="form-group">
<label class="col-form-label-lg">Director:</label><br />
<input type="text" name="directorName" class="form-control form-control-lg"><br />
</div>
<div class="form-group">
<label class="col-form-label-lg">Or Pick One:</label><br />
<select name="directorNameSelect" class="form-control form-control-lg" multiple>
{{range .Directors}}
<option value="{{.}}">{{.}}</option>
{{end}}
</select>
</div>
<div class="form-group">
<label class="col-form-label-lg">Streaming Services:</label><br />
<select name="streamingServices" class="form-control form-control-lg" multiple>
{{range .StreamingServices}}
<option value="{{.}}">{{.}}</option>
{{end}}
</select>
</div>
<button type="submit" class="btn btn-primary btn-lg">Submit</button>
</div>
</form>
</div>
</div>
</div>
{{end}}
</div>
</body>
</html>