104 lines
3.0 KiB
HTML
104 lines
3.0 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>Tavres: Решение задач</title>
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.8/js/bootstrap.min.js"></script>
|
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.8/css/bootstrap.min.css" integrity="sha512-2bBQCjcnw658Lho4nlXJcc6WkV/UxpE/sAokbXPxQNGqmNdQrWqtw26Ns9kFF/yG792pKR1Sx8/Y1Lf1XN4GKA==" crossorigin="anonymous" referrerpolicy="no-referrer" />
|
|
|
|
<style>
|
|
.accordion-button {
|
|
--bs-accordion-active-bg: #e7bbce;
|
|
--bs-accordion-btn-bg: #9fe1f3;
|
|
font-size: 1.7rem;
|
|
}
|
|
body {
|
|
font-size: 30px;
|
|
}
|
|
h1 {
|
|
width: 100%;
|
|
text-align:center;
|
|
background-color: #080;
|
|
border-radius: 10px;
|
|
border:1px solid #000;
|
|
margin:0;
|
|
}
|
|
.main {
|
|
border: 2px solid #ccc;
|
|
border-radius: 10px;
|
|
background-color: #eee;
|
|
}
|
|
td {
|
|
border: 2px solid #ccc;
|
|
border-radius: 10px;
|
|
background-color: #fff;
|
|
}
|
|
td:first-child {
|
|
border: 0px solid #ccc;
|
|
border-radius: 10px;
|
|
background-color: #eee;
|
|
}
|
|
th {
|
|
width: 300px;
|
|
}
|
|
th:first-child {
|
|
width: 30px;
|
|
}
|
|
.hide {
|
|
display:none;
|
|
}
|
|
h1 a {
|
|
color:#000;
|
|
text-decoration:none;
|
|
}
|
|
.solved {
|
|
--bs-accordion-active-bg: #6fcba0;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="navbar navbar-dark bg-dark box-shadow">
|
|
<div class="container d-flex justify-content-between">
|
|
<span class="navbar-brand d-flex align-items-center">{{ user.username }}</span>
|
|
<a href="logout" class="btn btn-primary my-2">Выход</a>
|
|
</div>
|
|
</div>
|
|
<main class="col-12">
|
|
<div class="accordion" id="accordionExample">
|
|
{% for p in problems %}
|
|
<div class="accordion-item">
|
|
<h2 class="accordion-header">
|
|
<button class="accordion-button collapsed {% if resolved|dict_key:p.id == 1 %}solved{% endif %}" type="button" data-bs-toggle="collapse" data-bs-target="#collapse-{{p.id}}" aria-expanded="false" aria-controls="collapse-{{p.id}}">
|
|
{{ p.Name }}{% if resolved|dict_key:p.id == 1 %} (Решена){% endif %}
|
|
</button>
|
|
</h2>
|
|
<div id="collapse-{{p.id}}" class="accordion-collapse collapse" data-bs-parent="#accordionExample">
|
|
<div class="accordion-body">
|
|
<a href="/pm/{{p.id}}/">подробнее</a>
|
|
{% autoescape off %}
|
|
<p>{{ p.Description }}</p>
|
|
{% endautoescape %}
|
|
|
|
<img src="{{ p.Image }}">
|
|
{% if resolved|dict_key:p.id == 1 %}
|
|
<p><b>Задача успешно решена</b></p>
|
|
<p><a href="{{ link|dict_key:p.id }}">Скачать решение</a></p>
|
|
|
|
<p><b>{{ message|dict_key:p.id }}</b></p>
|
|
{% else %}
|
|
<form method="POST" enctype="multipart/form-data">
|
|
{% csrf_token %}
|
|
<input type="file" name="resolve">
|
|
<input type="hidden" name="problem" value="{{ p.id }}">
|
|
<input type="submit">
|
|
</form>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
</main>
|
|
</body>
|
|
</html> |