<commit_before><!-- Check the group of the user to display element with the good color -->	
<% 
	if(app.models.user.isDST()) { 
		var classColor = "warning";
		var actionRequestToProcess = lang.actions.confirm;
	}
	else if(app.models.user.isManager()){
		var classColor = "info";
		var actionRequestToProcess = lang.actions.process;
	}
	else{ 
		var classColor = "";
		var actionRequestToProcess = "";
	} 
%>



<div class="page-header">
	<h1>
		<%= lang.viewsTitles.requestsList %>
		<sup rel="tooltip" data-original-title="<%= actionRequestToProcess %>">
			<i class="badge badge-<%= classColor %>" >
				<%= nbInterventionsInBadge %>
			</i>
		</sup>
	</h1>
</div>


<div class="container-fluid">

	<!-- Message if No Request to Display -->
	<% if(requests.length == 0) { %>
		<div class="tableToolbar">
			<br>

			<div class="alert alert-info">
				<i class="icon-info-sign icon-large"></i> &nbsp;<%= lang.infoMessages.noRequest %>.
			</div>
		</div>
	<% } %>


		<!-- Table toolbar -->
		<div class="tableToolbar">
			<a href="#demandes-dinterventions/add" class="btn btn-primary"><i class="icon-plus-sign"></i> <%= _.capitalize(lang.actions.addRequest) %></a>

			<form class="form-search pull-right">
    			<div class="input-append">
					<input type="search" class="input-medium search-query" disabled="disabled" placeholder="<%= lang.actions.search %>..." autocomplete="off">
					<button type="submit" class="btn disabled"><i class="icon-search icon-large"></i></button>
				</div>
			</form>
		</div>
		<!-- Table toolbar -->


		<!-- Table Requests -->
		<table class="table table-striped table-bordered table-hover">
			<thead>
				<tr>
					<th><%= _.capitalize(lang.label) %></th>
					<th class="hidden-phone"><%= _.capitalize(lang.place) %></th>
					<th><%= _.capitalize(lang.service) %></th>
					<th><%= _.capitalize(lang.claiment) %></th>
					<th><%= _.capitalize(lang.dateRequest) %> <!--<a id="orderDateRequest" href="#" class="pull-right"><i class="icon-caret-down icon-large"></i></a>--></th>
					<th>
						<%= _.capitalize(lang.status) %> 
						<div class="dropdown pull-right">
						    <a id="filterStateRequest" class="dropdown-toggle filter-button" data-toggle="dropdown" href="#"><i class="icon-filter icon-large"></i></a>
						    
						    <ul id="filterStateRequestList" class="dropdown-menu" role="menu" aria-labelledby="filterStateRequest">
								<% _.each(requestsState, function (state, i) { %>
									<li role="menuitem">
										<a tabindex="-1" href="#<%= state.value %>"> 
											<i class="badge <%= (state.color != '' ? 'badge-'+state.color : '') %>">&nbsp;</i>
											&nbsp; <%= _.capitalize(state.traduction) %>
										</a>
									</li>
								<% }) %>
									<li class="divider"></li>
									<li class="delete-filter disabled"><a href="#delete-filter"><i class="icon-remove"></i> <%= _.capitalize(lang.deleteFilter) %></a></li>
							</ul>
						</div>
					</th>
					
					<% if(app.models.user.isDST() || app.models.user.isManager()){ %>
						<th><%= _.capitalize(lang.action) %></th>
					<% } %>
				</tr>
			</thead>

		<!-- Check if there is Request in the Database -->
		<% if(requests.length != 0) { %>

			<tbody>
				<% for (var i = startPos; i < endPos; i++) { %>
				
					<!-- Set if the table row should be hightlight and Bold -->
					<% if(requests[i].state == app.Models.Request.state[1].value && app.models.user.isManager()) {
						var classRow = classColor+" bolder";
					}
					else if(requests[i].state == app.Models.Request.state[4].value && app.models.user.isDST()){
						var classRow = classColor+" bolder";
					}
					else{
						var classRow = "";
					}
					var description = (requests[i].description != '' ? requests[i].description : _.capitalize(lang.notKnown))
					var createdBy = (requests[i].create_uid != ''  
										?_.capitalize(lang.createdBy) + requests[i].create_uid[1] 
										: "")
					var modifydBy = (requests[i].write_uid != ''  
										?_.capitalize(lang.modifyBy) + requests[i].write_uid[1] 
										: "")
					%>

					<tr id="<%= requests[i].id %>" class="<%= classRow %>">
					    <td>
					    	<a 	href="#demandes-dinterventions/<%= requests[i].id %>" 
								rel="popover" 
								data-content="<%=  description + '\n(' + createdBy +')' %>"
								data-original-title="<%= _.capitalize(lang.description)  %>:">
								<%= _.capitalize(requests[i].name) %>
							</a>
						</td>
						<td><%= (requests[i].site1 != false ? _(requests[i].site1[1].toLowerCase()).titleize() : "") %></td>
						<td class="hidden-phone">
					    	<span 
					    		rel="tooltip"
					    		data-original-title="<%= _.capitalize(lang.toValidateBy) %> <%= (requests[i].manager_id != false ? requests[i].manager_id[1] : _.capitalize(lang.notKnown)) %>">
					    		<!--  <%= requests[i].service_id[1] %>  -->
					    		<%= requests[i].belongsToService!=null?requests[i].belongsToService.name:"" %>
					    	</span>
					    </td>
					    <td><%= requests[i].partner_id[1] %></td>
					    <td>
							<span 
					    		rel="tooltip"
					    		data-original-title="<%= moment(requests[i].create_date, 'YYYY-MM-DD HH:mm:ss').add('hours',1).fromNow() %>">
					    		<%= ( requests[i].create_date != null &&  requests[i].create_date != "" ) ? moment(requests[i].create_date, 'YYYY-MM-DD HH:mm:ss').add('hours',1).format('LLL'): "" %><commit_msg>Ajout du numéro de demande d'intervention dans le tableau<commit_after><!-- Check the group of the user to display element with the good color -->	
<% 
	if(app.models.user.isDST()) { 
		var classColor = "warning";
		var actionRequestToProcess = lang.actions.confirm;
	}
	else if(app.models.user.isManager()){
		var classColor = "info";
		var actionRequestToProcess = lang.actions.process;
	}
	else{ 
		var classColor = "";
		var actionRequestToProcess = "";
	} 
%>



<div class="page-header">
	<h1>
		<%= lang.viewsTitles.requestsList %>
		<sup rel="tooltip" data-original-title="<%= actionRequestToProcess %>">
			<i class="badge badge-<%= classColor %>" >
				<%= nbInterventionsInBadge %>
			</i>
		</sup>
	</h1>
</div>


<div class="container-fluid">

	<!-- Message if No Request to Display -->
	<% if(requests.length == 0) { %>
		<div class="tableToolbar">
			<br>

			<div class="alert alert-info">
				<i class="icon-info-sign icon-large"></i> &nbsp;<%= lang.infoMessages.noRequest %>.
			</div>
		</div>
	<% } %>


		<!-- Table toolbar -->
		<div class="tableToolbar">
			<a href="#demandes-dinterventions/add" class="btn btn-primary"><i class="icon-plus-sign"></i> <%= _.capitalize(lang.actions.addRequest) %></a>

			<form class="form-search pull-right">
    			<div class="input-append">
					<input type="search" class="input-medium search-query" disabled="disabled" placeholder="<%= lang.actions.search %>..." autocomplete="off">
					<button type="submit" class="btn disabled"><i class="icon-search icon-large"></i></button>
				</div>
			</form>
		</div>
		<!-- Table toolbar -->


		<!-- Table Requests -->
		<table class="table table-striped table-bordered table-hover">
			<thead>
				<tr>
					<th>N°</th>
					<th><%= _.capitalize(lang.label) %></th>
					<th class="hidden-phone"><%= _.capitalize(lang.place) %></th>
					<th><%= _.capitalize(lang.service) %></th>
					<th><%= _.capitalize(lang.claiment) %></th>
					<th><%= _.capitalize(lang.dateRequest) %> <!--<a id="orderDateRequest" href="#" class="pull-right"><i class="icon-caret-down icon-large"></i></a>--></th>
					<th>
						<%= _.capitalize(lang.status) %> 
						<div class="dropdown pull-right">
						    <a id="filterStateRequest" class="dropdown-toggle filter-button" data-toggle="dropdown" href="#"><i class="icon-filter icon-large"></i></a>
						    
						    <ul id="filterStateRequestList" class="dropdown-menu" role="menu" aria-labelledby="filterStateRequest">
								<% _.each(requestsState, function (state, i) { %>
									<li role="menuitem">
										<a tabindex="-1" href="#<%= state.value %>"> 
											<i class="badge <%= (state.color != '' ? 'badge-'+state.color : '') %>">&nbsp;</i>
											&nbsp; <%= _.capitalize(state.traduction) %>
										</a>
									</li>
								<% }) %>
									<li class="divider"></li>
									<li class="delete-filter disabled"><a href="#delete-filter"><i class="icon-remove"></i> <%= _.capitalize(lang.deleteFilter) %></a></li>
							</ul>
						</div>
					</th>
					
					<% if(app.models.user.isDST() || app.models.user.isManager()){ %>
						<th><%= _.capitalize(lang.action) %></th>
					<% } %>
				</tr>
			</thead>

		<!-- Check if there is Request in the Database -->
		<% if(requests.length != 0) { %>

			<tbody>
				<% for (var i = startPos; i < endPos; i++) { %>
				
					<!-- Set if the table row should be hightlight and Bold -->
					<% if(requests[i].state == app.Models.Request.state[1].value && app.models.user.isManager()) {
						var classRow = classColor+" bolder";
					}
					else if(requests[i].state == app.Models.Request.state[4].value && app.models.user.isDST()){
						var classRow = classColor+" bolder";
					}
					else{
						var classRow = "";
					}
					var description = (requests[i].description != '' ? requests[i].description : _.capitalize(lang.notKnown))
					var createdBy = (requests[i].create_uid != ''  
										?_.capitalize(lang.createdBy) + requests[i].create_uid[1] 
										: "")
					var modifydBy = (requests[i].write_uid != ''  
										?_.capitalize(lang.modifyBy) + requests[i].write_uid[1] 
										: "")
					%>

					<tr id="<%= requests[i].id %>" class="<%= classRow %>">
					    <td><%= requests[i].id %></td>
					    <td>
					    	<a 	href="#demandes-dinterventions/<%= requests[i].id %>" 
								rel="popover" 
								data-content="<%=  description + '\n(' + createdBy +')' %>"
								data-original-title="<%= _.capitalize(lang.description)  %>:">
								<%= _.capitalize(requests[i].name) %>
							</a>
						</td>
						<td><%= (requests[i].site1 != false ? _(requests[i].site1[1].toLowerCase()).titleize() : "") %></td>
						<td class="hidden-phone">
					    	<span 
					    		rel="tooltip"
					    		data-original-title="<%= _.capitalize(lang.toValidateBy) %> <%= (requests[i].manager_id != false ? requests[i].manager_id[1] : _.capitalize(lang.notKnown)) %>">
					    		<!--  <%= requests[i].service_id[1] %>  -->
					    		<%= requests[i].belongsToService!=null?requests[i].belongsToService.name:"" %>
					    	</span>
					    </td>
					    <td><%= requests[i].partner_id[1] %></td>
					    <td>
							<span 
					    		rel="tooltip"
					    		data-original-title="<%= moment(requests[i].create_date, 'YYYY-MM-DD HH:mm:ss').add('hours',1).fromNow() %>">
					    		<%= ( requests[i].create_date != null &&  requests[i].create_date != "" ) ? moment(requests[i].create_date, 'YYYY-MM-DD HH:mm:ss').add('hours',1).format('LLL'): "" %>
{'fraction_non_alphanumeric': 0.2175793833410032, 'fraction_numerical': 0.003129314312011045, 'mean_word_length': 2.8450106157112525, 'pattern_counts': {'":': 0, '<': 296, '<?xml version=': 0, '>': 294, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2239078', 'n_tokens_mistral': 4809, 'n_tokens_neox': 3639, 'n_words': 632}