]> code.octet-stream.net Git - broadcaster/blob - server/templates/playlist.html
Make headings consistent in UI
[broadcaster] / server / templates / playlist.html
1
2 <script type="text/javascript">
3 function deleteItem(sender) {
4 sender.parentNode.remove();
5 }
6 function addItem() {
7 const p = document.createElement('p');
8 const temp = document.getElementById('item-template');
9 p.innerHTML = temp.innerHTML;
10 const marker = document.getElementById('add-item');
11 const parent = marker.parentNode;
12 parent.insertBefore(p, marker);
13 }
14 </script>
15
16 <h1>
17 {{if .Playlist.Id}}
18 Edit Playlist
19 {{else}}
20 Create New Playlist
21 {{end}}
22 </h1>
23 <form action="/playlists/submit" method="POST">
24 <input type="hidden" name="playlistId" value="{{.Playlist.Id}}">
25 <p>
26 <input type="checkbox" id="playlistEnabled" name="playlistEnabled" value="1" {{if .Playlist.Enabled}} checked {{end}}>
27 <label for="playlistEnabled">Playlist enabled?</label><br>
28 </p>
29 <p>
30 <label for="playlistName">Name:</label>
31 <input type="text" id="playlistName" name="playlistName" value="{{.Playlist.Name}}">
32 </p>
33 <p>
34 <label for="playlistStartTime">Transmission Start:</label>
35 <input type="datetime-local" id="playlistStartTime" name="playlistStartTime" value="{{.Playlist.StartTime}}">
36 </p>
37 <h3>Playlist Items</h3>
38 {{range .Entries}}
39 <p>
40 Wait until
41 <input type="text" name="delaySeconds" value="{{.DelaySeconds}}" class="seconds">
42 seconds
43 <select name="isRelative">
44 <option value="1">from previous</option>
45 <option value="0" {{if not .IsRelative}} selected="selected" {{end}}>from start</option>
46 </select>
47 then play
48 <select name="filename">{{$f := .Filename}}
49 <option value="">(no file selected)</option>
50 {{range $.Files}}
51 <option value="{{.}}" {{if eq . $f }} selected="selected" {{end}}>{{.}}</option>
52 {{end}}
53 </select>
54 <a href="#" onclick="deleteItem(this)">(Delete)</a>
55 </p>
56 {{end}}
57 <p>
58 <a href="#" onclick="addItem()" id="add-item">Add Item</a>
59 </p>
60 <p>
61 <input type="submit" value="Save Playlist">
62 </p>
63 </form>
64 {{if .Playlist.Id}}
65 <h3>Delete</h3>
66 <form action="/playlists/delete" method="POST">
67 <input type="hidden" name="playlistId" value="{{.Playlist.Id}}">
68 <p>
69 <input type="submit" value="Delete Playlist">
70 </p>
71 </form>
72 {{end}}
73 <template id="item-template">
74 Wait until
75 <input type="text" name="delaySeconds" value="0" class="seconds">
76 seconds
77 <select name="isRelative">
78 <option value="1">from previous</option>
79 <option value="0">from start</option>
80 </select>
81 then play
82 <select name="filename">
83 <option value="">(no file selected)</option>
84 {{range $.Files}}
85 <option value="{{.}}">{{.}}</option>
86 {{end}}
87 </select>
88 <a href="#" onclick="deleteItem(this)">(Delete)</a>
89 </template>