Skip to content

Instantly share code, notes, and snippets.

@Khuzha
Created August 16, 2020 21:13
Show Gist options
  • Save Khuzha/de1724ab96dda66f3721562279f0e576 to your computer and use it in GitHub Desktop.
Save Khuzha/de1724ab96dda66f3721562279f0e576 to your computer and use it in GitHub Desktop.
<% if (result.length !== 0) { %>
<h2 class="text-center">Результаты поиска</h2>
<table class="table table-hover">
<thead class="black white-text">
<tr>
<th scope="col">№</th>
<th scope="col">Фамилия, имя</th>
<th scope="col">Комната</th>
<th scope="col">Баллы</th>
</tr>
</thead>
<tbody>
<% for (const key in result) { %>
<a href='/floor_<%= result[key].floor.id %>/room_<%= result[key].room %>/lodger_<%= result[key].id %>'>
<tr class="clickable-row" data-href="/floor_<%= result[key].floor.id %>/room_<%= result[key].room %>/lodger_<%= result[key].id %>">
<th scope="row"><%= +key + 1 %></th>
<td><%= result[key].lastName %> <%= result[key].firstName %></td>
<td><%= result[key].room %></td>
</tr>
</a>
<% } %>
</tbody>
</table>
<% } else { %>
<h2 class="text-center">Поиск не дал результатов.</h2>
<% } %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment