2 <script type=
"text/javascript">
3 function deleteItem(sender) {
4 sender.parentNode.remove();
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);
16 <h1>A specific playlist
</h1>
24 <form action=
"/playlists/submit" method=
"POST">
25 <input type=
"hidden" name=
"playlistId" value=
"{{.Playlist.Id}}">
27 <input type=
"checkbox" id=
"playlistEnabled" name=
"playlistEnabled" value=
"1" {{if .Playlist.Enabled}} checked {{end}}
>
28 <label for=
"playlistEnabled">Playlist enabled?
</label><br>
31 <label for=
"playlistName">Name:
</label>
32 <input type=
"text" id=
"playlistName" name=
"playlistName" value=
"{{.Playlist.Name}}">
35 <label for=
"playlistStartTime">Transmission Start:
</label>
36 <input type=
"datetime-local" id=
"playlistStartTime" name=
"playlistStartTime" value=
"{{.Playlist.StartTime}}">
38 <h3>Playlist Items
</h3>
42 <input type=
"text" name=
"delaySeconds" value=
"{{.DelaySeconds}}" class=
"seconds">
44 <select name=
"isRelative">
45 <option value=
"1">from previous
</option>
46 <option value=
"0" {{if not .IsRelative}}
selected=
"selected" {{end}}
>from start
</option>
49 <select name=
"filename">{{$f := .Filename}}
50 <option value=
"">(no file selected)
</option>
52 <option value=
"{{.}}" {{if eq . $f }}
selected=
"selected" {{end}}
>{{.}}
</option>
55 <a href=
"#" onclick=
"deleteItem(this)">(Delete)
</a>
59 <a href=
"#" onclick=
"addItem()" id=
"add-item">Add Item
</a>
62 <input type=
"submit" value=
"Save Playlist">
67 <form action=
"/playlists/delete" method=
"POST">
68 <input type=
"hidden" name=
"playlistId" value=
"{{.Playlist.Id}}">
70 <input type=
"submit" value=
"Delete Playlist">
74 <template id=
"item-template">
76 <input type=
"text" name=
"delaySeconds" value=
"0" class=
"seconds">
78 <select name=
"isRelative">
79 <option value=
"1">from previous
</option>
80 <option value=
"0">from start
</option>
83 <select name=
"filename">
84 <option value=
"">(no file selected)
</option>
86 <option value=
"{{.}}">{{.}}
</option>
89 <a href=
"#" onclick=
"deleteItem(this)">(Delete)
</a>