<div>
    <div class="flex justify-between items-center border-b pb-[15px]">
    <div class="font-semibold text-[16px]">Перелік груп</div>
    <div class="flex gap-4">
    {{{button this token=(token table="admin.user_roles" obj=(concat 'user_uid=' id) form="admin.user_roles.form") add=1}}}
    </div>
    </div>
    {{#contentList table="(
        WITH route_count AS (
            SELECT 
                COUNT(route_id), 
                role_id 
            FROM admin.role_access 
            WHERE role_id IN (SELECT role_id FROM admin.user_roles WHERE user_uid = '{{id}}') 
            GROUP BY role_id
            )
            SELECT 
            rc.*, 
            ur.*
            FROM route_count rc
            LEFT JOIN admin.user_roles ur ON rc.role_id = ur.role_id
            WHERE ur.user_uid = '{{id}}'
            )"}}
    {{{tableList rows
        table="admin.user_roles"
        id="ugr_id"
        uid=../user.uid
        form="admin.user_roles.form"
        columns="
        Група, <a class=\"text-blue-600 cursor-pointer\" _href='/card/admin.roles.table/{{role_id}}'>{{select role_id data='core.roles'}}</a>,
        Інтерфейси, count,
        Додав, <a class=\"text-blue-600 cursor-pointer\" _href='/card/admin.users.table/{{uid}}'>{{select uid data='core.user_uid'}}</a>,
        Дата додавання, {{formatDate cdate}}
        "
    }}}
    {{/contentList}}
</div>