<commit_before><h2>Список заказов</h2>

<form action= "/order" method="post" role="form">

<table class="table table-striped" width="80%" >
		<thead>
		  	<col width="50">
			<tr>
				<th> Id </th>
				<th> Title </th>
				<th> Size </th>
				<th> Price per piece </th>
				<th> Quantity </th>
			<tr>
		</thead>
		<tbody>
		<% total = 0 %>
		<% list = '' %>		
		<% @res ||= {} %>
		<% @res.each do |key, val| %>
			<% @products.each do |p| %>
				<% if p.id === key.to_i %>
					<tr>
						<td><%= p.id %></td>
						<td><%= p.title %></td>
						<td><%= p.size %> cm</td>
						<td><%= p.price %> rub</td>
						<td><%= val %></td>
					</tr>	
					<% total += p.price*val.to_i %>
					<% list = list + ' ' + p.title + '(' + val + ');' %>		
				<% end %>
			<% end %>	
		<% end %>	
		<tr>
			<td></td>
			<td></td>
			<td></td>
			<td></td> 
			<td align='right'>
			Total price: <%= total%> rub
			</td>
		</tr>	
	</tbody>
</table>
<input id="orders_input" name="orders" type="text" value="<%= list %>">
<button type="submit" class="btn btn-primary btn-lg btn-block">Перейти к оплате</button>
</form><commit_msg>Fix cart erb page. Refactoring, step 3<commit_after><h2>Список заказов</h2>

<form action= "/order" method="post" role="form">

<table class="table table-striped" width="80%" >
		<thead>
		  	<col width="50">
			<tr>
				<th> Id </th>
				<th> Title </th>
				<th> Size </th>
				<th> Price per piece </th>
				<th> Quantity </th>
			<tr>
		</thead>
		<tbody>
		<% total = 0 %>
		<% list = '' %>		
		<% @items ||= {} %>
		<% @items.each do |key, val| %>
			<tr>
				<td><%= key.id %></td>
				<td><%= key.title %></td>
				<td><%= key.size %> cm</td>
				<td><%= key.price %> rub</td>
				<td><%= val %></td>
			</tr>	
			<% total += key.price*val.to_i %>
			<% list = list + ' ' + key.title + '(' + val + ');' %>		
		<% end %>	
		<tr>
			<td></td>
			<td></td>
			<td></td>
			<td></td> 
			<td align='right'>  
			Total price: <%= total%> rub
			</td>
		</tr>	
	</tbody>
</table>
<input id="orders_input" name="orders" type="text" value="<%= list %>">
<button type="submit" class="btn btn-primary btn-lg btn-block">Перейти к оплате</button>
</form>
{'fraction_non_alphanumeric': 0.26651270207852196, 'fraction_numerical': 0.006928406466512702, 'mean_word_length': 2.4545454545454546, 'pattern_counts': {'":': 0, '<': 135, '<?xml version=': 0, '>': 135, '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': '1148005', 'n_tokens_mistral': 1146, 'n_tokens_neox': 908, 'n_words': 207}