<div ng-if="vm.webpart.categories.length == 1"
     class="link-collection-content"
     ng-repeat="category in vm.webpart.categories">
    <div class="text-left">
        <a class="webpart-link imaged-link text-center round-64"
           ng-repeat="link in category.links | filter:q as results"
           href="{{link.smarturl}}"
           title="{{link.description}}"
           target="{{link.openInNewWindow ? '_blank' : '_self'}}">
            <div ng-if="link.imageUrl.length > 1">
                <img ng-src="{{link.imageUrl}}" alt="{{link.description}}" />
            </div>
            <div ng-if="link.iconName.icon.length > 1 && link.imageUrl.length < 1">
                <i class={{link.iconName.icon}}></i>
            </div>
            <span class="text-muted">
                {{link.name}}
            </span>
        </a>
    </div>
</div>

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

    <div ng-if="category.links.length > 0" 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>
        <div class="wizdom-personallink-imagelist-container">
            <a class="webpart-link imaged-link text-center round-64"
               ng-repeat="link in category.links | filter:q as results"
               href="{{link.smarturl}}"
               title="{{link.description}}"
               target="{{link.openInNewWindow ? '_blank' : '_self'}}">
                <div ng-if="link.imageUrl.length > 1">
                    <img ng-src="{{link.imageUrl}}" alt="{{link.description}}" />
                </div>
                <div ng-if="link.iconName.icon.length > 1 && link.imageUrl.length < 1">
                    <i class={{link.iconName.icon}}></i>
                </div>
                <span class="text-muted">{{link.name}}</span>
            </a>
        </div>
    </div>
</div>