Merge branch 'develop' into feature/profile_page_lookfix

This commit is contained in:
Andrew Smirnov
2021-04-29 20:13:47 +03:00
51 changed files with 1554 additions and 373 deletions

View File

@@ -15,21 +15,27 @@
{% else %}
class="btn btn-secondary"
{% endif %}
href="{% url 'profile' %}">Профиль</a>
href="{% url 'profile' %}">Профиль</a>
{% if perms.main.has_control_access %}
<a {% if control_lit %}
class="btn btn-primary"
{% else %}
class="btn btn-secondary"
{% endif %}
href="{% url 'control' %}">Управление</a>
href="{% url 'control' %}">Управление</a>
<a {% if stats_lit %}
class="btn btn-primary"
{% else %}
class="btn btn-secondary"
{% endif %}
href="{% url 'statistic' %}">Статистика</a>
{% else %}
<a {% if work_lit %}
class="btn btn-primary"
{% else %}
class="btn btn-secondary"
{% endif %}
href="{% url 'work' request.user.id %}">Запрос прав</a>
href="{% url 'work' request.user.id %}">Запрос прав</a>
{% endif %}
<a class="btn btn-secondary" href="{% url 'logout' %}">Выйти</a>
</div>
@@ -40,13 +46,13 @@
{% else %}
class="btn btn-secondary"
{% endif %}
href="/accounts/login">Войти</a>
href="/accounts/login">Войти</a>
<a {% if registration_lit %}
class="btn btn-primary"
{% else %}
class="btn btn-secondary"
{% endif %}
href="/accounts/register">Зарегистрироваться</a>
href="/accounts/register">Зарегистрироваться</a>
</div>
{% endif %}
</nav>

View File

@@ -1,14 +0,0 @@
<div class="mt-5">
{% for message in messages %}
<div
class="alert alert-{{ message.tags }} alert-dismissible fade show p-2"
role="alert"
style="display: flex; align-items: center; justify-content: space-between;"
>
{{ message }}
<div>
<button type="button" class="btn btn-light p-2" data-bs-dismiss="alert" aria-label="Close">X</button>
</div>
</div>
{% endfor %}
</div>

View File

@@ -7,7 +7,8 @@
{% block heading %}Управление{% endblock %}
{% block extra_css %}
<link rel="stylesheet" href="{% static 'main/css/work.css' %}"/>
<link rel="stylesheet" href="{% static 'main/css/work.css' %}" xmlns="http://www.w3.org/1999/html">
<link rel="stylesheet" href="{% static 'modules/notifications/dist/notifications.css' %}">
{% endblock %}
{% block extra_scripts %}
@@ -15,15 +16,22 @@
<script src="https://unpkg.com/react-dom@17/umd/react-dom.development.js" crossorigin></script>
<script src="https://unpkg.com/babel-standalone@6/babel.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
{% endblock%}
<script src="{% static 'modules/notifications/dist/notifications.js' %}"></script>
<script src="{% static 'main/js/control.js'%}" type="text/babel"></script>
<script src="{% static 'main/js/notifications.js' %}"></script>
{% endblock%}
{% block content %}
<div class="container-md">
<div class="new-section">
<p class="row page-description">Свободных Мест: {{ licences_remaining }}</p>
<p class="row page-description" id="licences_remaining">Свободных Мест:</p>
</div>
{% for message in messages %}
<script>create_notification('{{message}}','','{{message.tags}}',2000)</script>
{% endfor %}
{% block form %}
<form method="post">
{% csrf_token %}
@@ -37,10 +45,16 @@
<table class="table table-dark light-table">
<thead>
<th>
<input
type="checkbox"
class="form-check-input"
id="head-checkbox"
/>
</th>
<th>Name</th>
<th>Email</th>
<th>Role</th>
<th>Checked</th>
</thead>
<tbody id="tbody"></tbody>
@@ -93,9 +107,6 @@
</form>
{% endblock %}
{% include 'base/success_messages.html' %}
</div>
<script src="{% static 'main/js/control.js'%}" type="text/babel"></script>
{% endblock %}

