library_detail.html
⎇
Raw
1{{define "library_detail"}}
2<div class="detail-view">
3 <div class="detail-header">
4 <h2>{{.Data.Item.Name}}</h2>
5 <details class="delete-overlay">
6 <summary role="button" class="small danger">Delete</summary>
7 <div class="overlay-panel">
8 <p>Are you sure you want to delete this item?</p>
9 <form method="post" action="/library/item/{{urlEncodePath .Data.Item.RelPath}}/delete" class="form-actions">
10 <button type="submit" class="danger">Yes, Delete</button>
11 </form>
12 </div>
13 </details>
14 </div>
15
16 {{if gt (len .Data.Item.MediaFiles) 1}}
17 <form method="get" action="/library/item/{{urlEncodePath .Data.Item.RelPath}}" class="file-selector">
18 <label for="file">Playing</label>
19 <select id="file" name="file">
20 {{range .Data.Item.MediaFiles}}
21 <option value="{{.Filename}}" {{if eq .Filename $.Data.SelectedFilename}}selected{{end}}>{{.Filename}}</option>
22 {{end}}
23 </select>
24 <button type="submit" class="secondary">Switch</button>
25 </form>
26 {{end}}
27
28 {{range .Data.Item.MediaFiles}}
29 {{if eq .Filename $.Data.SelectedFilename}}
30 <div class="player-container">
31 {{if .IsAudio}}
32 <audio controls>
33 <source src="/media/item/{{urlEncodePath $.Data.Item.RelPath}}?file={{.Filename}}" type="{{mimeType .Filepath}}">
34 Your browser does not support the audio element.
35 </audio>
36 {{else}}
37 <video controls preload="metadata">
38 <source src="/media/item/{{urlEncodePath $.Data.Item.RelPath}}?file={{.Filename}}" type="{{mimeType .Filepath}}">
39 {{range $.Data.Subtitles}}
40 <track kind="subtitles" src="{{.Src}}" srclang="{{.Lang}}" label="{{.Label}}">
41 {{end}}
42 Your browser does not support the video element.
43 </video>
44 {{end}}
45 </div>
46 {{end}}
47 {{end}}
48
49 <div class="detail-meta">
50 <dl>
51 {{if .Data.Item.SourceURL}}
52 <dt>Source URL</dt>
53 <dd><a href="{{.Data.Item.SourceURL}}" target="_blank">{{.Data.Item.SourceURL}}</a></dd>
54 {{end}}
55
56 {{if .Data.Item.Description}}
57 {{$longDesc := isLongText .Data.Item.Description}}
58 <dt>Description</dt>
59 <dd class="description{{if $longDesc}} collapsible{{end}}">
60 {{if $longDesc}}<input type="checkbox" id="desc-toggle" class="desc-toggle">{{end}}
61 <div class="desc-text">{{.Data.Item.Description}}</div>
62 {{if $longDesc}}<label for="desc-toggle" class="desc-toggle-label"></label>{{end}}
63 </dd>
64 {{end}}
65 </dl>
66
67 <details>
68 <summary role="button" class="small secondary">More Details</summary>
69 <dl>
70 {{if .Data.SelectedFilename}}
71 <dt>File</dt>
72 <dd>{{.Data.SelectedFilename}}</dd>
73 {{end}}
74
75 {{if .Data.Metadata}}
76 {{if .Data.Metadata.Container}}
77 <dt>Container</dt>
78 <dd>{{.Data.Metadata.Container}}</dd>
79 {{end}}
80
81 {{if .Data.Metadata.Resolution}}
82 <dt>Resolution</dt>
83 <dd>{{.Data.Metadata.Resolution}}</dd>
84 {{end}}
85
86 {{range .Data.Metadata.VideoStreams}}
87 <dt>Video</dt>
88 <dd>
89 {{.Codec}}
90 {{if .Profile}}({{.Profile}}){{end}}
91 {{if .Width}}[{{.Width}}x{{.Height}}]{{end}}
92 {{if .FPS}}@ {{.FPS}} fps{{end}}
93 {{if .PixelFormat}}, {{.PixelFormat}}{{end}}
94 {{if .Bitrate}}, {{.Bitrate}} kbps{{end}}
95 </dd>
96 {{end}}
97
98 {{range .Data.Metadata.AudioStreams}}
99 <dt>Audio</dt>
100 <dd>
101 {{.Codec}}
102 {{if .Language}}[{{.Language}}]{{end}}
103 {{if .SampleRate}}, {{.SampleRate}} Hz{{end}}
104 {{if .ChannelLayout}}, {{.ChannelLayout}}{{else if .Channels}}, {{.Channels}} channels{{end}}
105 {{if .SampleFormat}}, {{.SampleFormat}}{{end}}
106 {{if .Bitrate}}, {{.Bitrate}} kbps{{end}}
107 </dd>
108 {{end}}
109
110 {{range .Data.Metadata.SubtitleStreams}}
111 <dt>Subtitle</dt>
112 <dd>
113 {{.Codec}}
114 {{if .Language}}[{{.Language}}]{{end}}
115 {{if .Title}}- {{.Title}}{{end}}
116 </dd>
117 {{end}}
118
119 {{if .Data.Metadata.FileSize}}
120 <dt>File Size</dt>
121 <dd>{{formatFileSize .Data.Metadata.FileSize}}</dd>
122 {{end}}
123 {{end}}
124 </dl>
125 </details>
126 </div>
127</div>
128{{end}}
129