<p ng-if="mode != 'select-modal'">
	<span ng-if="orgs.totalElements > 0">
		Page: {{orgs.number + 1}} / {{orgs.totalPages}}<br />
		Total elements: {{orgs.totalElements}}<br />
		{{searchMessage}}
	</span>
	<span ng-if="orgs.totalElements == 0">
		Page: -<br />
		Total elements: 0<br />
		{{searchMessage}}
	</span>
	<span ng-if="!(orgs.totalElements || orgs.totalElements === 0)">
		Page:<br />
		Total elements:<br />
		{{searchMessage}}
	</span>
</p>

<p ng-if="mode == 'select-modal'" class="text-right">
	<span ng-if="orgs.totalElements > 0"><b>Page:</b> {{orgs.number + 1}} / {{orgs.totalPages}} <b>- Total elements:</b> {{orgs.totalElements}}</span>
	<span ng-if="orgs.totalElements == 0"><b>Total elements:</b> 0</span>
</p>

<h4 ng-if="orgs.totalElements == 0" class="text-center">No results</h4>

<div ng-if="orgs.totalElements > 0">

	<nav>
		<ul class="pagination justify-content-center">
			<li class="page-item" ng-class="{'disabled' : orgs.first }">
				<a class="page-link" href="javascript:void(0)" ng-click="prevFunction()">&laquo; Previous</a>
			</li>
			<li class="page-item" ng-class="{'disabled' : orgs.last }">
				<a class="page-link" href="javascript:void(0)" ng-click="nextFunction()">Next &raquo;</a>
	    	</li>
		</ul>
	</nav>

	<p ng-if="mode == 'select-modal'">Click the <b>organization name</b> to add the organization (multiple selection is allowed)</p>

	<table class="table table-sm table-hover" ng-if="orgs.content.length > 0">
		<thead class="thead-light">
			<tr class="d-flex">
				<th class="col-6">Organization name</th>
				<th ng-class="{'col-3' : showNDups, 'col-4' : !showNDups }">Place</th>
				<th class="col-1 text-center">Acronyms</th>
				<th class="col-1 text-center" ng-if="showNDups"># Dups<br /><small>diff/sugg/sim</small></th>
				<th class="col-1 text-right">Type</th>
			</tr>
		</thead>
		<tbody>
			<tr ng-repeat="o in orgs.content" class="d-flex" ng-class="{'table-warning' : showStatus && o.status != 'approved'}">
				<td class="col-6">
					<a ng-if="(mode == 'select-modal') && !o.selected" href="javascript:void(0)" title="{{o.id}}" ng-click="selectOrg(o)">{{o.name}}</a>
					<span ng-if="(mode == 'select-modal') && o.selected" title="{{o.id}}" class="text-muted">{{o.name}} <b>(SELECTED)</b></span>
					<a ng-if="mode != 'select-modal'" href="#!/edit/0/{{o.id}}" title="{{o.id}}">{{o.name}}</a>
					<span class="badge badge-warning" ng-if="showStatus && o.status != 'approved'">{{o.status}}</span>
					<span ng-if="mode == 'select-modal'" class="small" ng-repeat="ourl in o.urls"><br /><b>URL: </b><a href="{{ourl}}" target="_blank" ng-if="ourl">{{ourl}}</a></span>
				</td>
				<td ng-class="{'col-3' : showNDups, 'col-4' : !showNDups }"><img ng-src="resources/images/flags/{{o.country}}.gif" /> {{o.city || '-'}}, {{o.country}}</td>
				<td class="col-1 text-center">{{o.acronyms.join()}}</td>
				<td class="col-1 text-center" ng-if="showNDups">
					<span ng-class="{'badge badge-danger' : o.nDifferentDups}">{{o.nDifferentDups ? o.nDifferentDups  : '-'}}</span> 
					/
					<span ng-class="{'badge badge-info' : o.nSuggestedDups}">{{o.nSuggestedDups ? o.nSuggestedDups : '-'}}</span> 
					/ 
					<span ng-class="{'badge badge-success' : o.nSimilarDups}">{{o.nSimilarDups ? o.nSimilarDups : '-'}}</span>
				</td>
				<td class="col-1 text-right">{{o.type}}</td>
			</tr>
		</tbody>
	</table>
	
</div>

