Skip to content

Commit 8f90673

Browse files
committed
Починка внедрений коммитов Вани: Добавление namespace в URL в HTML (сайт теперь работает)
1 parent fbcc6b0 commit 8f90673

28 files changed

Lines changed: 94 additions & 91 deletions

videodef/game/urls.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,15 @@
55

66
urlpatterns = [
77
path("", views.games, name="games"),
8-
path("my/", views.my_games_view, name="my_games"),
9-
path("puzzles/", views.puzzle_game, name="puzzle_game"),
108
path("whiteboard/", views.whiteboard, name="whiteboard"),
11-
path("puzzles/save/", views.save_puzzle_view, name="save_puzzle"),
12-
path("puzzles/load/", views.load_puzzles_view, name="load_puzzles"),
13-
path(
14-
"puzzles/update/<str:game_id>/", views.update_puzzle_view, name="update_puzzle"
15-
),
16-
path("delete/<str:game_id>/", views.delete_game_view, name="delete_game"),
17-
]
9+
path("puzzle/", views.puzzle_game, name="puzzle_game"),
10+
path("memory/", views.memory_game, name="memory_game"),
11+
path("my-games/", views.my_games_view, name="my_games"),
12+
path("api/save-puzzle/", views.save_puzzle_view, name="save_puzzle"),
13+
path("api/load-puzzles/", views.load_puzzles_view, name="load_puzzles"),
14+
path("api/update-puzzle/<int:game_id>/", views.update_puzzle_view, name="update_puzzle"),
15+
path("api/save-memory-game/", views.save_memory_game_view, name="save_memory_game"),
16+
path("api/load-memory-games/", views.load_memory_games_view, name="load_memory_games"),
17+
path("api/update-memory-game/<int:game_id>/", views.update_memory_game_view, name="update_memory_game"),
18+
path("api/delete-game/<int:game_id>/", views.delete_game_view, name="delete_game"),
19+
]

videodef/game/views.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,21 @@
1818

1919
def games(request):
2020
games = [
21-
{"title": "Интерактивная доска",\
21+
{"title": "Интерактивная доска",
2222
"description": "Интерактивная доска для совместного рисования и работы с изображениями \
23-
в реальном времени. Поддерживает многопользовательский режим, перетаскивание и масштабирование картинок.",\
24-
"image": "images/board.png",\
25-
"url": "whiteboard"},
26-
{"title": "Пазлы",\
23+
в реальном времени. Поддерживает многопользовательский режим, перетаскивание и масштабирование картинок.",
24+
"image": "images/board.png",
25+
"url": "game:whiteboard"},
26+
{"title": "Пазлы",
2727
"description": "Увлекательная игра, которая поможет развить внимание,\
2828
логику и пространственное восприятие. В этой игре вам предстоит собирать изображения, \
29-
разделенные на кусочки, и восстанавливать их в правильном порядке.",\
30-
"image": "images/Puzzle_game.png",\
31-
"url": "puzzle_game"},
32-
{"title": "Поиск пар",\
33-
"description": "Классическая игра на развитие памяти и концентрации. Открывайте карточки, запоминайте расположение уникальных изображений и находите совпадающие пары.",\
34-
"image": "images/Memory_game.png",\
35-
"url": "memory_game"},
29+
разделенные на кусочки, и восстанавливать их в правильном порядке.",
30+
"image": "images/Puzzle_game.png",
31+
"url": "game:puzzle_game"},
32+
{"title": "Поиск пар",
33+
"description": "Классическая игра на развитие памяти и концентрации. Открывайте карточки, запоминайте расположение уникальных изображений и находите совпадающие пары.",
34+
"image": "images/Memory_game.png",
35+
"url": "game:memory_game"},
3636
]
3737
return render(request, "game/game_main.html", {"games": games})
3838

videodef/templates/account/account.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
{% block page_name %}Аккаунт{% endblock %}
33
{% block content %}
44
<h2>Войдите в аккаунт</h2>
5-
<p><a href="{% url 'login' %}">Войти</a></p>
6-
<p><a href="{% url 'register' %}">Зарегистрироваться</a></p>
5+
<p><a href="{% url 'account:login' %}">Войти</a></p>
6+
<p><a href="{% url 'account:register' %}">Зарегистрироваться</a></p>
77
{% endblock %}

