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

    <dl class="list-group-item"
        ng-repeat="link in category.links | filter:q as results">
        <dt>
            <a class="webpart-link"
               href="{{link.smarturl}}"
               target="{{link.openInNewWindow?'_blank':'_self'}}"
               title="{{link.description}}">
                {{link.smartname}}
            </a>
        </dt>
        <dd class="wizdom-personallink-detaillist-link-description" style="white-space: pre-line;">
            {{link.description}}
        </dd>
    </dl>
</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>
        <dl class="list-group-item"
            ng-repeat="link in category.links | filter:q as results">
            <dt>
                <a class="webpart-link"
                   href="{{link.smarturl}}"
                   target="{{link.openInNewWindow?'_blank':'_self'}}"
                   title="{{link.description}}">
                    {{link.smartname}}
                </a>
            </dt>
            <dd class="wizdom-personallink-detaillist-link-description" style="white-space: pre-line;">
                {{link.description}}
            </dd>
        </dl>
    </div>
</div>