<div class="blade-static">
    <div class="form-group">
        <div class="form-input __search">
            <input placeholder="{{'platform.placeholders.search-keyword' | translate}}" ng-model="filter.keyword" ng-keyup="$event.which === 13 && filter.criteriaChanged()" />
            <button class="btn __other" style="position: relative;right: 45px;">
                <i class="btn-ico fa fa-times-circle" title="Clear" ng-click="filter.keyword=null;filter.criteriaChanged()"></i>
            </button>
        </div>
    </div>
</div>
<div class="blade-static __bottom" ng-if="pageSettings.itemsPerPageCount < pageSettings.totalItems" ng-include="'pagerTemplate.html'"></div>
<div class="blade-content __large-wide">
    <div class="blade-inner">
        <div class="inner-block" ng-init="setGridOptions({
                 rowTemplate: 'list.row.html',
                 rowHeight: 61,
                 columnDefs: [
                            { name: 'actions', displayName: '', enableColumnResizing: false, enableSorting: false, width: 30, cellTemplate: 'list-actions.cell.html', pinnedLeft:true },
                            { name: 'notificationType', displayName: 'notifications.blades.notifications-journal.labels.notification', cellTemplate: 'notification.cell.html' },
                            { name: 'createdDate', displayName: 'notifications.blades.notifications-journal.labels.created' },
                            { name: 'sendAttemptCount', displayName: 'notifications.blades.notifications-journal.labels.sendAttemptCount' },
                            { name: 'status', displayName: 'notifications.blades.notifications-journal.labels.status', cellTemplate: 'status.cell.html' }
                ]})">
            <div class="table-wrapper" ng-if="blade.currentEntities.length">
                <div ui-grid="gridOptions" ui-grid-auto-resize ui-grid-save-state ui-grid-selection ui-grid-resize-columns ui-grid-move-columns ui-grid-pinning ui-grid-height></div>
                <ul class="menu __context" role="menu" id="njo_menu">
                    <li class="menu-item" ng-click='selectNode(contextMenuEntity)'>
                        <i class="menu-ico"></i> {{'notifications.blades.notifications-journal.labels.detail' | translate}}
                    </li>
                </ul>


                
            </div>
            <div class="note" ng-if="!blade.currentEntities.length">
                {{ 'notifications.blades.notifications-journal.labels.no-notifications' | translate }}
            </div>
        </div>
    </div>
</div>

<script type="text/ng-template" id="list.row.html">
    <div ng-click='grid.appScope.selectNode(row.entity)' ng-repeat="(colRenderIndex, col) in colContainer.renderedColumns track by col.uid" ui-grid-one-bind-id-grid="rowRenderIndex + '-' + col.uid + '-cell'" class="ui-grid-cell" ng-class="{'ui-grid-row-header-cell': col.isRowHeader, '__hovered': grid.appScope.contextMenuEntity === row.entity, '__selected': row.entity.id===grid.appScope.selectedNodeId}" role="{{col.isRowHeader ? 'rowheader' : 'gridcell' }}" ui-grid-cell context-menu="grid.appScope.contextMenuEntity = row.entity" data-target="njo_menu"></div>
</script>
<script type="text/ng-template" id="list-actions.cell.html">
    <div class="ui-grid-actions" left-click-menu="grid.appScope.contextMenuEntity = row.entity" data-target="njo_menu">
        <i class="fa fa-ellipsis-v"></i>
    </div>
</script>
<script type="text/ng-template" id="notification.cell.html">
    <div class="ui-grid-cell-contents">
        <div class="list-item">
            <span class="list-name">{{row.entity.notificationType | translate}}</span>
            <span class="list-descr" style="color: #999;display: block;font-size: 12px;margin-top: 5px; white-space: initial;">{{row.entity.notificationType | translate}}</span>
        </div>
    </div>
</script>
<script type="text/ng-template" id="status.cell.html">
    <div class="ui-grid-cell-contents">
        <div class="inner-contents">
            <span class="table-status" ng-if="(row.entity.status === 'Error')" style="background:red">{{ 'notifications.blades.notifications-journal.labels.error' | translate }}</span>
            <span class="table-status" ng-if="(row.entity.status === 'Pending')" style="max-width:60px;">{{ 'notifications.blades.notifications-journal.labels.processing' | translate }}</span>
            <span class="table-status __active" ng-if="(row.entity.status === 'Sent')">{{ 'notifications.blades.notifications-journal.labels.success' | translate }}</span>
        </div>
    </div>
</script>
