
<md-toolbar layout="row" class="md-toolbar-tools md-whiteframe-4dp small-toolbar">
	<span flex></span>
	<h5>Estrattore distinte banca <small>({{ctrl.maxItems}} elementi)</small></h5>
	<span flex></span> 
		<md-button ng-click="ctrl.nuovoPiano($event)" class="toolbar-button">
		 		<i class="fa fa-plus"></i>
				<span>Nuovo</span>
				<md-tooltip>Nuovo piano di estrazione</md-tooltip>
		</md-button>

	<md-button ng-click="ctrl.delegatiFirma($event)" class="toolbar-button">
		 		<i class="fa fa-pencil-square-o"></i>
				<span>Delegati firma</span>
				<md-tooltip>Delegati alla firma</md-tooltip>
		</md-button>
</md-toolbar>
	
<md-content class="row" flex> 
	<md-card flex ng-repeat="data in ctrl.records"> 
		<md-card-title>
			<md-card-title-text layout="row"> 
				<md-checkbox disabled="disabled" ng-model="data.enabled" style="margin:0;padding:0;margin-right:16px;margin-top:-4px"></md-checkbox>
				<span class=""><b>{{data.denominazione}}</b></span> 
			</md-card-title-text> 
		</md-card-title> 
		<md-divider style="margin-left:16px;margin-right:16px"></md-divider>
		
		<md-card-content layout="row" layout-align="space-between">
			<div layout="column" flex>
				<div layout-gt-md="row" layout="column" flex>
					<div layout="row" flex>
						<div flex flex-md="25" flex-sm="25" flex-xs="25">
							<md-checkbox disabled="disabled" ng-model="data.scheduledDay2">Lun</md-checkbox>
						</div>
						<div flex flex-md="25" flex-sm="25" flex-xs="25">
							<md-checkbox disabled="disabled" ng-model="data.scheduledDay3">Mar</md-checkbox>
						</div>
						<div flex flex-md="25" flex-sm="25" flex-xs="25">
							<md-checkbox disabled="disabled" ng-model="data.scheduledDay4">Mer</md-checkbox>
						</div>
					</div>
					<div layout="row" flex>
						<div flex>
							<md-checkbox disabled="disabled" ng-model="data.scheduledDay5">Gio</md-checkbox>
						</div>
						<div flex>
							<md-checkbox disabled="disabled" ng-model="data.scheduledDay6">Ven</md-checkbox>
						</div>
						<div flex>
							<md-checkbox disabled="disabled" ng-model="data.scheduledDay7">Sab</md-checkbox>
						</div>
						<div flex>
							<md-checkbox disabled="disabled" ng-model="data.scheduledDay1">Dom</md-checkbox>
						</div>
					</div>
				</div>
				<div layout-gt-sm="row" layout="column">
					<div flex-gt-md="25" flex="100">
						Ora di avvio:<b>{{data.startTime.formatAsTime()}}</b>
					</div>
					<div flex-gt-md="25" flex="100">
						Ora cut-off:<b>{{data.cutOffDataCreazioneDisposizione.formatAsTime()}}</b>
					</div>
					<div flex-gt-md="50" flex="100">
						Estrai disposizione in stato: <b>{{data.statoDisposizioneDaEstrarre}}</b>
					</div>
				</div>
				<div layout-gt-sm="row" layout="column">
					<div flex-gt-md="25" flex="100">
						Ultimo avvio: <b>{{data.lastExecution.formatAsDateTime()}}</b>
					</div>
					<div flex-gt-md="25" flex="100">
						con esito: 
						<b> 
							<span ng-if="data.statusLastExecution==1">Tutte le disposizioni estratte</span> 
							<span ng-if="data.statusLastExecution==2">Alcune disposizioni non estratte per errori di convalida</span>
							<span ng-if="data.statusLastExecution==3">Alcune disposizioni non estratte</span>
							<span ng-if="data.statusLastExecution==4">Estrazione non effettuata</span>
						</b>
					</div>
					<div flex-gt-md="50" hide-md hide-sm hide-sx>
						
			
					</div>
				</div>
			</div>
			<md-card-actions layout="row"> 
				
				<md-button class="md-icon-button" aria-label="Modifica" ng-click="ctrl.modificaPiano($index, $event)"> 
					<md-tooltip>Modifica configurazione</md-tooltip> 
					<md-icon md-font-icon="fa-edit" class="fa fa-2x md-primary"></md-icon> 
				</md-button>
				<span flex></span>  
				<md-button class="md-icon-button" aria-label="Elimina" ng-click="ctrl.eliminaPiano($index, $event)"> 
					<md-tooltip>Elimina configurazione</md-tooltip> 
					<md-icon md-font-icon="fa-trash" class="fa fa-2x md-warn"></md-icon> 
				</md-button> 
			</md-card-actions>
		</md-card-content> 
	</md-card>
</md-content>

