Files
web/views/list.twig
2025-06-21 21:10:21 +08:00

130 lines
6.5 KiB
Twig
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{###########################################################################
# Copyright (c) 2025, Антон Аксенов
# This file is part of iptv.axenov.dev web interface
# MIT License: https://git.axenov.dev/IPTV/web/src/branch/master/LICENSE
###########################################################################}
{% extends "template.twig" %}
{% block metadescription %}Самообновляемые бесплатные IPTV-плейлисты для домашнего просмотра по коротким ссылкам, списки каналов, проверка доступности{% endblock %}
{% block metakeywords %}самообновляемые,бесплатные,iptv-плейлисты,iptv,плейлисты{% endblock %}
{% block header %}
<div class="row text-muted small">
<div class="col-md">
Список изменён:&nbsp;{{ updatedAt }}&nbsp;МСК<br/>
Плейлистов в списке:&nbsp;<strong>{{ count }}</strong>
</div>
<div class="col-md">
Состояние проверки:<br />
<span class="me-1">
<span class="badge me-1 bg-success text-dark">online</span>{{ onlineCount }}
</span>
<span class="me-1">
<span class="badge me-1 bg-danger text-dark">offline</span>{{ offlineCount }}
</span>
<span class="me-1">
<span class="badge me-1 bg-secondary text-dark" title="В очереди на проверку">unknown</span>{{ uncheckedCount }}
</span>
</div>
</div>
<hr/>
{% endblock %}
{% block content %}
<div class="table-responsive">
<table class="table table-responsive table-dark table-hover small">
<thead>
<tr>
<th class="col-1 text-center">Код</th>
<th class="col-8">Информация о плейлисте</th>
<th class="col-1 text-center">Каналов</th>
<th class="col-2 d-none d-sm-table-cell">Ссылка для ТВ</th>
</tr>
</thead>
<tbody>
{% for code, playlist in playlists %}
<tr class="pls" data-playlist-code="{{ code }}">
<td class="text-center font-monospace code">{{ code }}</td>
<td class="info">
{% if playlist.isOnline is same as(true) %}
<span class="badge small bg-success text-dark">online</span>
{% elseif playlist.isOnline is same as(false) %}
<span class="badge small bg-danger text-dark">offline</span>
{% elseif playlist.isOnline is same as(null) %}
<span class="badge small bg-secondary text-dark" title="В очереди на проверку">unknown</span>
{% endif %}
{% if "adult" in playlist.tags %}
<span class="badge small bg-warning text-dark" title="Есть каналы для взрослых!">18+</span>
{% endif %}
<a href="/{{ code }}/details" class="text-light fw-bold text-decoration-none">{{ playlist.name }}</a>
<div class="small mt-2">
<p class="my-1 d-none d-lg-block">
{% if playlist.groups|length > 0 %}
<ion-icon name="folder-open-outline" title="Каналы разбиты на группы"></ion-icon>
{% endif %}
{% if playlist.hasTvg %}
<ion-icon name="newspaper-outline" title="Есть программа передач"></ion-icon>
{% endif %}
{% if playlist.hasCatchup %}
<ion-icon name="play-back-outline" title="Есть перемотка (архив)"></ion-icon>
{% endif %}
{{ playlist.description }}
</p>
{% if playlist.tags|length > 0 %}
<p class="my-1 d-none d-lg-block text-muted" title="Теги, присвоенные каналам при проверке">
<ion-icon name="pricetag-outline" class="me-1"></ion-icon>
{% for tag in playlist.tags %}
<span class="chtag">#{{ tag }}</span>
{% endfor %}
</p>
{% endif %}
<a href="/{{ code }}/details" class="text-light">Подробнее...</a>
</div>
</td>
<td class="text-center">
{% if (playlist.isOnline is not same as(null)) %}
{{ playlist.channels|length }}
{% else %}
?
{% endif %}
</td>
<td class="d-none d-sm-table-cell">
<span onclick="prompt('Скопируй адрес плейлиста. Если не работает, добавь \'.m3u\' в конец.', '{{ mirror_url(playlist.code) }}')"
title="Нажми на ссылку, чтобы скопировать её в буфер обмена"
class="font-monospace cursor-pointer"
data-bs-toggle="tooltip"
data-bs-placement="top"
title="Нажми на ссылку, чтобы скопировать её в буфер обмена"
>
{{ mirror_url(playlist.code) }}
</span>
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% if pageCount > 1 %}
<div aria-label="pages">
<ul class="pagination justify-content-center">
{% for page in range(1, pageCount) %}
{% if page == pageCurrent %}
<li class="page-item active" aria-current="page">
<span class="page-link">{{ page }}</span>
</li>
{% else %}
<li class="page-item">
<a class="page-link bg-dark border-secondary text-light" href="page/{{ page }}">{{ page }}</a>
</li>
{% endif %}
{% endfor %}
</ul>
</div>
{% endif %}
</div>
{% endblock %}
{% block footer %}
{% endblock %}