


<div class="modal-header">
    <button type="button" class="close closebtn" data-ng-click="vm.cancel()" aria-hidden="true">&times;</button>
    <h1 class="modal-title">{{'History' | translate}}</h1>
</div>
<div class="modal-body">
    <a href="" ng-click="vm.refresh()" class="pull-right"><i class="glyphicon glyphicon-refresh"></i> Refresh</a>
    <table class="table">
        <thead>
            <tr>
                <th>Created</th>
                <th>Created by</th>
                <th>Comment</th>
                <th>Data</th>
                <th>Action</th>
            </tr>
        </thead>
        <tbody>
            <tr class="metadataDefinitionRow" ng-repeat-start="history in vm.eventHistory">
                <td>
                    {{history.created | date : 'dd-MM-yyyy HH:mm:ss'}}
                </td>
                <td>
                    {{history.createdBy.loginName}}
                </td>
                <td>
                    {{history.comment}}
                </td>
                <td>
                    <a href="" ng-show="!history.showData" ng-click="history.showData = true">Show data</a>
                    <a href="" ng-show="history.showData" ng-click="history.showData = false">Hide data</a>                    
                </td>
                <td>
                    <a href="" ng-click="vm.repeatEventHistory(history)"><i class="glyphicon glyphicon-repeat"></i> Repeat</a>
                </td>
            </tr>
            <tr ng-show="history.showData" ng-repeat-end>
                <td colspan="5">
                    <pre style="height: 200px; width: 100%; overflow:scroll">{{history.eventDataString}}</pre>                    
                </td>
            </tr>
        </tbody>
    </table>
</div>
<div class="modal-footer"> 
    <pagination total-items="vm.eventHistoryTotalCount"
                ng-change="vm.pageChanged(vm.currentPageNumber)"
                ng-model="vm.currentPageNumber"
                items-per-page="vm.itemsPerPage"
                max-size="5"
                boundary-links="false"
                previous-text="&lsaquo;"
                next-text="&rsaquo;"
                first-text="&laquo;"
                last-text="&raquo;"
                style="margin:0px 0px; float:left">
    </pagination>
    <button ng-click="vm.cancel()" style="float:right" class="btn btn-default">{{'Close' | translate}}</button>
</div>