diff --git a/core/views.py b/core/views.py index 334fcdd..9949dcc 100644 --- a/core/views.py +++ b/core/views.py @@ -12,6 +12,7 @@ from core.models.directories import Directory from core.models import ConnectorConfig from core.utils.htmx import render_page from core.utils.pagination import paginate +from django.utils.translation import gettext_lazy as _ # Create your views here. @@ -345,11 +346,11 @@ def timetrack_view(request): fg, muted, warn = 'var(--color-foreground)', 'var(--color-muted-foreground)', 'var(--color-warning)' metrics = [ - {'label': 'Робочих днів', 'value': stats['workdays'], 'hint': 'з відмітками', 'color': fg}, - {'label': 'Співробітників', 'value': stats['employees'], 'hint': 'відмічались', 'color': fg}, - {'label': 'Змін', 'value': stats['shifts'], 'hint': 'за місяць', 'color': fg}, - {'label': 'Незакритих', 'value': stats['incomplete'],'hint': 'без уходу', 'color': warn if stats['incomplete'] else muted}, - {'label': 'Всього годин', 'value': stats['hours'], 'hint': 'відпрацьовано','color': fg}, + {'label': _('Рабочих дней'), 'value': stats['workdays'], 'hint': _('с отметками'), 'color': fg}, + {'label': _('Сотрудников'), 'value': stats['employees'], 'hint': _('отмечались'), 'color': fg}, + {'label': _('Смен'), 'value': stats['shifts'], 'hint': _('за месяц'), 'color': fg}, + {'label': _('Незакрытых'), 'value': stats['incomplete'],'hint': _('без ухода'), 'color': warn if stats['incomplete'] else muted}, + {'label': _('Всего часов'), 'value': stats['hours'], 'hint': _('отработано'), 'color': fg}, ] page = paginate(request, rows) diff --git a/locale/en/LC_MESSAGES/django.mo b/locale/en/LC_MESSAGES/django.mo index 27acb5c..0bfdf35 100644 Binary files a/locale/en/LC_MESSAGES/django.mo and b/locale/en/LC_MESSAGES/django.mo differ diff --git a/locale/en/LC_MESSAGES/django.po b/locale/en/LC_MESSAGES/django.po index 15c3d10..cc775a7 100644 --- a/locale/en/LC_MESSAGES/django.po +++ b/locale/en/LC_MESSAGES/django.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-07-27 21:58+0300\n" +"POT-Creation-Date: 2026-07-28 10:05+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -19,7 +19,7 @@ msgstr "" #: apps/ad_connector/models.py:10 apps/employees/models/base.py:186 #: apps/employees/models/permissions.py:47 templates/pages/employees.html:103 -#: templates/pages/hr-portal.html:215 +#: templates/pages/hr-portal.html:215 templates/pages/timetrack.html:58 msgid "Сотрудник" msgstr "Employee" @@ -272,7 +272,7 @@ msgstr "Warehouse" #: apps/employees/models/base.py:83 apps/locations/models/base.py:31 #: templates/pages/employees.html:56 templates/pages/hr-portal.html:124 -#: templates/pages/hr-portal.html:440 +#: templates/pages/hr-portal.html:440 templates/pages/timetrack.html:47 msgid "Офис" msgstr "Office" @@ -925,7 +925,8 @@ msgid "" "организации><номер>@домен. Можно задать вручную." msgstr "" -#: apps/locations/admin.py:376 templates/pages/structure.html:61 +#: apps/locations/admin.py:376 core/views.py:350 +#: templates/pages/structure.html:61 msgid "Сотрудников" msgstr "" @@ -1114,6 +1115,7 @@ msgstr "" #: apps/locations/models/pharmacies.py:211 templates/index.html:381 #: templates/pages/dislocation.html:16 templates/pages/pharmacies.html:6 +#: templates/pages/timetrack.html:49 msgid "Аптеки" msgstr "Pharmacies" @@ -1657,6 +1659,42 @@ msgstr "" msgid "Неверная контрольная сумма ИНН" msgstr "" +#: core/views.py:349 +msgid "Рабочих дней" +msgstr "Working days" + +#: core/views.py:349 +msgid "с отметками" +msgstr "with check-ins" + +#: core/views.py:350 +msgid "отмечались" +msgstr "checked in" + +#: core/views.py:351 +msgid "Смен" +msgstr "Shifts" + +#: core/views.py:351 +msgid "за месяц" +msgstr "this month" + +#: core/views.py:352 templates/pages/timetrack.html:62 +msgid "Незакрытых" +msgstr "Open" + +#: core/views.py:352 +msgid "без ухода" +msgstr "without checkout" + +#: core/views.py:353 +msgid "Всего часов" +msgstr "Total hours" + +#: core/views.py:353 +msgid "отработано" +msgstr "worked" + #: templates/index.html:210 msgid "Сеть аптек" msgstr "Pharmacy network" @@ -1740,6 +1778,7 @@ msgid "Рекрутинг" msgstr "Recruiting" #: templates/index.html:410 templates/pages/hr-portal.html:292 +#: templates/pages/timetrack.html:7 msgid "Учёт рабочего времени" msgstr "Time tracking" @@ -2161,6 +2200,7 @@ msgstr "employees, of them" #: templates/pages/employees.html:48 templates/pages/hr-portal.html:122 #: templates/pages/news.html:111 templates/pages/tasks.html:60 +#: templates/pages/timetrack.html:45 msgid "Все" msgstr "All" @@ -2955,3 +2995,35 @@ msgstr "No tasks with this status" #: templates/pages/tasks.html:144 msgid "Задач пока нет — создайте первую" msgstr "No tasks yet — create the first" + +#: templates/pages/timetrack.html:9 +msgid "сотрудников с отметками" +msgstr "employees with check-ins" + +#: templates/pages/timetrack.html:16 +msgid "Предыдущий месяц" +msgstr "Previous month" + +#: templates/pages/timetrack.html:22 +msgid "Следующий месяц" +msgstr "Next month" + +#: templates/pages/timetrack.html:59 +msgid "Часов" +msgstr "Hours" + +#: templates/pages/timetrack.html:60 +msgid "Дней" +msgstr "Days" + +#: templates/pages/timetrack.html:61 +msgid "Сред./день" +msgstr "Avg/day" + +#: templates/pages/timetrack.html:84 +msgid "Нет отметок рабочего времени за" +msgstr "No time records for" + +#: templates/pages/timetrack.html:92 +msgid "сотрудников" +msgstr "employees" diff --git a/locale/uk/LC_MESSAGES/django.mo b/locale/uk/LC_MESSAGES/django.mo index bd7e967..650dd86 100644 Binary files a/locale/uk/LC_MESSAGES/django.mo and b/locale/uk/LC_MESSAGES/django.mo differ diff --git a/locale/uk/LC_MESSAGES/django.po b/locale/uk/LC_MESSAGES/django.po index 99ded67..84e7559 100644 --- a/locale/uk/LC_MESSAGES/django.po +++ b/locale/uk/LC_MESSAGES/django.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-07-27 21:58+0300\n" +"POT-Creation-Date: 2026-07-28 10:05+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -22,7 +22,7 @@ msgstr "" #: apps/ad_connector/models.py:10 apps/employees/models/base.py:186 #: apps/employees/models/permissions.py:47 templates/pages/employees.html:103 -#: templates/pages/hr-portal.html:215 +#: templates/pages/hr-portal.html:215 templates/pages/timetrack.html:58 msgid "Сотрудник" msgstr "Співробітник" @@ -275,7 +275,7 @@ msgstr "Склад" #: apps/employees/models/base.py:83 apps/locations/models/base.py:31 #: templates/pages/employees.html:56 templates/pages/hr-portal.html:124 -#: templates/pages/hr-portal.html:440 +#: templates/pages/hr-portal.html:440 templates/pages/timetrack.html:47 msgid "Офис" msgstr "Офіс" @@ -928,7 +928,8 @@ msgid "" "организации><номер>@домен. Можно задать вручную." msgstr "" -#: apps/locations/admin.py:376 templates/pages/structure.html:61 +#: apps/locations/admin.py:376 core/views.py:350 +#: templates/pages/structure.html:61 msgid "Сотрудников" msgstr "" @@ -1117,6 +1118,7 @@ msgstr "" #: apps/locations/models/pharmacies.py:211 templates/index.html:381 #: templates/pages/dislocation.html:16 templates/pages/pharmacies.html:6 +#: templates/pages/timetrack.html:49 msgid "Аптеки" msgstr "Аптеки" @@ -1660,6 +1662,42 @@ msgstr "" msgid "Неверная контрольная сумма ИНН" msgstr "" +#: core/views.py:349 +msgid "Рабочих дней" +msgstr "Робочих днів" + +#: core/views.py:349 +msgid "с отметками" +msgstr "з відмітками" + +#: core/views.py:350 +msgid "отмечались" +msgstr "відмічались" + +#: core/views.py:351 +msgid "Смен" +msgstr "Змін" + +#: core/views.py:351 +msgid "за месяц" +msgstr "за місяць" + +#: core/views.py:352 templates/pages/timetrack.html:62 +msgid "Незакрытых" +msgstr "Незакритих" + +#: core/views.py:352 +msgid "без ухода" +msgstr "без виходу" + +#: core/views.py:353 +msgid "Всего часов" +msgstr "Всього годин" + +#: core/views.py:353 +msgid "отработано" +msgstr "відпрацьовано" + #: templates/index.html:210 msgid "Сеть аптек" msgstr "Мережа аптек" @@ -1743,6 +1781,7 @@ msgid "Рекрутинг" msgstr "Рекрутинг" #: templates/index.html:410 templates/pages/hr-portal.html:292 +#: templates/pages/timetrack.html:7 msgid "Учёт рабочего времени" msgstr "Облік робочого часу" @@ -2164,6 +2203,7 @@ msgstr "співробітників, з них" #: templates/pages/employees.html:48 templates/pages/hr-portal.html:122 #: templates/pages/news.html:111 templates/pages/tasks.html:60 +#: templates/pages/timetrack.html:45 msgid "Все" msgstr "Всі" @@ -2958,3 +2998,35 @@ msgstr "Задач з таким статусом немає" #: templates/pages/tasks.html:144 msgid "Задач пока нет — создайте первую" msgstr "Задач поки немає — створіть першу" + +#: templates/pages/timetrack.html:9 +msgid "сотрудников с отметками" +msgstr "співробітників з відмітками" + +#: templates/pages/timetrack.html:16 +msgid "Предыдущий месяц" +msgstr "Попередній місяць" + +#: templates/pages/timetrack.html:22 +msgid "Следующий месяц" +msgstr "Наступний місяць" + +#: templates/pages/timetrack.html:59 +msgid "Часов" +msgstr "Годин" + +#: templates/pages/timetrack.html:60 +msgid "Дней" +msgstr "Днів" + +#: templates/pages/timetrack.html:61 +msgid "Сред./день" +msgstr "Сер./день" + +#: templates/pages/timetrack.html:84 +msgid "Нет отметок рабочего времени за" +msgstr "Немає відміток робочого часу за" + +#: templates/pages/timetrack.html:92 +msgid "сотрудников" +msgstr "співробітників" diff --git a/templates/pages/timetrack.html b/templates/pages/timetrack.html index b4ad2e9..ea79da1 100644 --- a/templates/pages/timetrack.html +++ b/templates/pages/timetrack.html @@ -1,24 +1,25 @@ {% load common_tags %} +{% load i18n %}
-

