+{% endblock %}
\ No newline at end of file
diff --git a/shiftflow/templates/shiftflow/partials/_filter.html b/shiftflow/templates/shiftflow/partials/_filter.html
new file mode 100644
index 0000000..de4d3ce
--- /dev/null
+++ b/shiftflow/templates/shiftflow/partials/_filter.html
@@ -0,0 +1,45 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/shiftflow/urls.py b/shiftflow/urls.py
new file mode 100644
index 0000000..bbab240
--- /dev/null
+++ b/shiftflow/urls.py
@@ -0,0 +1,10 @@
+from django.urls import path
+from .views import IndexView, RegistryView
+
+urlpatterns = [
+ # Главная страница (путь пустой)
+ path('', IndexView.as_view(), name='index'),
+
+ # Реестр
+ path('registry/', RegistryView.as_view(), name='registry'),
+]
\ No newline at end of file
diff --git a/shiftflow/views copy.py b/shiftflow/views copy.py
new file mode 100644
index 0000000..384b9b6
--- /dev/null
+++ b/shiftflow/views copy.py
@@ -0,0 +1,72 @@
+from django.shortcuts import render
+from .models import Item, Machine
+from django.utils import timezone
+from datetime import datetime
+
+def items_list_view(request):
+ # Если не авторизован, просто отдаем пустой контекст для страницы входа
+ if not request.user.is_authenticated:
+ return render(request, 'shiftflow/items_list.html', {})
+
+ # ОПРЕДЕЛЕНИЕ РОЛИ (Ищем в группах Джанго или ставим суперюзера)
+ user_role = 'guest'
+ if request.user.is_superuser:
+ user_role = 'admin'
+ elif request.user.groups.filter(name='Технолог').exists():
+ user_role = 'technologist'
+ elif request.user.groups.filter(name='Мастер').exists():
+ user_role = 'master'
+ elif request.user.groups.filter(name='Оператор').exists():
+ user_role = 'operator'
+ elif request.user.groups.filter(name='Учетчик').exists():
+ user_role = 'clerk'
+
+ # ФИЛЬТРЫ
+ all_machines = Machine.objects.all()
+ all_machine_ids = list(all_machines.values_list('id', flat=True))
+
+ # Проверяем, был ли нажат фильтр (есть ли параметр 'filtered' в URL)
+ is_filtered = 'filtered' in request.GET
+
+ if is_filtered:
+ selected_machines = [int(x) for x in request.GET.getlist('m_ids')]
+ selected_statuses = request.GET.getlist('statuses')
+ start_date = request.GET.get('start_date')
+ end_date = request.GET.get('end_date')
+ else:
+ # Значения по умолчанию (при первом заходе или сбросе)
+ selected_machines = all_machine_ids
+ selected_statuses = ['work', 'partial'] # В работе и недоделы
+ start_date = timezone.now().strftime('%Y-%m-%d')
+ end_date = timezone.now().strftime('%Y-%m-%d')
+
+ # ВЫБОРКА ДАННЫХ
+ items = Item.objects.select_related('deal', 'material', 'machine')
+
+ # Защита логики: если станки не выбраны — список пуст
+ if not selected_machines:
+ items = Item.objects.none()
+ else:
+ items = items.filter(
+ machine_id__in=selected_machines,
+ status__in=selected_statuses,
+ date__range=[start_date, end_date]
+ )
+
+ # Разбиваем по статусам для вывода в разные таблицы (если они выбраны в фильтре)
+ in_work = items.filter(status='work') if 'work' in selected_statuses else None
+ backlog = items.filter(status='partial') if 'partial' in selected_statuses else None
+ done_items = items.filter(status='done') if 'done' in selected_statuses else None
+
+ context = {
+ 'user_role': user_role,
+ 'machines': all_machines,
+ 'selected_machines': selected_machines,
+ 'selected_statuses': selected_statuses,
+ 'start_date': start_date,
+ 'end_date': end_date,
+ 'in_work': in_work,
+ 'backlog': backlog,
+ 'done_items': done_items,
+ }
+ return render(request, 'shiftflow/items_list.html', context)
\ No newline at end of file
diff --git a/shiftflow/views.py b/shiftflow/views.py
index 91ea44a..3fa9b78 100644
--- a/shiftflow/views.py
+++ b/shiftflow/views.py
@@ -1,3 +1,32 @@
-from django.shortcuts import render
+from django.shortcuts import redirect
+from django.views.generic import TemplateView, ListView
+from django.contrib.auth.mixins import LoginRequiredMixin
+from .models import Item # Проверь, как точно называется твоя модель деталей/заказов
-# Create your views here.
+# Класс главной страницы (роутер)
+class IndexView(TemplateView):
+ template_name = 'shiftflow/landing.html'
+
+ def get(self, request, *args, **kwargs):
+ # Если юзер авторизован — сразу отправляем его в реестр
+ if request.user.is_authenticated:
+ return redirect('registry')
+ # Если нет — показываем кнопку "Войти"
+ return super().get(request, *args, **kwargs)
+
+# Класс реестра деталей (защищен LoginRequiredMixin)
+class RegistryView(LoginRequiredMixin, ListView):
+ model = Item
+ template_name = 'shiftflow/items_list.html'
+ context_object_name = 'items'
+
+ def get_queryset(self):
+ # Позже здесь добавим: .filter(machine__in=request.user.profile.machines.all())
+ return Item.objects.all().order_by('-id')
+
+ def get_context_data(self, **kwargs):
+ context = super().get_context_data(**kwargs)
+ # Передаем роль в шаблон, чтобы скрывать/показывать кнопки
+ if hasattr(self.request.user, 'profile'):
+ context['user_role'] = self.request.user.profile.role
+ return context
\ No newline at end of file
diff --git a/static/css/style.css b/static/css/style.css
new file mode 100644
index 0000000..f763d1c
--- /dev/null
+++ b/static/css/style.css
@@ -0,0 +1,38 @@
+/* Акцентные цвета для темной темы */
+[data-bs-theme="dark"] {
+ --bs-body-bg: #121212;
+ --bs-body-color: #e9ecef;
+ --bs-accent: #ffc107; /* Тот самый желтый */
+}
+
+[data-bs-theme="dark"] .table-custom-header {
+ background-color: #1e1e1e !important;
+ color: var(--bs-accent) !important;
+}
+
+/* Акцентные цвета для светлой темы */
+[data-bs-theme="light"] {
+ --bs-body-bg: #e2e2e2;
+ --bs-body-color: #212529;
+ --bs-accent: #0f5132; /* Темно-зеленый */
+}
+
+/* Общие классы */
+.text-accent {
+ color: var(--bs-accent) !important;
+}
+
+.btn-outline-accent {
+ color: var(--bs-accent) !important;
+ border-color: var(--bs-accent) !important;
+}
+
+.btn-outline-accent:hover {
+ background-color: var(--bs-accent) !important;
+ color: #000 !important;
+}
+
+/* Фикс для навигации */
+.nav-link.active {
+ border-bottom: 2px solid var(--bs-accent);
+}
\ No newline at end of file
diff --git a/templates/base.html b/templates/base.html
new file mode 100644
index 0000000..8a47f62
--- /dev/null
+++ b/templates/base.html
@@ -0,0 +1,47 @@
+{% load static %}
+
+
+
+
+
+ {% block title %}ShiftFlow MES{% endblock %}
+
+
+
+
+
+
+ {% if user.is_authenticated %}
+ {% include 'components/_navbar.html' %}
+ {% endif %}
+
+
+ {% block content %}{% endblock %}
+
+
+ {% if user.is_authenticated %}
+ {% include 'components/_footer.html' %}
+ {% endif %}
+
+
+
+
+
+
\ No newline at end of file
diff --git a/templates/components/_footer.html b/templates/components/_footer.html
new file mode 100644
index 0000000..7a3912f
--- /dev/null
+++ b/templates/components/_footer.html
@@ -0,0 +1,7 @@
+
\ No newline at end of file
diff --git a/templates/components/_navbar.html b/templates/components/_navbar.html
new file mode 100644
index 0000000..5fba7fb
--- /dev/null
+++ b/templates/components/_navbar.html
@@ -0,0 +1,57 @@
+
\ No newline at end of file
diff --git a/templates/registration/login.html b/templates/registration/login.html
new file mode 100644
index 0000000..98a98fd
--- /dev/null
+++ b/templates/registration/login.html
@@ -0,0 +1,40 @@
+{% extends 'base.html' %}
+
+{% block content %}
+