начал работать с интерфейсом
All checks were successful
Deploy MES Core / deploy (push) Successful in 9s
All checks were successful
Deploy MES Core / deploy (push) Successful in 9s
This commit is contained in:
47
templates/base.html
Normal file
47
templates/base.html
Normal file
@@ -0,0 +1,47 @@
|
||||
{% load static %}
|
||||
<!DOCTYPE html>
|
||||
<html lang="ru" data-bs-theme="dark">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>{% block title %}ShiftFlow MES{% endblock %}</title>
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.1/font/bootstrap-icons.css">
|
||||
<link rel="stylesheet" href="{% static 'css/style.css' %}">
|
||||
</head>
|
||||
<body class="d-flex flex-column min-vh-100">
|
||||
|
||||
{% if user.is_authenticated %}
|
||||
{% include 'components/_navbar.html' %}
|
||||
{% endif %}
|
||||
|
||||
<main class="container-fluid py-3 flex-grow-1 d-flex flex-column justify-content-center">
|
||||
{% block content %}{% endblock %}
|
||||
</main>
|
||||
|
||||
{% if user.is_authenticated %}
|
||||
{% include 'components/_footer.html' %}
|
||||
{% endif %}
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bundle.min.js"></script>
|
||||
<script>
|
||||
function updateThemeIcon(theme) {
|
||||
const icon = document.getElementById('theme-icon');
|
||||
if (icon) icon.className = theme === 'dark' ? 'bi bi-brightness-high-fill' : 'bi bi-moon-stars-fill';
|
||||
}
|
||||
function toggleTheme() {
|
||||
const html = document.documentElement;
|
||||
const newTheme = html.getAttribute('data-bs-theme') === 'dark' ? 'light' : 'dark';
|
||||
html.setAttribute('data-bs-theme', newTheme);
|
||||
localStorage.setItem('theme', newTheme);
|
||||
updateThemeIcon(newTheme);
|
||||
}
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
const savedTheme = localStorage.getItem('theme') || 'dark';
|
||||
document.documentElement.setAttribute('data-bs-theme', savedTheme);
|
||||
updateThemeIcon(savedTheme);
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
7
templates/components/_footer.html
Normal file
7
templates/components/_footer.html
Normal file
@@ -0,0 +1,7 @@
|
||||
<footer class="mt-auto py-3 bg-body-tertiary border-top">
|
||||
<div class="container-fluid text-center">
|
||||
<span class="text-muted small">
|
||||
Система учета сменных заданий, разработана <strong>ACK</strong> © 2026
|
||||
</span>
|
||||
</div>
|
||||
</footer>
|
||||
57
templates/components/_navbar.html
Normal file
57
templates/components/_navbar.html
Normal file
@@ -0,0 +1,57 @@
|
||||
<nav class="navbar navbar-expand-lg border-bottom shadow-sm">
|
||||
<div class="container-fluid">
|
||||
<a class="navbar-brand fw-bold text-accent" href="/">
|
||||
<i class="bi bi-gear-fill me-2"></i>ShiftFlow
|
||||
</a>
|
||||
|
||||
<div class="collapse navbar-collapse">
|
||||
<ul class="navbar-nav me-auto">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link {% if request.resolver_match.url_name == 'items_list' %}active{% endif %}" href="{% url 'registry' %}">Реестр</a>
|
||||
</li>
|
||||
|
||||
{% if user_role in 'admin,technologist' %}
|
||||
<li class="nav-item"><a class="nav-link" href="#">Планирование</a></li>
|
||||
{% endif %}
|
||||
|
||||
{% if user_role in 'admin,technologist,master,operator' %}
|
||||
<li class="nav-item"><a class="nav-link" href="#">Закрытие</a></li>
|
||||
{% endif %}
|
||||
|
||||
{% if user_role in 'admin,technologist,clerk' %}
|
||||
<li class="nav-item"><a class="nav-link" href="#">Списание</a></li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
|
||||
<div class="d-flex align-items-center gap-3">
|
||||
<span class="badge bg-secondary opacity-75 px-3 py-2 fw-normal">
|
||||
<i class="bi bi-person-circle me-1"></i>
|
||||
{% if user_role == 'admin' %}Админ
|
||||
{% elif user_role == 'technologist' %}Технолог
|
||||
{% elif user_role == 'master' %}Мастер
|
||||
{% elif user_role == 'operator' %}Оператор
|
||||
{% elif user_role == 'clerk' %}Учетчик
|
||||
{% endif %}
|
||||
({{ request.user.username|upper }})
|
||||
</span>
|
||||
|
||||
{% if user_role == 'admin' %}
|
||||
<a href="/admin/" class="btn btn-link text-decoration-none text-reset p-0" title="Админка">
|
||||
<i class="bi bi-shield-lock fs-5"></i>
|
||||
</a>
|
||||
{% endif %}
|
||||
|
||||
<button class="btn btn-link text-reset p-0" onclick="toggleTheme()" title="Сменить тему">
|
||||
<i id="theme-icon" class="bi fs-5"></i>
|
||||
</button>
|
||||
|
||||
<form action="{% url 'logout' %}" method="post" class="d-inline">
|
||||
{% csrf_token %}
|
||||
<button type="submit" class="btn btn-link text-danger p-0 ms-2" title="Выйти">
|
||||
<i class="bi bi-box-arrow-right fs-5"></i>
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
40
templates/registration/login.html
Normal file
40
templates/registration/login.html
Normal file
@@ -0,0 +1,40 @@
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row justify-content-center align-items-center" style="min-height: 70vh;">
|
||||
<div class="col-md-4">
|
||||
<div class="card border-secondary shadow-lg">
|
||||
<div class="card-body p-5">
|
||||
<div class="text-center mb-4">
|
||||
<h2 class="text-accent fw-bold"><i class="bi bi-shield-lock me-2"></i>ВХОД</h2>
|
||||
<p class="text-muted small">Введите ваши данные для доступа к системе</p>
|
||||
</div>
|
||||
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
|
||||
{% if form.errors %}
|
||||
<div class="alert alert-danger small py-2">
|
||||
Неверное имя пользователя или пароль.
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="form-label small fw-bold">Логин</label>
|
||||
<input type="text" name="username" class="form-control form-control-lg border-secondary" placeholder="Имя пользователя" required>
|
||||
</div>
|
||||
|
||||
<div class="mb-4">
|
||||
<label class="form-label small fw-bold">Пароль</label>
|
||||
<input type="password" name="password" class="form-control form-control-lg border-secondary" placeholder="••••••••" required>
|
||||
</div>
|
||||
|
||||
<button type="submit" class="btn btn-outline-accent w-100 py-2 fw-bold shadow-sm">
|
||||
АВТОРИЗОВАТЬСЯ
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user