<div ng-if="vm.webpart.categories.length == 1"
     class="link-collection-content"
     ng-repeat="category in vm.webpart.categories">
    <ul class="list-group">
        <li class="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>
</div>

<div ng-if="vm.webpart.categories.length !== 1
            && category.links.length > 0"
     class="link-collection-content"
     ng-repeat="category in vm.webpart.categories">


    <div class="panel panel-primary">
        <div class="panel-heading">
            <h3 class="panel-title">
                <span ng-if="category.name == 'Uncategorized'">
                    {{category.name | translate}}
                </span>
                <span ng-if="category.name != 'Uncategorized'">
                    {{category.name}}
                </span>
            </h3>
        </div>
        <ul class="list-group">
            <li class="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>
    </div>
</div>