View File

@@ -31,6 +31,7 @@
alt="Нет изображения"
>
</div>
<a href="{%url 'password_change' %}">Сменить пароль</a>
</div>
<div class="col">
<h4><span class="badge bg-secondary text-light">Имя пользователя</span></h4> <h5><strong>{{ profile.name }}</strong></h5>

View File

@@ -26,7 +26,7 @@
<div class="col-auto">
{% for radio in form.interval%}
{{ radio.tag }}
<label class="btn btn-secondary text-primary bg-white" for="{{ radio.id_for_label }}">
<label class="btn btn-outline-secondary" for="{{ radio.id_for_label }}">
{{ radio.choice_label }}
</label>
{% endfor %}
@@ -39,7 +39,7 @@
<div class="col-auto">
{% for radio in form.display_format%}
{{ radio.tag }}
<label class="btn btn-secondary text-primary bg-white" for="{{ radio.id_for_label }}">
<label class="btn btn-outline-secondary" for="{{ radio.id_for_label }}">
{{ radio.choice_label }}
</label>
{% endfor %}
@@ -67,7 +67,7 @@
</div>
<div class="form-row text-center">
<div class="col-12">
<button type="submit" class="btn btn-primary bg-white text-primary">Посмотреть статистику</button>
<button type="submit" class="btn btn-outline-primary">Посмотреть статистику</button>
</div>
</div>
</form>
@@ -86,9 +86,9 @@
<table class="table table-bordered text-center text-secondary mt-5" style="background-color:#f2f2f2;">
<thead>
<tr>
<td scope="col">Пользователи/Даты</td>
<td scope="col">&nbsp;</td>
{% for date in log_stats.keys %}
<td scope="col">{{date}}</td>
<td scope="col">{{ date | date:'d.m' }}</td>
{% endfor %}
</tr>
</thead>
@@ -96,7 +96,7 @@
<tr>
<td>{{ form.email.value }}</td>
{% for time in log_stats.values %}
<td>{{time}}</td>
<td>{{ time | floatformat:2 }}</td>
{% endfor %}
</tr>
</tbody>

View File

@@ -7,7 +7,12 @@
{% block heading %}Управление правами{% endblock %}
{% block extra_css %}
<link rel="stylesheet" href="{% static 'main/css/work.css' %}">
<link rel="stylesheet" href="{% static 'main/css/work.css' %}" xmlns="http://www.w3.org/1999/html">
<link rel="stylesheet" href="{% static 'modules/notifications/dist/notifications.css' %}">
{% endblock %}
{% block extra_scripts %}
<script src="{% static 'modules/notifications/dist/notifications.js' %}"></script>
<script src="{% static 'main/js/notifications.js' %}"></script>
{% endblock %}
{% block content %}
@@ -66,8 +71,10 @@
<button type="submit" class="default-button">Взять тикеты в работу</button>
</form>
</div>
{% for message in messages %}
<script>create_notification('{{message}}','','{{message.tags}}',2000)</script>
{% endfor %}
</div>
{% include 'base/success_messages.html' %}
</div>
{% endblock %}

View File

@@ -0,0 +1,12 @@
{% extends "base/base.html" %}
{% load static %}
{% block title %}Пароль успешно изменен{% endblock title %}
{% block heading %}Пароль успешно изменен{% endblock %}
{% block content %}
<div>
<h4>Ваш пароль был изменен.</h4>
</div>
{% endblock content %}

View File

@@ -0,0 +1,14 @@
{% extends "base/base.html" %}
{% load static %}
{% block title %}Изменение пароля{% endblock title %}
{% block heading %}Сменить пароль{% endblock %}
{% block content %}
<form method="post">
{% csrf_token %}
{{ form.as_p }}
<input type="submit" value="Сменить" class="btn btn-success">
</form>
{% endblock content %}