<#if isRoot> [{ "text": "<@s.m "channel.root"/>", "classes": "folder" <#if list?size gt 0>, "expanded": true, "children": [ <#list list as channel> { "id": "${channel.id}", "text": "${channel.name} [${channel.model.name}]", "classes": "<#if channel.child?size gt 0>folder<#else>file", "hasChildren": <#if channel.child?size gt 0>true<#else>false }<#if channel_has_next>, ] }] <#else> [ <#list list as channel> { "id": "${channel.id}", "text": "${channel.name} [${channel.model.name}]", "classes": "<#if channel.child?size gt 0>folder<#else>file", "hasChildren": <#if channel.child?size gt 0>true<#else>false }<#if channel_has_next>, ]