{% extends "_global/admin/panel-list.twig" %}

{% block header %}
    <h1>Category List</h1>
{% endblock %}

{% block buttons %}
    {{ parent() }}
{% endblock %}

{% block content %}
    <table class="table table-striped">
        <thead>
        <tr>
            <th class="text-center"><input type="checkbox" /></th>
            <th class="text-center">State</th>
            <th class="text-center">Title</th>
            <th class="text-center">Access</th>
            <th class="text-center">Language</th>
            <th class="text-center">ID</th>
        </tr>
        </thead>

        {% set categories = helper.blog.getCategories() %}
        <tbody>
        {% for item in categories %}
            <tr>
                {# CHECKBOX #}
                <td class="text-center">
                    <input type="checkbox" />
                </td>

                {# PUBLISHED #}
                <td class="text-center">
                    {# Here we use random published state. #}
                    {% set pub = random([['ok', 'success'], ['remove', 'danger']]) %}
                    <button class="btn btn-default btn-sm">
                        <i class="glyphicon glyphicon-{{ pub[0] }} text-{{ pub[1] }}"></i>
                    </button>
                </td>

                {# TITLE #}
                <td class="">
                    {{ helper.blog.repeat('—', item.level) }} <a href="edit">{{ item.title }}</a> (Alias: {{ item.alias }})
                </td>

                {# ACCESS #}
                <td class="text-center">
                    {{ random(['Public', 'Registed', 'Special']) }}
                </td>

                {# LANGUAGE #}
                <td class="text-center">
                    {{ random(['All', 'zh-TW', 'en-GB', 'zh-CN', 'ja-JP']) }}
                </td>

                {# ID #}
                <td class="text-center">
                    {{ loop.index + 1056 }}
                </td>
            </tr>
        {% endfor %}
        </tbody>

        <tfoot>
        <tr>
            <td class="text-center" colspan="10">
                {% include "_global/blocks/pagination.twig" %}
            </td>
        </tr>
        </tfoot>
    </table>
{% endblock %}