Список: скрытие cancelled, значок типа, ellipsis имени .torrent

Три мелкие правки веб-UI списка загрузок:

- Скрываем cancelled в общем списке наравне с deleted: под группой all
  без IncludeDeleted теперь `state NOT IN (deleted, cancelled)`. reverted
  остаётся видимым. Тумблер и комментарии-инварианты приведены в
  соответствие («включая отменённые и удалённые»).
- Значок типа (🎬 фильм / 📺 сериал) в строке списка: media_type текущей
  попытки распознавания протянут через LEFT JOIN в ListDownloadsPage
  (Download.RecMediaType, симметрично RecTitle) и downloadView.MediaType;
  значок рендерится в card.html, при нераспознанном типе значка нет.
- Ellipsis для длинного имени .torrent-файла: у .btn-file max-width +
  overflow/ellipsis на лейбле, чтобы длинное имя не распирало .add-row;
  показываем базовое имя без .torrent, полное — в title (JS-энхансмент).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
av
2026-07-11 09:31:27 +03:00
co-authored by Claude Opus 4.8
parent e8ce828296
commit 44c5952e49
7 changed files with 74 additions and 20 deletions
+2 -1
View File
@@ -191,7 +191,8 @@ a:hover{text-decoration:underline}
padding:var(--sp-4);box-shadow:var(--shadow-sm);margin-bottom:var(--sp-5)}
.add-row{display:flex;gap:var(--sp-2)}
.add-row .input{flex:1}
.btn-file{color:var(--text-dim);font-weight:500}
.btn-file{color:var(--text-dim);font-weight:500;max-width:14rem;overflow:hidden}
.btn-file [data-file-label]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
.btn-file.has-file{color:var(--accent);border-color:var(--accent)}
.add-hint{margin:9px 2px 0;font-size:var(--fs-xs);color:var(--text-faint)}
+2 -2
View File
@@ -26,7 +26,7 @@
<label class="btn btn-file" title="Выбрать .torrent-файл">
<span data-file-label>.torrent</span>
<input type="file" name="torrent" accept=".torrent,application/x-bittorrent" hidden
onchange="var l=this.closest('.btn-file'),s=l.querySelector('[data-file-label]');s.textContent=this.files.length?this.files[0].name:'.torrent';l.classList.toggle('has-file',!!this.files.length)">
onchange="var l=this.closest('.btn-file'),s=l.querySelector('[data-file-label]'),f=this.files[0];s.textContent=f?f.name.replace(/\.torrent$/i,''):'.torrent';l.title=f?f.name:'Выбрать .torrent-файл';l.classList.toggle('has-file',!!f)">
</label>
<button class="btn btn-primary btn-lg" type="submit">Добавить</button>
</div>
@@ -49,7 +49,7 @@
</div>
<div class="toggle-line">
<a href="{{.ShowURL}}">{{if .ShowAll}}☑{{else}}☐{{end}} Показать всё, включая удалённые</a>
<a href="{{.ShowURL}}">{{if .ShowAll}}☑{{else}}☐{{end}} Показать всё, включая отменённые и удалённые</a>
</div>
{{end}}
+1 -1
View File
@@ -2,7 +2,7 @@
<article class="card" id="card-{{.ID}}"{{if .SelfPoll}} hx-get="/fragments/downloads/{{.ID}}/card" hx-trigger="every 3s" hx-swap="outerHTML"{{end}}>
<div class="card-top">
<div>
<div class="card-title"><a href="/download/{{.ID}}" style="color:inherit">{{.Title}}</a></div>
<div class="card-title">{{if eq .MediaType "series"}}<span class="type-ico" title="сериал">📺</span> {{else if eq .MediaType "movie"}}<span class="type-ico" title="фильм">🎬</span> {{end}}<a href="/download/{{.ID}}" style="color:inherit">{{.Title}}</a></div>
<div class="hash-row">
<span class="hash-label">ID:</span>
<span class="hash">{{.ID}}</span>