<div class="content-header">
    <div class="row">
        <div class="col-md-8">
            <h2>{{::vm.translate.get('Categories')}}</h2>
        </div>
        <div class="col-md-4 text-right">
            <a ui-sref="category-create" class="btn btn-success"><span class="fa fa-plus"></span> {{::vm.translate.get('Create Category')}}</a>
        </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('Categories')}}</h3>
                        <div class="card-tools">

                        </div>
                    </div>
                    <div class="card-body p-0 table-responsive">
                        <table class="table table-striped">
                            <thead>
                                <tr>
                                    <th>{{::vm.translate.get('Name')}}</th>
                                    <th>{{::vm.translate.get('Actions')}}</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr ng-repeat="category in vm.categories">
                                    <td>{{category.name}}</td>
                                    <td>
                                        <a ui-sref="category-edit({id: category.id})" title="Edit" class="btn btn-primary btn-xs"> <i class="fa fa-pen"></i></a>
                                        <button ng-click="vm.deleteCategory(category)" class="btn btn-danger btn-xs delete"> <i class="fas fa-times-circle"></i></button>
                                        <a ui-sref="category-translation({id: category.id, culture: culture})" class="btn btn-default btn-xs btn-translate" ng-repeat="culture in vm.enableCultures">
                                            <span class="flag flag-{{culture.substr(culture.length - 2).toLowerCase()}}" alt="{{culture}}" title="{{culture}}"></span>
                                        </a>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </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>