Раскладка файлов после распознавния
This commit is contained in:
@@ -19,9 +19,17 @@
|
||||
.state { font-size: .8rem; padding: .1rem .5rem; border-radius: 1rem; background: #8883; white-space: nowrap; }
|
||||
.state-completed { background: #2ecc7155; }
|
||||
.state-downloading { background: #3498db55; }
|
||||
.state-recognizing { background: #9b59b655; }
|
||||
.state-review { background: #f1c40f88; }
|
||||
.state-deferred { background: #f39c1255; }
|
||||
.state-linking { background: #1abc9c55; }
|
||||
.state-done { background: #2ecc7188; }
|
||||
.state-stuck { background: #f39c1255; }
|
||||
.state-failed { background: #e74c3c55; }
|
||||
.state-cancelled { background: #95a5a655; }
|
||||
.state-reverted { background: #95a5a655; }
|
||||
.actions { display: flex; gap: .4rem; flex-wrap: wrap; }
|
||||
a.button { display: inline-block; padding: .35rem .6rem; border: 1px solid #8886; border-radius: .3rem; text-decoration: none; }
|
||||
small { color: #8888; }
|
||||
</style>
|
||||
</head>
|
||||
@@ -52,11 +60,21 @@
|
||||
{{if .Error}}<br><small>{{.Error}}</small>{{end}}
|
||||
</td>
|
||||
<td>
|
||||
{{if not .Terminal}}
|
||||
<form method="post" action="/ui/downloads/{{.ID}}/cancel">
|
||||
<button type="submit">Отклонить</button>
|
||||
</form>
|
||||
{{end}}
|
||||
<div class="actions">
|
||||
{{if .Reviewable}}
|
||||
<a class="button" href="/review/{{.ID}}">Ревью →</a>
|
||||
{{end}}
|
||||
{{if .Undoable}}
|
||||
<form method="post" action="/ui/downloads/{{.ID}}/undo">
|
||||
<button type="submit">Откатить</button>
|
||||
</form>
|
||||
{{end}}
|
||||
{{if not .Terminal}}
|
||||
<form method="post" action="/ui/downloads/{{.ID}}/cancel">
|
||||
<button type="submit">Отклонить</button>
|
||||
</form>
|
||||
{{end}}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{{else}}
|
||||
|
||||
@@ -0,0 +1,122 @@
|
||||
<!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}}
|
||||
</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>
|
||||
<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>
|
||||
Reference in New Issue
Block a user