videodef/templates/account/edit_form.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<form method="post" enctype="multipart/form-data" class="mb-3 mt-3">
66
{% csrf_token %}
77

8-
<p><a href="{% url 'view_other_user' unique_id %}">Посмотреть на мою страничку со стороны</a></p>
8+
<p><a href="{% url 'account:view_other_user' unique_id %}">Посмотреть на мою страничку со стороны</a></p>
99
{% if forms.profile_form.instance.photo %}
1010
<img src="{{ forms.profile_form.instance.photo.url }}" style="width:150px;height:150px;">
1111
{% else %}
@@ -43,7 +43,7 @@
4343
<button type="submit" class="btn btn-primary mb-3 mt-3">Отправить изменения</button>
4444
</form>
4545
<div class="mb-3 mt-3">
46-
<p><a href="{% url 'logout' %}">Выйти</a></p>
46+
<p><a href="{% url 'account:logout' %}">Выйти</a></p>
4747
</div>
4848

4949

videodef/templates/account/login_form.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@
1111

1212
</form>
1313
<div class="mb-3 mt-3">
14-
<p>Нет аккаунта? <a href="{% url 'register' %}">Зарегистрироваться</a></p>
14+
<p>Нет аккаунта? <a href="{% url 'account:register' %}">Зарегистрироваться</a></p>
1515
</div>
1616
{% endblock %}

videodef/templates/account/register_form.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
<button type="submit" class="btn btn-primary mb-3 mt-3">Зарегистрироваться</button>
3939
</form>
4040
<div class="mb-3 mt-3">
41-
<p>Уже есть аккаунт? <a href="{% url 'login' %}">Войти</a></p>
41+
<p>Уже есть аккаунт? <a href="{% url 'account:login' %}">Войти</a></p>
4242
</div>
4343

4444

videodef/templates/account/user_view.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ <h2>{{ user_info.profile }}</h2>
1111
{% endif %}
1212
</div>
1313

14-
<a href="{% url 'get_chat' user_info.unique_id request.user.unique_id %}">Написать в чат</a>
14+
<a href="{% url 'chat:get_chat' user_info.unique_id request.user.unique_id %}">Написать в чат</a>
1515

1616
<p><strong>ID:</strong> {{ user_info.unique_id }}</p>
1717
<p><strong>Дата регистрации:</strong> {{ user_info.date_registr }} по мск</p>
@@ -33,7 +33,7 @@ <h2>{{ user_info.profile }}</h2>
3333
<div class="p-4 border rounded shadow-sm flex justify-between items-center">
3434
<div>
3535
<p class="text-xl">{{ resume.short_info }}</p>
36-
<a href="{% url 'public_resume_detail' resume.pk %}" class="text-blue-600 mt-2 inline-block">Подробнее</a>
36+
<a href="{% url 'resume:public_resume_detail' resume.pk %}" class="text-blue-600 mt-2 inline-block">Подробнее</a>
3737
</div>
3838
</div>
3939
{% empty %}

videodef/templates/base.html

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,46 +31,46 @@ <h1 class="circle-text">Видео дефектолог</h1>
3131

3232
<!-- Общие вкладки -->
3333
<li class="nav-item">
34-
<a class="nav-link" href="{% url 'about' %}"><i class="bi bi-info-circle"></i> О проекте</a>
34+
<a class="nav-link" href="{% url 'account:about' %}"><i class="bi bi-info-circle"></i> О проекте</a>
3535
</li>
3636
<li class="nav-item">
37-
<a class="nav-link" href="{% url 'games' %}"><i class="bi bi-controller"></i> Игры</a>
37+
<a class="nav-link" href="{% url 'game:games' %}"><i class="bi bi-controller"></i> Игры</a>
3838
</li>
3939
<li class="nav-item">
40-
<a class="nav-link" href="{% url 'chats' %}"><i class="bi bi-chat-left-text"></i> Переписки</a>
40+
<a class="nav-link" href="{% url 'chat:chats' %}"><i class="bi bi-chat-left-text"></i> Переписки</a>
4141
</li>
4242

