<div class="link-collection-content">
    <accordion close-others="false">

        <accordion-group is-open="category.status.open"
                         ng-if="category.links.length > 0"
                         ng-repeat="category in vm.webpart.categories"
                         ng-init="category.status = {};">

            <accordion-heading>
                <div class="link-usercategory-content">
                    <span ng-if="category.name == 'Uncategorized'">
                        {{category.name | translate}}
                    </span>
                    <span ng-if="category.name != 'Uncategorized'">
                        {{category.name}}
                    </span>
                    <i ng-if="category.links.length > 0"
                       class="pull-right glyphicon"
                       ng-class="{'glyphicon-chevron-down': category.status.open,
                                  'glyphicon-chevron-right': !category.status.open}"></i>
                </div>
            </accordion-heading>

            <ul class="list-group">
                <li class="link-list-group-item"
                    ng-repeat="link in category.links | filter:q as results">
                    <a class="webpart-link"
                       href="{{link.smarturl}}"
                       target="{{link.openInNewWindow?'_blank':'_self'}}"
                       title="{{link.description}}">
                        {{link.smartname}}
                    </a>
                </li>
            </ul>
        </accordion-group>

    </accordion>

</div>
