Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Доработан шаблон #25

Merged
merged 2 commits into from
Nov 1, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ FROM python:3.11-slim-bullseye
COPY --from=builder /app /app
COPY adaptive_hockey_federation/ ./

CMD ["gunicorn", "adaptive_hockey_federation.wsgi:application", "--bind", "0:8000" ]
CMD ["/app/.venv/bin/gunicorn", "adaptive_hockey_federation.wsgi:application", "--bind", "0:8000" ]
1 change: 1 addition & 0 deletions adaptive_hockey_federation/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.1/font/bootstrap-icons.css">
<script src="https://cdn.tailwindcss.com"></script>
<title>
{% block title %}
Тут будет заголовок
Expand Down
12 changes: 7 additions & 5 deletions adaptive_hockey_federation/templates/includes/button.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<a href="#">
<button type="button" class="btn btn-info border border-white" role="button" data-bs-toggle="button">
{{ name }}
</button>
</a>
{% with request.path as current_url_name %}
<a href="{{ url_name }}"
class="nav-link border border-white bg-cyan-300 hover:bg-violet-950 text-white p-2 w-44 text-left
{% if current_url_name == url_name %}bg-violet-950{% endif %}">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Тут можно ещё улучшить и менять цвет текста кнопки, чтобы лучше читалось (кнопка тёмная цвет светлый и наоборот)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

оставила текст кнопки белым, т.к. на дизайн-проекте шрифт белый

{{ name }}
</a>
{% endwith %}
61 changes: 42 additions & 19 deletions adaptive_hockey_federation/templates/includes/drawer.html
Original file line number Diff line number Diff line change
@@ -1,21 +1,44 @@
<div class="offcanvas offcanvas-start" style="background-color: #6f42c1" data-bs-backdrop="static" tabindex="-1" id="staticBackdrop" aria-labelledby="staticBackdropLabel">

<div class="offcanvas-body">
<ul class="nav-list" style="list-style-type:none">
<div class="logo-img p-5">
<img src="https://paraicehockey.ru/wp-content/uploads/2022/02/FAH_q.png" width="150" height="150">
<div class="offcanvas offcanvas-start bg-violet-950" data-bs-backdrop="static" tabindex="-1"
id="staticBackdrop" aria-labelledby="staticBackdropLabel">

<div class="offcanvas-body mx-auto">
<ul class="nav-list" style="list-style-type:none">
<div class="container py-5">
<div class="row">
<div class="col-4 flex justify-end">
<span class="logo-img">
<img src="https://paraicehockey.ru/wp-content/uploads/2022/02/FAH_q.png" width="100" height="100">
</span>
</div>
<div class="col text-white flex justify-start">
Мир хокея<br>для особенных<br>детей
</div>
</div>
<li>{% include "includes/button.html" with name="Пользователи" %}</li>
<li>{% include "includes/button.html" with name="Команды" %}</li>
<li>{% include "includes/button.html" with name="Соревнования" %}</li>
<li>{% include "includes/button.html" with name="Аналитика" %}</li>
<li>{% include "includes/button.html" with name="Выгрузки" %}</li>
</ul>
</div>
</div>
<li class="nav-item py-2">
{% url 'main:users' as url_name %}{% include "includes/button.html" with name="Пользователи" %}
</li>
<li class="nav-item py-2">
{% url 'main:teams' as url_name %}{% include "includes/button.html" with name="Команды" %}
</li>
<li class="nav-item py-2">
{% url 'main:competitions' as url_name %}{% include "includes/button.html" with name="Соревнования" %}
</li>
<li class="nav-item py-2">
{% url 'main:analytics' as url_name %}{% include "includes/button.html" with name="Аналитика" %}
</li>
<li class="nav-item py-2">
{% url 'main:unloads' as url_name %}{% include "includes/button.html" with name="Выгрузки" %}
</li>
</ul>
</div>

<div class="offcanvas-footer p-5">
<button type="button" class="btn" data-bs-dismiss="offcanvas" aria-label="Close">
<i class="bi bi-caret-left-fill"></i>
</button>
</div>
</div>
<div class="offcanvas-footer pb-5">
<button type="button" class="btn ps-16" data-bs-dismiss="offcanvas" aria-label="Close">
<i class="bi bi-caret-left fs-3" style="color: white;"></i>
</button>
<button type="button" class="btn">
<i class="bi bi-caret-right-fill fs-3" style="color: white;"></i>
</button>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Лучше наверное оставить одну кнопку т.к. вторая по сути бессмысленная (закрыть сайдбар можно только из сайдбара, а открыть только из футера)

</div>
</div>
14 changes: 11 additions & 3 deletions adaptive_hockey_federation/templates/includes/dropdown_button.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle border border-primary" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">
{{ name }}
{% with request.resolver_match.view_name as view_name %}

