{% extends "base.html" %}

{% block content %}
    <div class="container mt-4">
        <!-- Новинки (New Videos) -->
        <div class="mb-5">
            <div class="row">
                <h4>Новинки</h4>
            </div>
            <div class="row">
                {% for vid in last_videos %}
                <div class="col-12 col-md-4 mb-4">
                    <a href="{{ url_for('video', video_id=vid.id) }}">
                        <img src="{{ url_for('static', filename='pre/' ~ vid.id ~ '.jpg') }}" style="width: 100%;" width="408" height="230" alt="{{ vid.title }}">
                    </a>
                    <div class="mt-2">
                        <div class="d-flex align-items-center">
                            <img src="{{ url_for('static', filename='avatars/' ~ vid.author.avatar) }}" alt="{{ vid.author.name }}" width="40" height="40" class="rounded-circle me-2">
                            <a class="text-decoration-none text-dark h5 mb-0" href="{{ url_for('video', video_id=vid.id) }}">{{ vid.title }}</a>
                        </div>
                        <p class="mb-1">
                            <a class="text-decoration-none text-dark" href="{{ url_for('user', user_id=vid.author.id) }}">
                                {{ vid.author.name }} {{ vid.author.surname }}
                            </a>
                        </p>
                        <p class="text-muted mb-0">
                            {{ vid.views }} {{ vid.views | decline_views }} -
                            Загружено {{ vid.datetime | timesince }}
                        </p>
                    </div>
                </div>
                {% endfor %}
            </div>
        </div>

        <!-- Лучшее (Best Videos) -->
        <div class="mb-5">
            <div class="row">
                <h4>Лучшее</h4>
            </div>
            <div class="row">
                {% for vid in best_videos %}
                <div class="col-12 col-md-4 mb-4">
                    <a href="{{ url_for('video', video_id=vid.id) }}">
                        <img src="{{ url_for('static', filename='pre/' ~ vid.id ~ '.jpg') }}" style="width: 100%;" width="408" height="230" alt="{{ vid.title }}">
                    </a>
                    <div class="mt-2">
                        <div class="d-flex align-items-center">
                            <img src="{{ url_for('static', filename='avatars/' ~ vid.author.avatar) }}" alt="{{ vid.author.name }}" width="40" height="40" class="rounded-circle me-2">
                            <a class="text-decoration-none text-dark h5 mb-0" href="{{ url_for('video', video_id=vid.id) }}">{{ vid.title }}</a>
                        </div>
                        <p class="mb-1">
                            <a class="text-decoration-none text-dark" href="{{ url_for('user', user_id=vid.author.id) }}">
                                {{ vid.author.name }} {{ vid.author.surname }}
                            </a>
                        </p>
                        <p class="text-muted mb-0">
                            {{ vid.views }} {{ vid.views | decline_views }} -
                            Загружено {{ vid.datetime | timesince }}
                        </p>
                    </div>
                </div>
                {% endfor %}
            </div>
        </div>

        <!-- Недооцененное (Underrated Videos) -->
        <div class="mb-5">
            <div class="row">
                <h4>Недооцененное</h4>
            </div>
            <div class="row">
                {% for vid in underrated_videos %}
                <div class="col-12 col-md-4 mb-4">
                    <a href="{{ url_for('video', video_id=vid.id) }}">
                        <img src="{{ url_for('static', filename='pre/' ~ vid.id ~ '.jpg') }}" style="width: 100%;" width="408" height="230" alt="{{ vid.title }}">
                    </a>
                    <div class="mt-2">
                        <div class="d-flex align-items-center">
                            <img src="{{ url_for('static', filename='avatars/' ~ vid.author.avatar) }}" alt="{{ vid.author.name }}" width="40" height="40" class="rounded-circle me-2">
                            <a class="text-decoration-none text-dark h5 mb-0" href="{{ url_for('video', video_id=vid.id) }}">{{ vid.title }}</a>
                        </div>
                        <p class="mb-1">
                            <a class="text-decoration-none text-dark" href="{{ url_for('user', user_id=vid.author.id) }}">
                                {{ vid.author.name }} {{ vid.author.surname }}
                            </a>
                        </p>
                        <p class="text-muted mb-0">
                            {{ vid.views }} {{ vid.views | decline_views }} -
                            Загружено {{ vid.datetime | timesince }}
                        </p>
                    </div>
                </div>
                {% endfor %}
            </div>
        </div>

        <!-- Все видео (All Videos) -->
        <div class="mb-5">
            <div class="row">
                <h4>Все видео</h4>
            </div>
            <div class="row">
                {% for vid in all_videos %}
                <div class="col-12 col-md-4 mb-4">
                    <a href="{{ url_for('video', video_id=vid.id) }}">
                        <img src="{{ url_for('static', filename='pre/' ~ vid.id ~ '.jpg') }}" style="width: 100%;" width="408" height="230" alt="{{ vid.title }}">
                    </a>
                    <div class="mt-2">
                        <div class="d-flex align-items-center">
                            <img src="{{ url_for('static', filename='avatars/' ~ vid.author.avatar) }}" alt="{{ vid.author.name }}" width="40" height="40" class="rounded-circle me-2">
                            <a class="text-decoration-none text-dark h5 mb-0" href="{{ url_for('video', video_id=vid.id) }}">{{ vid.title }}</a>
                        </div>
                        <p class="mb-1">
                            <a class="text-decoration-none text-dark" href="{{ url_for('user', user_id=vid.author.id) }}">
                                {{ vid.author.name }} {{ vid.author.surname }}
                            </a>
                        </p>
                        <p class="text-muted mb-0">
                            {{ vid.views }} {{ vid.views | decline_views }} -
                            Загружено {{ vid.datetime | timesince }}
                        </p>
                    </div>
                </div>
                {% endfor %}
            </div>
        </div>
    </div>
{% endblock %}
сделай его mobile-frienly