<md-toolbar layout="row" class="md-toolbar-tools md-whiteframe-4dp small-toolbar" >
	<span flex></span>
   	<h5>Log acquisizione flussi dispositivi</h5>
    <span flex></span>
   	<div ng-if="largeScreen()" layout="row">
	     <md-button ng-click="ctrl.stampaLogStatiFlusso()" aria-label="Log stati flusso" class="hilight" style="margin-left:8px" layout="row">
	      	<md-icon  md-font-icon="fa-print" class="fa"></md-icon>
	       	Stampa log stati flusso
			<md-tooltip>Stampa log stati flusso</md-tooltip>
	     </md-button>
	</div>    
	<md-menu md-offset="0 50" ng-if="!largeScreen()" style="margin-top: -8px;">
		<md-button aria-label="Opzioni" class="md-icon-button" ng-click="$mdMenu.open($event)">
           	<md-icon  md-font-icon="fa-ellipsis-v" class="fa"></md-icon>
         	</md-button>
		<md-menu-content width="4">
  			<md-button ng-click="ctrl.stampaLogStatiFlusso()" aria-label="Log stati flusso" class="hilight" style="margin-left:8px" layout="row">
		      	<md-icon  md-font-icon="fa-print" class="fa"></md-icon>
	       		Stampa log stati flusso
				<md-tooltip>Stampa log stati flusso</md-tooltip>
	     	</md-button>	          
         </md-menu-content>
    </md-menu>
	    		
 </md-toolbar>
 
 <div layout="row" flex="100" style="width:100%">
 	<md-list id="list" flex>
 		<md-subheader layout="row">
 			<div flex="100" layout="row" id="header">
				<div style="width:20px">&nbsp;</div>				
	 		 	<md-button ng-click="ctrl.setOrderField('iddistintaFlusso')" ng-style="ctrl.getColumnWidth(0)">
	 				ID
	 				<md-icon md-font-icon="fa fa-sort" class="fa"></md-icon>
 				</md-button>
		 		<md-button ng-click="ctrl.setOrderField('dataCreazione')" ng-style="ctrl.getColumnWidth(1)">
		 			Data creazione
		 			<i class="fa fa-sort"></i>
	 			</md-button>
		 		
		 		<md-button ng-click="ctrl.setOrderField('provenienzaFlusso')" ng-style="ctrl.getColumnWidth(2)">
		 			Provenienza
		 			<i class="fa fa-sort"></i>
		 		</md-button>
		 		<md-button ng-click="ctrl.setOrderField('tipologiaDbgrid')" ng-style="ctrl.getColumnWidth(3)">
		 			Tipologia
		 			<i class="fa fa-sort"></i>
	 			</md-button>
				<md-button ng-click="ctrl.setOrderField('numeroDisposizioni')" ng-style="ctrl.getColumnWidth(4)">
		 			N.disp.<md-tooltip>Numero disposizioni</md-tooltip>
		 			<i class="fa fa-sort"></i>
	 			</md-button>
				<md-button ng-click="ctrl.setOrderField('importoDisposizioni')" ng-style="ctrl.getColumnWidth(5)">
		 			Importo
		 			<i class="fa fa-sort"></i>
	 			</md-button>
				<md-button ng-click="ctrl.setOrderField('statoDistinta')" ng-style="ctrl.getColumnWidth(6)">
		 			Stato flusso
		 			<i class="fa fa-sort"></i>
	 			</md-button>
				<md-button ng-click="ctrl.setOrderField('denominazioneFlusso')" ng-style="ctrl.getColumnWidth(7)">
		 			Denominazione flusso
		 			<i class="fa fa-sort"></i>
	 			</md-button>
				<md-button ng-click="ctrl.setOrderField('requiresFirmatario')" ng-style="ctrl.getColumnWidth(8)">
		 			Richiede firmatario
		 			<i class="fa fa-sort"></i>
	 			</md-button>
				<md-button ng-click="ctrl.setOrderField('tipoFlusso')" ng-style="ctrl.getColumnWidth(9)">
		 			Tipo flusso
		 			<i class="fa fa-sort"></i>
	 			</md-button>

 			</div>
		</md-subheader>
 		
		<div class="virtualRepeatVerticalUsage" id="container" ng-style="ctrl.getListHeight()" ng-style="ctrl.getMaxListWidth()">
			<md-virtual-repeat-container id="vertical-container" ng-style="ctrl.getMaxListWidth()">
			     <div class="md-1-line hilight" md-on-demand md-virtual-repeat="data in ctrl.infiniteItems" md-item-size="25" style="margin-left:30px" ng-style="ctrl.getMaxListWidth()">
				     <div class="md-1-line hilight" ng-style="ctrl.getGridItemHeight()" layout="row"   
				     		ng-class="{'status-unknown':data.statoDistinta=='In carico','status-error':data.statoDistinta=='Annullato', 'status-ok': data.statoDistinta=='Elaborato', 'odd-row':$index%2==1,'even-row':$index%2==0, 'selectedRow': ctrl.selectedIndex===$index}"
				     		 layout-align="start center" 
				     		 ng-click="ctrl.showCommands(data, $index, $event)">

						<div style="width:0" ng-style="ctrl.getGridItemHeight()"></div>
				     	<div ng-style="ctrl.getColumnWidth(0)" style="text-align:right"><span >{{data.iddistintaFlusso}}</span></div>
				     	<div ng-style="ctrl.getColumnWidth(1)" style="text-align:center"><span >{{data.dataCreazione.formatAsDateTime()}}</span></div>
				     	<div ng-style="ctrl.getColumnWidth(2)"><span >{{data.provenienzaFlusso}}</span></div>
				     	<div ng-style="ctrl.getColumnWidth(3)"><span >{{data.tipologiaDbgrid}}</span></div>
				     	<div ng-style="ctrl.getColumnWidth(4)" style="text-align:right"><span >{{data.numeroDisposizioni}}</span></div>
				     	<div ng-style="ctrl.getColumnWidth(5)" style="text-align:right"><span >{{data.importoDisposizioni}}</span></div>
				     	<div ng-style="ctrl.getColumnWidth(6)" style="text-align:center" ng-class="data.statoDistinta.allTrim()"><span >{{data.statoDistinta}}</span></div>
				     	<div ng-style="ctrl.getColumnWidth(7)" style="white-space: nowrap;overflow:hidden;text-overflow:ellipsis;"><span>{{data.denominazioneFlusso}}</span><md-tooltip>{{data.denominazioneFlusso}}</md-tooltip></div>
				     	<div ng-style="ctrl.getColumnWidth(8)" style="text-align:center" ><span><i class="fa fa-check" ng-if="data.requiresFirmatario"></i></span></div>
				     	<div ng-style="ctrl.getColumnWidth(9)" style="text-align:center;background-color:#fff9bf;" ><span >{{ctrl.decodeFlusso(data.tipoFlusso)}}</span></div>
				     	
				     </div>
			     </div>
		     </md-virtual-repeat-container>
	     </div>
			 	
 	</md-list>
 	

 
 </div>
