<span class="addTenantButton" ng-if="access.tenant.add"><a href="" ng-click="addSubTenant(row)" class="btn btn-primary">{{translation.addNewSubTenant[LANG]}}</a></span>

<div class="entryBoxes">
	<div ng-repeat="row in tenantTabs[1].tenants" class="entryBox" ng-if="row.locked!==true">
		<div class="header closed">
			<a ng-click="openKeys(row['_id'], row)" href="" ng-hide="row.showKeys">
				<span class="icon icon-plus" tooltip="{{translation.expandApplications[LANG]}}"></span>
			</a>
			<a ng-click="closeKeys(row['_id'], row)" href="" ng-show="row.showKeys">
				<span class="icon icon-minus" tooltip="{{translation.collapseApplications[LANG]}}"></span>
			</a>
			<span class="icon icon-star-full no-margin" ng-if="row['dashboardAccess']"></span>{{row['name']}}<span>[ {{row['code']}}  - {{row['_id']}} ]</span>
			<span ng-if="row['tag']" ng-style="{'color':'#337ab7'}"><span class="icon icon-price-tag no-margin"></span>{{row['tag']}}</span>
		</div>
		<div class="body" ng-show="row.showKeys">
			<div class="description">{{row['description']}}</div>
			<div ng-if="access.tenant.application.list || access.tenant.oauth.users.list">
				<br/>
				<div class="keyAlerts" ng-show="mt[row['_id']].alerts.length >0" id="{{row['_id']}}">
					<alert ng-repeat="alert in mt[row['_id']].alerts" type="{{alert.type}}" class="" close="mt.closeAlert(0, row['_id'])">{{alert.msg}}</alert>
					<br/>
				</div>
				<tabset>
					<tab heading="{{translation.manageProducts[LANG]}}" ng-if="access.tenant.application.list">
						<div ng-include="'modules/dashboard/multitenancy/directives/list-applications.tmpl'"></div>
					</tab>
					<tab heading="{{translation.oAuthUsers[LANG]}}" ng-click="listOauthUsers(row)" ng-if="access.tenant.oauth.users.list"
					     ng-show="row.oauth.secret && row.oauth.secret!=='' && row.oauth.disabled === 0 && row.oauth.type===2 && row.oauth.loginMode==='oauth'" >
						<div ng-include="'modules/dashboard/multitenancy/directives/list-oauth-users.tmpl'"></div>
					</tab>
				</tabset>
			</div>
			<div class="entryAction">
				<a ng-if="access.tenant.update" href="" ng-click="tenantsList.actions.editTenant.command(row);">
					<span class="icon icon-pencil2" tooltip="{{translation.editTenant[LANG]}}"></span>
				</a>
				<a ng-if="access.tenant.delete" href="" ng-confirm-click="{{tenantsList.actions.delete.commandMsg}}" ng-click="tenantsList.actions.delete.command(row);">
					<span class="icon icon-cross" tooltip="{{translation.removeTenant[LANG]}}"></span>
				</a>
			</div>
		</div>
	</div>
</div>