<li class="nav-item dropdown mt-3">
<a class="nav-link dropdown-toggle border border-primary bg-white w-auto text-slate-400" href="#"
role="button" data-bs-toggle="dropdown" aria-expanded="false">
{% if view_name == 'main:users' %}Роль{% endif %}
{% if view_name == 'main:teams' %}Команда{% endif %}
{% if view_name == 'main:competitions' %}Соревнование{% endif %}
{% if view_name == 'main:analytics' %}Аналитика{% endif %}
{% if view_name == 'main:unloads' %}Выгрузка{% endif %}
</a>
<ul class="dropdown-menu">
<li><a class="dropdown-item" href="#">1</a></li>
Expand All @@ -9,3 +16,4 @@
<li><a class="dropdown-item" href="#">...</a></li>
</ul>
</li>
{% endwith %}
32 changes: 20 additions & 12 deletions adaptive_hockey_federation/templates/includes/footer.html
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
<div class="footer-copyright text-center py-3">
<nav class="navbar navbar-light" style="background-color: #0dcaf0">
<div class="container py-2">
<div class="footer-copyright py-3">
<nav class="navbar navbar-light bg-cyan-300">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Тут стоит убрать py-3 и тогда футер будет до самого низа страницы

<div class="container">
<div class="nav nav-pills justify-content-start">
<button class="btn" type="button" data-bs-toggle="offcanvas" data-bs-target="#staticBackdrop" aria-controls="staticBackdrop">
<i class="bi bi-caret-right-fill"></i>
<button class="btn" type="button">
<i class="bi bi-caret-left-fill fs-3" style="color: white;"></i>
</button>
<nav aria-label="Page navigation example">
<ul class="pagination">
<button class="btn" type="button" data-bs-toggle="offcanvas" data-bs-target="#staticBackdrop"
aria-controls="staticBackdrop">
<i class="bi bi-caret-right fs-3" style="color: white;"></i>
</button>
<nav aria-label="Page navigation example" class="p-2">
<ul class="pagination ps-8">
<li class="page-item">
<a class="page-link" href="#" aria-label="Previous">
<i class="bi bi-caret-left-fill"></i>
</a>
</li>
<li class="page-item"><a class="page-link" href="#">1</a></li>
<li class="page-item"><a class="page-link" href="#">2</a></li>
<li class="page-item"><a class="page-link" href="#">3</a></li>
<li class="page-item"><a class="page-link hover:text-black" href="#">1</a></li>
<li class="page-item"><a class="page-link hover:text-black" href="#">2</a></li>
<li class="page-item"><a class="page-link hover:text-black" href="#">3</a></li>
<li class="page-item">
<a class="page-link" href="#" aria-label="Next">
<i class="bi bi-caret-right-fill"></i>
Expand All @@ -24,8 +28,12 @@
</nav>
</div>
<ul class="nav nav-pills justify-content-end">
{% include "includes/button.html" with name="+ Пользователь" %}
{% include "includes/button.html" with name="Выгрузить" %}
{% with request.resolver_match.view_name as view_name %}
{% if view_name == 'main:users' %}{% include "includes/button.html" with name="+ Пользователь" %}{% endif %}
{% if view_name == 'main:teams' %}{% include "includes/button.html" with name="+ Команда" %}{% endif %}
{% if view_name == 'main:competitions' %}{% include "includes/button.html" with name="+ Соревнование" %}{% endif %}
{% if view_name != 'main:unloads' %}{% include "includes/button.html" with name="Выгрузить" %}{% endif %}
{% endwith %}
</ul>
</div>
</nav>
Expand Down
24 changes: 13 additions & 11 deletions adaptive_hockey_federation/templates/includes/header.html
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
<nav class="navbar navbar-light" style="background-color: #0dcaf0">
<div class="container py-2">
<nav class="navbar navbar-light bg-cyan-300">

<div class="container">
<ul class="nav d-flex justify-content-start">

<div class="border border-white">
Username
<div class="border border-white rounded px-2">
<i class="bi bi-circle-fill fs-2" style="color: red;"></i>
<b class="text-xl">Username</b>
</div>
</ul>
<ul class="nav d-flex justify-content-end">
{% include "includes/dropdown_button.html" with name="Роль" %}

<ul class="nav justify-content-end">
<li class="nav-item">
<a class="nav-link" href="##">
<i class="bi bi-search"></i>
{% include "includes/dropdown_button.html" %}
<a class="nav-link border border-primary mt-3 mb-4 bg-white p-0.5" href="##">
<i class="bi bi-search fs-4 bg-white" style="color: black;"></i>
</a>
</li>
<li class="nav-item">
<li class="nav-item ms-16">
<a class="nav-link" href="##">
<i class="bi bi-box-arrow-right"></i>
<i class="bi bi-box-arrow-right fs-1" style="color: white;"></i>
</a>
</li>
</ul>
Expand Down
Loading