1
1
from django .urls import reverse
2
- from django .utils .functional import cached_property
3
2
from django .utils .translation import gettext_lazy as _
4
3
from django .views .generic import TemplateView
5
4
6
- from view_breadcrumbs import BaseBreadcrumbMixin
7
-
8
5
from open_inwoner .htmx .mixins import RequiresHtmxMixin
9
6
from open_inwoner .openzaak .cases import fetch_cases , preprocess_data
10
7
from open_inwoner .openzaak .formapi import fetch_open_submissions
11
8
from open_inwoner .openzaak .models import OpenZaakConfig
9
+ from open_inwoner .openzaak .types import UniformCase
12
10
from open_inwoner .utils .mixins import PaginationMixin
13
11
from open_inwoner .utils .views import CommonPageMixin
14
12
15
13
from .mixins import CaseAccessMixin , CaseLogMixin , OuterCaseAccessMixin
16
14
17
15
18
- class OuterCaseListView (
19
- OuterCaseAccessMixin , CommonPageMixin , BaseBreadcrumbMixin , TemplateView
20
- ):
21
- """View on case list while being loaded"""
16
+ class OuterCaseListView (OuterCaseAccessMixin , CommonPageMixin , TemplateView ):
17
+ """View on the case list while content is loaded via htmx"""
22
18
23
19
template_name = "pages/cases/list_outer.html"
24
20
25
21
def page_title (self ):
26
22
return _ ("Mijn aanvragen" )
27
23
28
- @cached_property
29
- def crumbs (self ):
30
- return [(_ ("Mijn aanvragen" ), reverse ("cases:redirect" ))]
31
-
32
24
def get_context_data (self , ** kwargs ):
33
25
context = super ().get_context_data (** kwargs )
34
26
@@ -44,8 +36,6 @@ class InnerCaseListView(
44
36
PaginationMixin ,
45
37
TemplateView ,
46
38
):
47
- """View on case list"""
48
-
49
39
template_name = "pages/cases/list_inner.html"
50
40
paginate_by = 9
51
41
@@ -67,9 +57,9 @@ def get_context_data(self, **kwargs):
67
57
context = super ().get_context_data (** kwargs )
68
58
config = OpenZaakConfig .get_solo ()
69
59
70
- # update ctx with cases + submissions
71
- preprocessed_cases = self .get_cases ()
72
- open_submissions = self .get_submissions ()
60
+ # update ctx with submissions + cases
61
+ open_submissions : list [ UniformCase ] = self .get_submissions ()
62
+ preprocessed_cases : list [ UniformCase ] = self .get_cases ()
73
63
paginator_dict = self .paginate_with_context (
74
64
[* open_submissions , * preprocessed_cases ]
75
65
)
0 commit comments