Files
jellybit/web/templates/review.html
T

167 lines
7.0 KiB
HTML

<!doctype html>
<html lang="ru">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>jellybit · ревью #{{.ID}}</title>
<style>
:root { color-scheme: light dark; }
body { font-family: system-ui, sans-serif; max-width: 70rem; margin: 2rem auto; padding: 0 1rem; }
h1 { margin-bottom: .25rem; }
a { color: inherit; }
input, button, select, textarea { padding: .4rem .6rem; font-size: 1rem; font-family: inherit; }
table { width: 100%; border-collapse: collapse; margin: .5rem 0 1rem; }
th, td { text-align: left; padding: .35rem .5rem; border-bottom: 1px solid #8884; vertical-align: top; }
td.src, li.path { font-family: monospace; font-size: .85rem; word-break: break-all; }
.err { color: #c0392b; }
.state { font-size: .8rem; padding: .1rem .5rem; border-radius: 1rem; background: #8883; }
.state-review { background: #f1c40f88; }
.state-recognizing { background: #9b59b655; }
.state-deferred { background: #f39c1255; }
section { border: 1px solid #8883; border-radius: .5rem; padding: .75rem 1rem; margin: 1rem 0; }
.reasons li { color: #b9770e; }
.row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1rem; }
.actions form { display: inline; }
.ignored td { opacity: .5; text-decoration: line-through; }
ul.preview { margin: 0; padding-left: 1.2rem; }
small { color: #8888; }
textarea { width: 100%; box-sizing: border-box; }
</style>
</head>
<body>
<p><a href="/">← к списку</a></p>
<h1>Ревью #{{.ID}} <span class="state state-{{.State}}">{{.State}}</span></h1>
<p class="src"><small>{{.Source}}</small></p>
{{if .Context}}<p>Контекст: «{{.Context}}»</p>{{end}}
{{if .Error}}<p class="err">{{.Error}}</p>{{end}}
{{if .StateError}}<p class="err">{{.StateError}}</p>{{end}}
{{if eq .State "recognizing"}}
<p>⏳ Идёт распознавание, обновите страницу через несколько секунд…</p>
<p><a href="/review/{{.ID}}">Обновить</a></p>
{{end}}
{{if .Reasons}}
<section>
<strong>Причины ревью</strong>{{if .Confidence}} · уверенность {{.Confidence}}{{end}}
<ul class="reasons">{{range .Reasons}}<li>{{.}}</li>{{end}}</ul>
</section>
{{end}}
{{if .HasPlan}}
<section>
<strong>Догадка</strong>
<p class="row">
Тип: <b>{{if .IsSeries}}сериал{{else if eq .MediaType "movie"}}фильм{{else}}{{.MediaType}}{{end}}</b>
· Название: <b>{{.Title}}</b>{{if .OriginalTitle}} <small>({{.OriginalTitle}})</small>{{end}}
{{if .Year}}· Год: <b>{{.Year}}</b>{{end}}
{{if .Provider}}· База: <b>{{.Provider}}</b> {{.ProviderID}}{{else if .NoBase}}· База: <b>без базы</b>{{end}}
</p>
<form class="row" method="post" action="/ui/downloads/{{.ID}}/type">
Переключить тип:
<button name="type" value="movie" {{if not .IsSeries}}disabled{{end}}>фильм</button>
<button name="type" value="series" {{if .IsSeries}}disabled{{end}}>сериал</button>
<small>(пересоберёт план)</small>
</form>
</section>
<section>
<strong>База метаданных</strong>
{{if .Provider}}<p>Выбрано: <b>{{.Provider}}</b> {{.ProviderID}}</p>
{{else if .NoBase}}<p>Выбрано: <b>без базы</b> (тег папки не ставится)</p>
{{else}}<p><small>Матч не подтверждён — выберите кандидата, введите id или «без базы».</small></p>{{end}}
{{if .Candidates}}
<table>
<thead><tr><th>провайдер</th><th>название</th><th>год</th><th>id</th><th></th></tr></thead>
<tbody>
{{range .Candidates}}
<tr>
<td>{{.Provider}}</td>
<td>{{.Title}}</td>
<td>{{if .Year}}{{.Year}}{{end}}</td>
<td class="src">{{.ProviderID}}</td>
<td>
<form method="post" action="/ui/downloads/{{$.ID}}/candidate">
<input type="hidden" name="candidate_id" value="{{.ID}}">
<button type="submit" {{if .Chosen}}disabled{{end}}>{{if .Chosen}}выбрано{{else}}выбрать{{end}}</button>
</form>
</td>
</tr>
{{end}}
</tbody>
</table>
{{end}}
<form class="row" method="post" action="/ui/downloads/{{.ID}}/provider">
Вручную:
<select name="provider">
<option value="tvdb">tvdb</option>
<option value="tmdb">tmdb</option>
<option value="imdb">imdb</option>
</select>
<input type="text" name="provider_id" placeholder="id (напр. 269613)" required>
<button type="submit">задать id</button>
</form>
<form method="post" action="/ui/downloads/{{.ID}}/nobase" style="margin-top:.4rem">
<button type="submit">Без базы</button>
</form>
</section>
<section>
<strong>Файлы → роль</strong>
<table>
<thead><tr><th>#</th><th>файл</th><th>роль</th><th>S</th><th>E</th><th></th></tr></thead>
<tbody>
{{range $i, $f := .Files}}
<tr {{if $f.Ignored}}class="ignored"{{end}}>
<td>{{add $i 1}}</td>
<td class="src">{{$f.Src}}</td>
<td>{{$f.Role}}</td>
<td>{{$f.Season}}</td>
<td>{{$f.Episode}}</td>
<td>
{{if not $f.Ignored}}
<form method="post" action="/ui/downloads/{{$.ID}}/ignore">
<input type="hidden" name="src" value="{{$f.Src}}">
<button type="submit">игнор</button>
</form>
{{end}}
</td>
</tr>
{{end}}
</tbody>
</table>
</section>
{{if .Preview}}
<section>
<strong>Превью раскладки</strong> <small>(будут созданы хардлинки)</small>
<ul class="preview">{{range .Preview}}<li class="path">{{.}}</li>{{end}}</ul>
</section>
{{end}}
{{end}}
<section>
<strong>Уточнить и перераспознать</strong>
<form method="post" action="/ui/downloads/{{.ID}}/refine">
<p><textarea name="hint" rows="2" placeholder="подсказка для распознавания, напр. «это второй сезон, рус+англ дорожки»"></textarea></p>
<button type="submit">🔁 Уточнить</button>
</form>
{{if .Hints}}
<p><small>Подсказки: {{range $i, $h := .Hints}}{{if $i}} · {{end}}«{{$h}}»{{end}}</small></p>
{{end}}
</section>
<div class="actions">
{{if .Preview}}
<form method="post" action="/ui/downloads/{{.ID}}/apply"><button type="submit">✅ Применить</button></form>
{{end}}
<form method="post" action="/ui/downloads/{{.ID}}/defer"><button type="submit">🕗 Позже</button></form>
<form method="post" action="/ui/downloads/{{.ID}}/cancel"><button type="submit">❌ Отклонить</button></form>
</div>
</body>
</html>