<!--
  #%L
  thinkbig-ui-feed-manager
  %%
  Copyright (C) 2017 ThinkBig Analytics
  %%
  Licensed 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.
  #L%
  -->
<div  flex style="width:100%" >

    <div layout="column" flex class="md-padding feed-templates" layout-align="start center" ng-if="vm.stepperUrl == null">
        <div layout="row">
            <div layout="column" flex layout-fill layout-align="center center">
                <div class="item-title">Select a template <span ng-if="vm.allowImport">or <a href="" ng-click="vm.gotoImportFeed()">import</a> from file</span></div>
            </div>
        </div>

        <div layout="column" flex layout-fill layout-align="center center" ng-if="vm.layout == 'first'">

        <md-card style="width:450px;max-width:450px;max-height:121px;height:121px" ng-repeat="template in vm.firstTemplates track by $index" flex="initial" flex-md="initial" flex-sm="50" ng-click="vm.selectTemplate(template)">
            <md-card-title>
                <md-card-title-text>
                    <span style="font-size: 16px;font-weight:400;letter-spacing: .005em;">{{template.templateName}}</span>
                    <span class="md-subhead" style="word-wrap:break-word;">{{template.description | characters:100}}</span>
                </md-card-title-text>
                <md-card-title-media>
                    <ng-md-icon icon="{{template.icon}}" size="40" style="fill:{{template.iconColor}};margin-right:-20px;" class="md-media-xs"></ng-md-icon>
                </md-card-title-media>
            </md-card-title>
        </md-card>
            <div>
          <a href="" ng-click="vm.more()" ng-if="vm.displayMoreLink">More</a>
            </div>
        </div>

        <div layout="row" flex class="md-padding feed-templates" layout-align="start start"  layout-wrap ng-if="vm.layout == 'all'">
            <md-card style="width:400px;max-width:400px;max-height:121px;height:121px" ng-repeat="template in vm.allTemplates track by $index" flex="initial" flex-md="initial" flex-sm="50" ng-click="vm.selectTemplate(template)">
                <md-card-title>
                    <md-card-title-text>
                        <span style="font-size: 16px;font-weight:400;letter-spacing: .005em;">{{template.templateName}}</span>
                      <span class="md-subhead" style="word-wrap:break-word;">{{template.description | characters:100}}</span>
                    </md-card-title-text>
                    <md-card-title-media>
                        <ng-md-icon icon="{{template.icon}}" size="40" style="fill:{{template.iconColor}};margin-right:-20px;" class="md-media-xs"></ng-md-icon>
                    </md-card-title-media>
                </md-card-title>
            </md-card>

        </div>

    </div>

<thinkbig-stepper total-steps="{{vm.totalSteps}}" stepper-name="DefineFeedStepper"  core-data-model="vm.model" on-cancel-stepper="vm.cancelStepper()" template-url="{{vm.stepperUrl}}" ng-if="vm.stepperUrl != null"></thinkbig-stepper>

</div>