Облік робочого часу

+

{% trans "Учёт рабочего времени" %}

- {{ month_label }} · {{ stats.employees }} співробітників з відмітками + {{ month_label }} · {{ stats.employees }} {% trans "сотрудников с отметками" %}

@@ -41,11 +42,11 @@
Всі · {{ counts.all }} + style="display:inline-flex;align-items:center;padding:0.25rem 0.875rem;font-size:0.8125rem;border-radius:calc(var(--radius) - 2px);font-weight:500;text-decoration:none;transition:all 150ms;{% if not location_type %}background:var(--color-card);color:var(--color-card-foreground);box-shadow:0 1px 2px rgb(0 0 0/0.08);{% else %}color:var(--color-muted-foreground);{% endif %}">{% trans "Все" %} · {{ counts.all }} Офіс · {{ counts.office }} + style="display:inline-flex;align-items:center;padding:0.25rem 0.875rem;font-size:0.8125rem;border-radius:calc(var(--radius) - 2px);font-weight:500;text-decoration:none;transition:all 150ms;{% if location_type == 'office' %}background:var(--color-card);color:var(--color-card-foreground);box-shadow:0 1px 2px rgb(0 0 0/0.08);{% else %}color:var(--color-muted-foreground);{% endif %}">{% trans "Офис" %} · {{ counts.office }} Аптеки · {{ counts.pharmacy }} + style="display:inline-flex;align-items:center;padding:0.25rem 0.875rem;font-size:0.8125rem;border-radius:calc(var(--radius) - 2px);font-weight:500;text-decoration:none;transition:all 150ms;{% if location_type == 'pharmacy' %}background:var(--color-card);color:var(--color-card-foreground);box-shadow:0 1px 2px rgb(0 0 0/0.08);{% else %}color:var(--color-muted-foreground);{% endif %}">{% trans "Аптеки" %} · {{ counts.pharmacy }}
@@ -54,11 +55,11 @@ - - - - - + + + + + @@ -80,7 +81,7 @@ {% empty %} {% endfor %} @@ -88,6 +89,7 @@
СпівробітникГодинДнівСер./деньНезакритих{% trans "Сотрудник" %}{% trans "Часов" %}{% trans "Дней" %}{% trans "Сред./день" %}{% trans "Незакрытых" %}
- За {{ month_label }} немає відміток робочого часу. + {% trans "Нет отметок рабочего времени за" %} {{ month_label }}.
- {% include "partials/pagination.html" with page=page base_url="/timetrack/" page_param="page" size_param="per_page" item_label="співробітників" %} + {% trans "сотрудников" as tt_item_label %} + {% include "partials/pagination.html" with page=page base_url="/timetrack/" page_param="page" size_param="per_page" item_label=tt_item_label %}