<!--
  Licensed to the Apache Software Foundation (ASF) under one
  or more contributor license agreements.  See the NOTICE file
  distributed with this work for additional information
  regarding copyright ownership.  The ASF licenses this file
  to you under the Apache License, Version 2.0 (the
  "License"); you may not use this file except in compliance
  with the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing,
  software distributed under the License is distributed on an
  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  KIND, either express or implied.  See the License for the
  specific language governing permissions and limitations
  under the License.
-->
<div class="container">
    <br-card>
        <br-card-content>
            <br-card-content-headline>
                <div class="row">
                    <div class="col-md-9">Quick launch</div>
                    <fieldset class="col-md-3">
                        <div class="form-group has-feedback">
                            <input type="text"
                                   ng-model="vm.search"
                                   class="form-control"
                                   id="appSearch"
                                   aria-describedby="appSearch">
                                <span class="form-control-feedback" aria-hidden="true">
                                    <i class="fa fa-search"></i>
                                </span>
                        </div>
                    </fieldset>
                </div>
            </br-card-content-headline>

            <div class="quick-launch-container clearfix">
                <div class="col-md-2 quick-launch-item" ng-repeat="app in filteredApps = (vm.catalogApps | filter:vm.search) | limitTo:vm.pagination.itemsPerPage:(vm.pagination.page-1)*vm.pagination.itemsPerPage track by (app.containingBundle + app.symbolicName + app.version)">
                    <a ui-sref="main.deploy({bundleSymbolicName: app.containingBundle.split(':')[0], bundleVersion: app.containingBundle.split(':')[1], typeSymbolicName: app.symbolicName, typeVersion: app.version})" class="thumbnail">
                        <div class="quick-launch-icon-container">
                            <img class="quick-launch-icon" ng-src="{{app | iconGeneratorPipe}}">
                        </div>
                        <div class="caption">{{app.name || app.symbolicName}}</div>
                    </a>
                </div>
                <div class="quick-launch-nothing-found" ng-if="filteredApps.length === 0">
                    <div class="nothing-found-title">Nothing found</div>
                    <div class="nothing-found-description">Please check the spelling of your search terms or try other, more general keywords.</div>
                </div>

                <div class="quick-launch-actions">
                    <div uib-pagination total-items="filteredApps.length" items-per-page="vm.pagination.itemsPerPage" ng-model="vm.pagination.page"></div>
                </div>
            </div>

        </br-card-content>
    </br-card>


    <div class="row brooklyn-modules">
        <div class="col-md-3" ng-repeat="uiModule in vm.uiModules">
            <a ng-href="{{uiModule.path}}">
                <br-card center="true">
                    <br-card-content>
                        <br-card-content-headline>
                            <i class="module-icon fa" ng-class="uiModule.icon"></i>
                        </br-card-content-headline>
                        <br-card-content-subhead>
                            <h3>{{uiModule.name}}</h3>
                        </br-card-content-subhead>
                    </br-card-content>
                </br-card>
            </a>
        </div>
    </div>
</div>

<ui-view />
