<div class="content-header">
    <div class="container-fluid">
        <div class="row">
            <div class="col-md-6">
                <h2>{{::vm.translate.get('Installed themes')}}</h2>
            </div>
            <div class="col-md-6 text-right">
                <!--<a ui-sref="online-themes" class="btn btn-success"><span class="fa fa-plus"></span> {{::vm.translate.get('View Online Themes')}}</a>-->
            </div>
        </div>
    </div>
</div>

<section class="content">
    <div class="container-fluid">
        <div class="row">
            <div class="col-12">
                <div class="card">
                    <div class="card-header">
                        <h3 class="card-title">{{::vm.translate.get('Themes')}}</h3>
                        <div class="card-tools">
                        </div>
                    </div>
                    <div class="card-body p-0 table-responsive">
                        <div class="row m-2">
                            <div ng-repeat="theme in vm.themes" class="col-xs-6 col-md-4">
                                <div class="card">
                                    <img class="card-img-top" alt="{{theme.displayName}}" ng-src="{{theme.thumbnailUrl}}">
                                    <div class="card-body">
                                        <h4 class="card-title">{{theme.displayName}}</h4> <br />
                                        <p ng-hide="theme.isCurrent">
                                            <button class="btn btn-default" role="button" ng-click="vm.useTheme(theme)">{{::vm.translate.get('Use')}}</button>
                                            <button ng-hide="theme.name === vm.previewingTheme" class="btn btn-default" role="button" ng-click="vm.previewTheme(theme)">{{::vm.translate.get('Preview')}}</button>
                                            <button ng-show="theme.name === vm.previewingTheme" class="btn btn-primary" role="button" ng-click="vm.cancelPreviewTheme(theme)">{{::vm.translate.get('Cancel Preview')}}</button>
                                            <button ng-if="theme.name !== 'Generic'" class="btn btn-default" role="button" ng-click="vm.downloadTheme(theme)">{{::vm.translate.get('Download')}}</button>
                                            <button ng-if="theme.name !== 'Generic'" class="btn btn-default" role="button" ng-click="vm.deleteTheme(theme)">{{::vm.translate.get('Delete')}}</button>
                                        </p>
                                        <p ng-show="theme.isCurrent">
                                            <button type="button" disabled="disabled" class="btn btn-success">
                                                <span class="fa fa-ok" aria-hidden="true"></span> {{::vm.translate.get('Current theme')}}
                                            </button>
                                            <button ng-if="theme.name !== 'Generic'" class="btn btn-default" role="button" ng-click="vm.downloadTheme(theme)">{{::vm.translate.get('Download')}}</button>
                                        </p>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="card-footer">
                        <div>
                            <div ng-show="!vm.isLoading" colspan="3">{{vm.tableStateRef.pagination.totalItemCount | number:0}} {{::vm.translate.get('records found')}}</div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</section>