<api-validate></api-validate>
<div ng-controller="GlobalConfigurationController">
    <ul class="breadcrumb">
        <li class="active">{{'label.anchor.globalconfigurations' | translate}}</li>
    </ul>
    <input ng-model="filterText" type="text" ng-keyup="onFilter()" class="form-control" placeholder="{{'label.input.filterbyname' | translate}}">
    <table class="table">
        <thead>
        <tr class="graybg">
            <th>{{'label.heading.name' | translate}}</th>
            <th>{{'label.heading.enabled' | translate}}</th>
            <th></th>
            <th>{{'label.heading.value' | translate}}</th>
            <th>{{'label.heading.date' | translate}}</th>
            <th></th>
        </tr>
        </thead>
        <tbody>
        <tr ng-repeat="config in configs | orderBy:'name':reverse | filter:filterText">
            <td>
			{{config.name | translate}}
			&nbsp; &nbsp; &nbsp;<i class="icon-question-sign icon-white" tooltip="{{'label.tooltip.global.' + config.name | translate}}"></i>
			</td>
            <td>
                <i class="icon-ok-sign icon-green" data-ng-show="config.enabled"></i>
                <i class="icon-remove-sign icon-red" data-ng-hide="config.enabled"></i>				
            </td>
            <td>
                <button type="button" class="btn btn-primary" data-ng-hide="config.enabled"
                        data-ng-click="enable(config.id, config.name)" has-permission='UPDATE_CONFIGURATION'>{{"label.button.enable" | translate}}</button>
                <button type="button" class="btn btn-danger" data-ng-show="config.enabled"
                        data-ng-click="disable(config.id, config.name)" has-permission='UPDATE_CONFIGURATION'>{{"label.button.disable" | translate}}</button>                
            </td>
            <td>{{config.value}}</td>
            <td>{{config.dateValue}}</td>
            <td>
                <a title="{{'label.edit' | translate}}"  data-ng-show="config.showEditvalue"  
                   href="#/configurations/{{config.id}}/editconfig">
					<i class="icon-pencil icon-white"></i></a>
            </td>                   
        </tr>
        </tbody>
    </table>
</div>