solutions table

This commit is contained in:
Egor Matveev
2021-12-18 10:21:13 +03:00
parent bd9ffa20bc
commit c2b1e67be5
10 changed files with 158 additions and 54 deletions

View File

@@ -1,8 +1,24 @@
<table class="table" style="margin-top: 30px;">
<thead>
<th scope="col">id</th>
<th scope="col">Пользователь</th>
<th scope="col">Задача</th>
<th scope="col">Время отправки</th>
<th scope="col">Язык</th>
<th scope="col">Результат</th>
</thead>
<tbody id="solutions">
{% for solution in solutions %}
<tr>
<td>
<b><a href="/solution?solution_id={{ solution.id }}">{{ solution.id }}</a></b>
</td>
<td>
<img src="{{ solution.user.userinfo.profile_pic_url }}" width="30px" height="30px" style="border-radius: 50%; margin-right: 10px;"><a href="/account?username={{ solution.user.username }}">{{ solution.user }}</a>
</td>
<td>
<a href="/task?task_id={{ solution.task.id }}">{{ solution.task.name }}</a>
</td>
<td>
{{ solution.time_sent }}
</td>
@@ -16,4 +32,17 @@
</h4>
</td>
</tr>
{% endfor %}
{% endfor %}
</tbody>
</table>
{% if need_pagination %}
<div style="display: flex; justify-content: flex-end">
<table>
<tr>
{% for num in count_pages %}
<td><button class="btn btn-light" id="page_num_{{ num }}" onclick="setPage({{ num }})">{{ num }}</button></td>
{% endfor %}
</tr>
</table>
</div>
{% endif %}