<div ng-controller="RestoreWizardController" class="restorewizard">
    
    <h1><div translate>Where do you want to restore from?</div></h1>

    <form class="styled">
    	<ul>
    		<li class="input" ng-click="selection.backupid = 'direct'">
	    		<input type="radio" name="direct" id="direct" ng-model="selection.backupid" value="direct">
    			<label for="direct" translate>Direct restore from backup files ...</label>
    			<div class="subtext" translate>Point to your backup files and restore from there</div>
    		</li>

            <li class="input" ng-click="selection.backupid = 'import'">
                <input type="radio" name="import" id="import" ng-model="selection.backupid" value="import">
                <label for="import" translate>Restore from configuration ...</label>
                <div class="subtext" translate>Load destination from an exported job or a storage provider</div>
            </li>

    		<li class="input" ng-repeat="item in backups" ng-click="selection.backupid = item.Backup.ID" >
	    		<input type="radio" name="direct" id="backup-{{item.Backup.ID}}" ng-model="selection.backupid" value="{{item.Backup.ID}}">
    			<label for="backup-{{item.Backup.ID}}">{{item.Backup.Name}}</label>

                <div ng-hide="item.Backup.Metadata == null || item.Backup.Metadata.TargetSizeString == null" class="subtext" translate translate-n="parseInt(item.Backup.Metadata.BackupListCount)" translate-plural="{{item.Backup.Metadata.TargetSizeString}} / {{$count}} Versions">{{item.Backup.Metadata.TargetSizeString}} / {{$count}} Version</div>

                <div ng-show="item.Backup.Metadata == null || item.Backup.Metadata.TargetSizeString == null" class="subtext" translate>Unknown backup size and versions</div>

                <div ng-hide="item.Backup.Metadata == null || item.Backup.Metadata.LastRestoreFinished == null"
                class="subtext"
                translate translate-params-time="item.Backup.Metadata.LastRestoreFinished | parseDate:forceActualDate "
                translate-params-duration="formatDuration(item.Backup.Metadata.LastRestoreDuration)">Last successful restore: {{time}} (took {{duration || '0 seconds'}})
                </div>
    		</li>
    	</ul>

        <div class="buttons">
            <input class="submit next" type="button" ng-click="nextPage()" value="{{'Next' | translate}} &gt;" />
        </div>
    </form>
</div>
