<h2>{{title}}</h2>

<br />

<h4 class="text-muted" ng-if="entries.length == 0">No entries</h4>

<p ng-show="entries.length > 10">
	<input type="text" class="form-control col-lg-8 col-xs-12" ng-model="browseFilter" placeholder="Filter...">
</p>

<table class="table table-sm table-hover col-xs-12" ng-class="{'col-lg-8' : mode == 0, 'col-lg-8 table-bordered' : mode == 1}">
	<thead class="thead-light">
		<tr>
			<th class="col-8">{{field}}</th>
			<th class="text-right text-nowrap col-4" ng-if="mode == 0" title="valid organizations">#</th>
			<th class="text-right text-nowrap col-1" ng-if="mode == 1" title="valid organizations"># approved</th>
			<th class="text-right text-nowrap col-1" ng-if="mode == 1" title="to be approved by an administrator"># suggested</th>
			<th class="text-right text-nowrap col-1" ng-if="mode == 1" title="raw organizations (not openorgs)"># raw</th>
			<th class="text-right text-nowrap col-1" ng-if="mode == 1" title="organizations hidden by the system (for example fixing a conflict)"># hidden</th>
		</tr>
	</thead>
	<tbody>
		<tr ng-repeat="e in entries | filter: browseFilter">
			<th>{{e.name}} <span ng-if="e.code != e.name"> ({{e.code}})</span></th>
			<td class="text-right">
				<a href="#!{{resultsBasePath}}/0/50/approved/{{e.code}}" ng-if="e.values.approved && e.values.approved > 0">{{e.values.approved}}</a>
				<span ng-if="!e.values.approved || e.values.approved == 0">-</span>
			</td>			
			<td class="text-right" ng-if="mode == 1">
				<a href="#!{{resultsBasePath}}/0/50/suggested/{{e.code}}" ng-if="e.values.suggested && e.values.suggested > 0">{{e.values.suggested}}</a>
				<span ng-if="!e.values.suggested || e.values.suggested == 0">-</span>
			</td>
			<td class="text-right" ng-if="mode == 1">
				<a href="#!{{resultsBasePath}}/0/50/raw/{{e.code}}" ng-if="e.values.raw && e.values.raw > 0">{{e.values.raw}}</a>
				<span ng-if="!e.values.raw || e.values.raw == 0">-</span>
			</td>
			<td class="text-right" ng-if="mode == 1">
				<a href="#!{{resultsBasePath}}/0/50/hidden/{{e.code}}" ng-if="e.values.hidden && e.values.hidden > 0">{{e.values.hidden}}</a>
				<span ng-if="!e.values.hidden || e.values.hidden == 0">-</span>
			</td>
		</tr>
	</tbody>
</table>
