-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5091c41
commit 9fd58af
Showing
36 changed files
with
495 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from django.apps import AppConfig | ||
|
||
|
||
class CoreConfig(AppConfig): | ||
default_auto_field = 'django.db.models.BigAutoField' | ||
name = 'core' |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
from django import template | ||
|
||
register = template.Library() | ||
|
||
|
||
@register.filter | ||
def addclass(field, css): | ||
return field.as_widget(attrs={'class': css}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
from django.shortcuts import render | ||
|
||
|
||
def page_not_found(request, exception): | ||
return render(request, 'core/404.html', {'path': request.path}, status=404) | ||
|
||
|
||
def csrf_failure(request, reason=''): | ||
return render(request, 'core/403csrf.html') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{% extends "base.html" %} | ||
{% block title %} Кастомная ошибка доступа {% endblock %} | ||
{% block content %} | ||
<h1>Custom permission denied</h1> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{% extends "base.html" %} | ||
{% block content %} | ||
<h1>Custom CSRF check error. 403</h1> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{% extends "base.html" %} | ||
{% block title %}Custom 404{% endblock %} | ||
{% block content %} | ||
<h1>Custom 404</h1> | ||
<p>Страницы с адресом {{ path }} не существует</p> | ||
<a href="{% url 'main:main' %}">Идите на главную</a> | ||
{% endblock %} |
14 changes: 14 additions & 0 deletions
14
adaptive_hockey_federation/templates/includes/forms_errors.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{% if form.errors %} | ||
{% for field in form %} | ||
{% for error in field.errors %} | ||
<div class="alert alert-danger"> | ||
{{ error|escape }} | ||
</div> | ||
{% endfor %} | ||
{% endfor %} | ||
{% for error in form.non_field_errors %} | ||
<div class="alert alert-danger"> | ||
{{ error|escape }} | ||
</div> | ||
{% endfor %} | ||
{% endif %} |
39 changes: 25 additions & 14 deletions
39
adaptive_hockey_federation/templates/includes/header.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,35 @@ | ||
<nav class="navbar navbar-light" style="background-color: #64c2d1;"> | ||
{% load static %} | ||
<nav class="top-menu" style="background-color: #64c2d1;"> | ||
|
||
<div class="container"> | ||
<div class="nav justify-content-end"> | ||
<ul class="nav d-flex justify-content-start"> | ||
{% if request.user.is_authenticated %} | ||
<div class="border border-white rounded px-2"> | ||
<i class="bi bi-circle-fill fs-3" style="color: black;"></i> | ||
<a href="{% url 'users:profile' user.username %}"> | ||
<b class="text-xl" style="color: #340061;">{{ user.username }}</b> | ||
</a> | ||
</div> | ||
<div class="border border-white rounded px-2"> | ||
<i class="bi bi-circle-fill fs-3" style="color: red;"></i> | ||
<b class="text-xl" style="color: #340061;">Username</b> | ||
<a href="{% url 'users:logout' %}"> | ||
<b class="text-xl" style="color: #340061;">Выйти</b> | ||
</a> | ||
</div> | ||
</ul> | ||
<ul class="nav justify-content-end"> | ||
<li class="nav-item d-flex"> | ||
|
||
<a class="nav-link border border-primary place-self-center bg-white p-0.5" href="##"> | ||
<i class="bi bi-search fs-5 p-1 bg-white" style="color: grey;"></i> | ||
{% else %} | ||
<div class="border border-white rounded px-2"> | ||
<i class="bi bi-circle-fill fs-3" style="color: green;"></i> | ||
<a href="{% url 'users:login' %}"> | ||
<b class="text-xl" style="color: #340061;">Войти</b> | ||
</a> | ||
</li> | ||
<li class="nav-item ms-16"> | ||
<a class="nav-link p-0" href="##"> | ||
<i class="bi bi-box-arrow-right fs-1" style="color: white;"></i> | ||
</div> | ||
<div class="border border-white rounded px-2"> | ||
<i class="bi bi-circle-fill fs-3" style="color: blue;"></i> | ||
<a href="{% url 'users:signup' %}"> | ||
<b class="text-xl" style="color: #340061;">Регистрация</b> | ||
</a> | ||
</li> | ||
</div> | ||
{% endif %} | ||
</ul> | ||
</div> | ||
</nav> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{% extends 'base.html' %} | ||
{% block title %} | ||
Главная страница | ||
{% endblock %} | ||
{% block content %} | ||
Главная страница | ||
{% endblock %} |
4 changes: 4 additions & 0 deletions
4
adaptive_hockey_federation/templates/registration/includes/close_divs.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
</div> | ||
</div> | ||
</div> | ||
</div> |
17 changes: 17 additions & 0 deletions
17
adaptive_hockey_federation/templates/registration/includes/fields_form.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{% load user_filters %} | ||
<div class="form-group row my-3"> | ||
<label for="{{ field.id_for_label }}"> | ||
{{ field.label }} | ||
{% if field.field.required %} | ||
<span class="required text-danger">*</span> | ||
{% endif %} | ||
</label> | ||
{{ field|addclass:'form-control' }} | ||
{% if field.help_text %} | ||
<small | ||
id="{{ field.id_for_label }}-help" | ||
class="form-text text-muted"> | ||
{{ field.help_text|safe }} | ||
</small> | ||
{% endif %} | ||
</div> |
4 changes: 4 additions & 0 deletions
4
adaptive_hockey_federation/templates/registration/includes/open_divs.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<div class="container py-5"> | ||
<div class="row justify-content-center"> | ||
<div class="col-md-8 p-5"> | ||
<div class="card"> |
12 changes: 12 additions & 0 deletions
12
adaptive_hockey_federation/templates/registration/password_change_done.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{% extends "base.html" %} | ||
{% block title %} Пароль изменён {% endblock %} | ||
{% block content %} | ||
{% include 'registration/includes/open_divs.html' %} | ||
<div class="card-header"> | ||
Пароль изменён | ||
</div> | ||
<div class="card-body"> | ||
<p>Пароль изменён успешно</p> | ||
</div> | ||
{% include 'registration/includes/close_divs.html' %} | ||
{% endblock %} |
29 changes: 29 additions & 0 deletions
29
adaptive_hockey_federation/templates/registration/password_change_form.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{% extends "base.html" %} | ||
{% block title %} Изменение пароля {% endblock %} | ||
{% block content %} | ||
{% include 'registration/includes/open_divs.html' %} | ||
<div class="card-header"> | ||
Изменить пароль | ||
</div> | ||
<div class="card-body"> | ||
{% include 'includes/forms_errors.html' %} | ||
<form method="post" | ||
{% if action_url %} | ||
action="{% url action_url %}"> | ||
{% endif %} | ||
> | ||
|
||
|
||
{% for field in form %} | ||
{% include 'registration/includes/fields_form.html' %} | ||
{% endfor %} | ||
<div class="col-md-6 offset-md-4"> | ||
<button type="submit" class="btn btn-primary"> | ||
Сменить пароль | ||
</button> | ||
</div> | ||
</form> | ||
|
||
</div> | ||
{% include 'registration/includes/close_divs.html' %} | ||
{% endblock %} |
23 changes: 23 additions & 0 deletions
23
adaptive_hockey_federation/templates/registration/password_reset_complete.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{% extends "base.html" %} | ||
{% block title %} Сброс пароля прошёл успешно {% endblock %} | ||
{% block content %} | ||
{% include 'registration/includes/open_divs.html' %} | ||
<div class="card"> | ||
<form method="action" action="{% url 'users:login' %}"> | ||
<div class="form-group"> | ||
<div class="card-header"> | ||
Восстановление пароля завершено | ||
</div> | ||
<div class="card-body"> | ||
<p>Ваш пароль был сохранен. Используйте его для входа</p> | ||
<div class="col-md-6 offset-md-4"> | ||
<button type='submit' class="btn btn-primary"> | ||
Войти | ||
</button> | ||
</div> | ||
</div> | ||
</div> | ||
</form> | ||
</div> | ||
{% include 'registration/includes/close_divs.html' %} | ||
{% endblock %} |
36 changes: 36 additions & 0 deletions
36
adaptive_hockey_federation/templates/registration/password_reset_confirm.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{% extends "base.html" %} | ||
{% block title %} Новый пароль {% endblock %} | ||
{% block content %} | ||
{% if validlink %} | ||
{% include 'registration/includes/open_divs.html' %} | ||
<div class="card-body"> | ||
{% include 'includes/forms_errors.html' %} | ||
|
||
<form method="post" | ||
{% if action_url %} | ||
action="{% url action_url %}"> | ||
{% endif %} | ||
> | ||
{% csrf_token %} | ||
|
||
{% for field in form %} | ||
{% include 'registration/includes/fields_form.html' %} | ||
{% endfor %} | ||
<div class="col-md-6 offset-md-4"> | ||
<button type="submit" class="btn btn-primary"> | ||
Назначить новый пароль | ||
</button> | ||
</div> | ||
</form> | ||
|
||
</div> | ||
{% else %} | ||
<div class="card-header"> | ||
Ошибка | ||
</div> | ||
<div class="card-body"> | ||
<p>Ссылка сброса пароля содержит ошибку или устарела.</p> | ||
</div> | ||
{% endif %} | ||
{% include 'registration/includes/close_divs.html' %} | ||
{% endblock %} |
12 changes: 12 additions & 0 deletions
12
adaptive_hockey_federation/templates/registration/password_reset_done.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{% extends "base.html" %} | ||
{% block title %} Сброс пароля прошёл успешно {% endblock %} | ||
{% block content %} | ||
{% include 'registration/includes/open_divs.html' %} | ||
<div class="card-header"> | ||
Отправлено письмо | ||
</div> | ||
<div class="card-body"> | ||
<p>Проверьте свою почту, вам должно прийти письмо со ссылкой для восстановления пароля</p> | ||
</div> | ||
{% include 'registration/includes/close_divs.html' %} | ||
{% endblock %} |
Oops, something went wrong.