4343
{% if user.is_authenticated %}
4444
<!-- Общие для преподавателя и родителя -->
4545
<li class="nav-item">
46-
<a class="nav-link" href="{% url 'my_games' %}"><i class="bi bi-person-circle"></i> Мои игры</a>
46+
<a class="nav-link" href="{% url 'game:my_games' %}"><i class="bi bi-person-circle"></i> Мои игры</a>
4747
</li>
4848
<li class="nav-item">
4949
<a class="nav-link" href="#"><i class="bi bi-calendar-event"></i> Расписание</a>
5050
</li>
5151

5252
{% if request.user.profile.role.name == 'Преподаватель' %}
5353
<li class="nav-item">
54-
<a class="nav-link" href="{% url 'my_documents' %}"><i class="bi bi-file-earmark-text"></i> Мои документы</a>
54+
<a class="nav-link" href="{% url 'document:my_documents' %}"><i class="bi bi-file-earmark-text"></i> Мои документы</a>
5555
</li>
5656
<li class="nav-item">
57-
<a class="nav-link" href="{% url 'my_resumes' %}"><i class="bi bi-file-earmark-text"></i> Мои резюме</a>
57+
<a class="nav-link" href="{% url 'resume:my_resumes' %}"><i class="bi bi-file-earmark-text"></i> Мои резюме</a>
5858
</li>
5959
{% endif %}
6060

6161
{% if request.user.profile.role.name == 'Родитель' %}
6262
<li class="nav-item">
63-
<a class="nav-link" href="{% url 'my_children' %}"><i class="bi bi-person-lines-fill"></i> Мои дети</a>
63+
<a class="nav-link" href="{% url 'child:my_children' %}"><i class="bi bi-person-lines-fill"></i> Мои дети</a>
6464
</li>
6565
<li class="nav-item">
66-
<a class="nav-link" href="{% url 'public_resume_list' %}"><i class="bi bi-search"></i> Найти преподавателя</a>
66+
<a class="nav-link" href="{% url 'resume:public_resume_list' %}"><i class="bi bi-search"></i> Найти преподавателя</a>
6767
</li>
6868
{% endif %}
6969
{% endif %}
7070

7171
<!-- Всегда доступно -->
7272
<li class="nav-item">
73-
<a class="nav-link" href="{% url 'account' %}"><i class="bi bi-person-circle"></i> Личный кабинет</a>
73+
<a class="nav-link" href="{% url 'account:account' %}"><i class="bi bi-person-circle"></i> Личный кабинет</a>
7474
</li>
7575
</ul>
7676
</div>
@@ -83,7 +83,7 @@ <h1 class="circle-text">Видео дефектолог</h1>
8383
{% include "messages.html" %}
8484
{% include "non_field_errors.html" %}
8585

86-
<h2 class="display-4 text-center mb-4 page_name">{% block page_name %}{% endblock %}</h2>
86+
<h2 class="display-4 text-center mb-4 page-name">{% block page_name %}{% endblock %}</h2>
8787

8888
{% block content %}{% endblock %}
8989
</div>

videodef/templates/chat/chat_room.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{% block style %}<link rel="stylesheet" href="{% static 'css/chat/chat_room.css' %}" />{% endblock %}
44
{% block page_name %}Чат{% endblock %}
55
{% block content %}
6-
<a href="{% url 'chats' %}" class="back-button">&lt;</a>
6+
<a href="{% url 'chat:chats' %}" class="back-button">&lt;</a>
77
<div class="chat-container">
88
<div class="chat-header">
99
<div class="chat-user-view-container">

videodef/templates/chat/chat_room_user_view.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{% include "field/photo.html" with img_class="small-avatar" %}
22
<div id="view-other-user-box" data-other-user-id="{{ user.unique_id }}" data-csrf-token="{{ csrf_token }}">
3-
<strong><a href="{% url 'view_other_user' user.unique_id %}" class="chat-room-user-view-link">{{ user.profile }}</a></strong>
3+
<strong><a href="{% url 'account:view_other_user' user.unique_id %}" class="chat-room-user-view-link">{{ user.profile }}</a></strong>
44
<br>
55
<small id="last-active-date" data-gender="{{ user.profile.gender }}" data-date="{{ user.last_seen|date:'Y-m-d H:i:s' }}"
66
data-curr-date="{{ curr_date|date:'Y-m-d H:i:s' }}">

0 commit comments

Comments
 (0)