<div ng-controller="InstallWizdomController as vm" class="lt-ob-content">

    <h1 ng-hide="vm.installing || vm.checkingPrerequisites" class="lt-ob-content__title">Install Livetiles Everywhere</h1>

    <!--Checking prerequisites-->
    <h1 ng-show="vm.checkingPrerequisites" class="lt-ob-content__title">Checking prerequisites</h1>
    <p ng-show="vm.checkingPrerequisites" class="lt-ob-content__description">Hang on while we check prerequisites</p>
    <p ng-if="vm.prerequisitesProblems && vm.prerequisitesProblems.length > 0" class="lt-ob-content__description">Missing prerequisites</p>

    <ol ng-if="vm.prerequisitesProblems && vm.prerequisitesProblems.length > 0" class="lt-ob-content__list">
        <li ng-repeat="problem in vm.prerequisitesProblems">{{problem.description}}</li>
    </ol>

    <a ng-if="vm.appCatalogUrlMissing" class="btn btn-primary" href="{{vm.createAppCatalogUrl}}" target="_blank">Open App Catalog Creation</a>
    <p ng-if="vm.appCatalogUrlMissing" class="lt-ob-content__description">Creation of app catalog can take up to 10 minutes.</p>

    <!--Ready to install-->
    <p ng-show="!vm.installing && vm.readyToInstall" class="lt-ob-content__description">Click install to start the installation processs, this might take a few minutes.</p>

    <!--Installing-->
    <h1 ng-show="vm.installing" class="lt-ob-content__title">Installing</h1>
    <p ng-show="vm.installing" class="lt-ob-content__description">Hang on while we install, this might take a few minutes</p>

    <div ng-show="vm.installing || vm.checkingPrerequisites" class="circle-loader" ng-class="{'hide-spin' : !vm.checkingPrerequisites && !vm.installing}"></div>

    <div ng-if="vm.errorMessages && vm.errorMessages.length > 0">
        <h3>Errors:</h3>
        <ul ng-repeat="error in vm.errorMessages">
            <li>{{error}}</li>
        </ul>
    </div>

    <div class="lt-ob-content__navigation">
        <div class="lt-ob-content__navigation-bottom">
            <button type="button" class="btn btn-default" ng-show="!vm.readyToInstall && !vm.checkingPrerequisites && !vm.installing" ng-click="vm.runPrerequisiteCheck()">Rerun the prerequisite check</button>
            <button type="button" class="btn btn-primary" ng-disabled="!vm.readyToInstall" ng-hide="vm.installing" ng-click="vm.install()">Install</button>
        </div>
    </div>

</div>

