registration implemented

This commit is contained in:
Egor Matveev
2021-08-29 21:43:34 +03:00
parent f72801d6f5
commit 1307c16ec1
125 changed files with 2158 additions and 4631 deletions

View File

@@ -1,49 +1,34 @@
{% extends 'base.html' %}
{% extends 'base_main.html' %}
{% load filters %}
{% block title %}Рейтинг{% endblock %}
{% block content %}
<h3>Рейтинг (beta)</h3>
<h4><a style="color: black;" href="/{% if current_page == 'admin' %}admin/{% endif %}block?id={{ Block.id }}">{{ Block.name }}</a></h4>
<table border="1px solid black" style="width: 100%;">
<thead>
<tr>
<th scope="col">Студент</th>
{% for task in Block.tasks %}
<th>{% if admin_course %}<a href="/admin/solutions?block_id={{ Block.id }}&task_name={{ task.name }}">{{ task.name }}</a>{% else %}{{ task.name }}{% endif %}</th>
{% endfor %}
<th scope="col" style="background-color: lightblue;">Оценка</th>
</tr>
</thead>
<tbody>
{% for sub in Block.course.students %}
<tr>
<th scope="row">{% if admin_course %}<a href="/admin/solutions?block_id={{ Block.id }}&user={{ sub.user|userinfo_by_user }}">{{ sub.user|userinfo_by_user }}</a>{% else %}{{ sub.user|userinfo_by_user }}{% endif %}</th>
{% for task in Block.tasks %}
{% with status=sub.user|mark_status:task %}
<th style="background-color: {% if status == '-' %}white{% else %}{% if sub.user|fully_marked:task %}lime{% else %}yellow{% endif %}{% endif %};">
{% if current_page == 'admin' and status != '-' %}
<a style="color: black;" href="/admin/solutions?block_id={{ Block.id }}&user={{ sub.user|userinfo_by_user }}&task_name={{ task.name }}">{{ status }}</a>
{% else %}
{{ status }}
{% endif %}
</th>
{% endwith %}
{% endfor %}
<td style="background-color: lightblue;">
{% with mark=Block|mark_for_block:sub.user %}
{% if mark|marked %}
<div style="margin-left: 20px; border: 1px solid black; background: {{ mark|mark_color }}; width: 25px; text-align: center;">
{{ mark }}
</div>
{% endif %}
{% endwith %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
<button class="btn btn-dark" style="margin-top: 30px;" onclick="window.location.href='/admin/download_rating?block_id={{ Block.id }}'">Скачать csv</button>
{% block main %}
<h4>Рейтинг</h4>
<table class="table">
<thead>
<tr>
<th scope="col" style="text-align: center; vertical-align: middle; width: 70px;">#</th>
<th scope="col" style="vertical-align: middle;">Пользователь</th>
<th scope="col" style="vertical-align: middle;">Дата регистрации</th>
<th scope="col" style="text-align: center; vertical-align: middle;">Рейтинг</th>
</tr>
</thead>
<tbody>
{% for u in users %}
<tr {% if user == u %}style="background-color: #0000FF1E;"{% endif %}>
<td style="text-align: center; vertical-align: middle; width: 70px;">
{{ u.userinfo.place }}
</td>
<td style="vertical-align: middle;">
<img src="{{ u.userinfo.profile_pic_url }}" width="50px" height="50px" style="border-radius: 50%;">
<a href="/account?username={{ u.username }}">{{ u.username }}</a>
</td>
<td style="vertical-align: middle;">
{{ u.date_joined.date }}
</td>
<td style="text-align: center; vertical-align: middle;">
{{ u.userinfo.rating }}
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endblock %}