1from django.urls import include, path
2from django.utils.translation import gettext_lazy as _
3from vkk.workhours.models import ProjectAssignment, PeriodClosure
4from .views import (AllProjectAssigneesOverView, AssigneeUpdate,
5 AssigneeUpdateSuccessView, AllProjectYearRedirectView,
6 AssigneeClosureView, AssigneeClosureSuccessView)
7
8app_name = 'allprojects'
9urlpatterns = [
10 path(
11 '',
12 AllProjectYearRedirectView.as_view(),
13 name='default'
14 ),
15 path(
16 _('year/<int:year>/'),
17 AllProjectAssigneesOverView.as_view(),
18 name='overview'
19 ),
20 path(
21 _('year/<int:year>/assignee/<int:pk>/'),
22 AssigneeUpdate.as_view(),
23 name='update'
24 ),
25 path(
26 _('year/<int:year>/assignee/success/'),
27 AssigneeUpdateSuccessView.as_view(
28 model=ProjectAssignment,
29 template_name='vkk/generic/update_success.html',
30 on_success='overview'
31 ),
32 name='update_success'
33 ),
34 path(
35 _('year/<int:year>/assignee/<int:assignee_pk>/close/<int:period_pk>'),
36 AssigneeClosureView.as_view(),
37 name='closure'
38 ),
39 path(
40 _('year/<int:year>/assignee/<int:assignee_pk>/close/success/'),
41 AssigneeClosureSuccessView.as_view(
42 model=PeriodClosure,
43 template_name='vkk/generic/update_success.html',
44 on_success='overview'
45 ),
46 name='closure_success'
47 )
48]