{% extends "dictionary/base.html" %}
{% load i18n %}

{% block title %}{% trans "channels" context "titleblock" %}{% endblock %}
{% block content %}
    <h1 class="h4"><strong>{% trans "channels" context "titleblock" %}</strong></h1>

    {% url "topic_list" "today" as today_url %}
    {% url 'topic_list' "uncategorized" as uncategorized_url %}

    {% blocktrans trimmed with today_attr=user.is_authenticated|yesno:'data-lf-slug="today",'|safe uncategorized_attr='data-lf-slug="uncategorized"' %}
        <p>the complete list of channels that classify the topics with general subjects. in
            <a {{ today_attr }} href="{{ today_url }}">today</a> only the topics with channels you follow and
            <a {{ uncategorized_attr }} href="{{ uncategorized_url }}">topics with no channels</a> are listed.</p>
    {% endblocktrans %}

    <ul class="category-list-all p-0">
        {% for category in categories %}
            <li class="d-flex justify-content-between">
                <article>
                    <h2 class="h5 font-weight-bold">
                        <a data-lf-slug="{{ category.slug }}" href="{{ category.get_absolute_url }}">#{{ category.name }}</a>
                    </h2>
                    <p>{{ category.description }}</p>
                </article>
                {% if user.is_authenticated %}
                    {% trans "unfollow,follow" context "category-list" as state %}
                    <button type="button" class="btn btn-django-link float-right follow-category-trigger{{ category.is_followed|yesno:" faded," }}" data-category-id="{{ category.pk }}">{{ category.is_followed|yesno:state }}</button>
                {% endif %}
            </li>
        {% endfor %}
    </ul>
{% endblock %}
