<div ng-controller="DeleteController">
    <form class="styled">

        <h1>
            <span translate>Delete backup</span>
            <b>
                <span translate ng-hide="Backup.Backup.Name">...loading...</span>
                <span ng-show="Backup.Backup.Name">{{Backup.Backup.Name}}</span>
            </b>
        </h1>

        <div ng-hide="NoLocalDB">
            <h2 translate>Delete local database</h2>

            <div translate>
            Each backup has a local database associated with it, which stores information about the remote backup on the local machine.
            When deleting a backup, you can also delete the local database without affecting the ability to restore the remote files.
            If you are using the local database for backups from the commandline, you should keep the database.
            </div>

            <div class="warning" translate ng-show="DeleteLocalDatabase && DbUsedElsewhere">
            WARNING: The remote database is found to be in use by the commandline library.
            </div>

            <div class="input checkbox multiple">
                <label for="deleteLocalDB" translate>Delete the local database</label>
                <input type="checkbox" id="deleteLocalDB" ng-model="DeleteLocalDatabase" />
            </div>
        </div>

        <h2 translate>Export configuration</h2>
        <div translate>If you want to use the backup later, you can export the configuration before deleting it.</div>
        <div class="buttons">
            <input class="submit" type="button" ng-click="doExport()" value="{{'Export configuration' | translate}} &gt;" />
        </div>

        <div ng-hide="NoLocalDB">
            <h2 translate>Delete remote files</h2>

            <div ng-show="Backup.Backup.Metadata.TargetFilesCount == null" translate>Loading remote storage usage …</div>
            <div ng-show="Backup.Backup.Metadata.TargetFilesCount != null" translate translate-params-filecount="Backup.Backup.Metadata.TargetFilesCount" translate-params-filesize="Backup.Backup.Metadata.TargetSizeString">
                Delete {{filecount}} files ({{filesize}}) from the remote storage?
            </div>
            <div class="warning" translate ng-show="DeleteRemoteFiles">WARNING: This will prevent you from restoring the data in the future.</div>

            <div class="input checkbox multiple">
                <label for="deleteRemoteFiles" translate>Delete remote files</label>
                <input type="checkbox" id="deleteRemoteFiles" ng-model="DeleteRemoteFiles" />
            </div>
        </div>    

        <div class="buttons">
            <input class="submit" type="button" ng-click="doDelete()" value="{{'Delete backup' | translate}} &gt;" />
            <input class="cancel" type="button" ng-click="goBack()" value="{{'Cancel' | translate}}" />
        </div>

    </form>

</div>
