accrete 0.0.75__py3-none-any.whl → 0.0.76__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- accrete/contrib/ui/context.py +15 -10
- accrete/contrib/ui/templates/ui/list.html +1 -1
- {accrete-0.0.75.dist-info → accrete-0.0.76.dist-info}/METADATA +1 -1
- {accrete-0.0.75.dist-info → accrete-0.0.76.dist-info}/RECORD +6 -6
- {accrete-0.0.75.dist-info → accrete-0.0.76.dist-info}/WHEEL +0 -0
- {accrete-0.0.75.dist-info → accrete-0.0.76.dist-info}/licenses/LICENSE +0 -0
accrete/contrib/ui/context.py
CHANGED
@@ -2,6 +2,7 @@ import logging
|
|
2
2
|
import json
|
3
3
|
from urllib.parse import quote_plus
|
4
4
|
from dataclasses import dataclass, field
|
5
|
+
from functools import partial
|
5
6
|
from typing import Type, TypedDict, Callable
|
6
7
|
from django.utils.translation import gettext_lazy as _t
|
7
8
|
from django.db import models
|
@@ -81,7 +82,7 @@ def table_context_factory(model: Type[Model], params: dict, queryset=None, **kwa
|
|
81
82
|
except exceptions.FieldDoesNotExist:
|
82
83
|
has_name_field = False
|
83
84
|
|
84
|
-
ctx = TableContext(
|
85
|
+
ctx = partial(TableContext, **dict(
|
85
86
|
title=str(model._meta.verbose_name_plural),
|
86
87
|
object_label=str(model._meta.verbose_name),
|
87
88
|
object_param_str=url_param_str(
|
@@ -99,10 +100,9 @@ def table_context_factory(model: Type[Model], params: dict, queryset=None, **kwa
|
|
99
100
|
filter=Filter(
|
100
101
|
model,
|
101
102
|
default_filter_term='name__icontains' if has_name_field else ''
|
102
|
-
)
|
103
|
-
|
104
|
-
)
|
105
|
-
return ctx
|
103
|
+
)
|
104
|
+
))
|
105
|
+
return ctx(**kwargs)
|
106
106
|
|
107
107
|
|
108
108
|
@dataclass
|
@@ -115,6 +115,8 @@ class ListContext(Context):
|
|
115
115
|
filter: Filter = None
|
116
116
|
endless_scroll: bool = True
|
117
117
|
column_width: int = 12
|
118
|
+
column_width_widescreen: int = None
|
119
|
+
column_width_desktop: int = None
|
118
120
|
column_height: int = 150
|
119
121
|
column_height_unit: str = 'px'
|
120
122
|
field_selection: bool = False
|
@@ -125,6 +127,10 @@ class ListContext(Context):
|
|
125
127
|
_logger.warning(
|
126
128
|
'ListContext parameter column_width should be in range 1 - 12'
|
127
129
|
)
|
130
|
+
if self.column_width_widescreen is None:
|
131
|
+
self.column_width_widescreen = self.column_width
|
132
|
+
if self.column_width_desktop is None:
|
133
|
+
self.column_width_desktop = self.column_width
|
128
134
|
|
129
135
|
|
130
136
|
def list_context_factory(model: Type[Model], params: dict, queryset=None, paginate_by=None, **kwargs) -> ListContext:
|
@@ -142,7 +148,7 @@ def list_context_factory(model: Type[Model], params: dict, queryset=None, pagina
|
|
142
148
|
except exceptions.FieldDoesNotExist:
|
143
149
|
has_name_field = False
|
144
150
|
|
145
|
-
ctx = ListContext(
|
151
|
+
ctx = partial(ListContext, **dict(
|
146
152
|
title=str(model._meta.verbose_name_plural),
|
147
153
|
object_label=str(model._meta.verbose_name),
|
148
154
|
object_param_str=url_param_str(
|
@@ -159,10 +165,9 @@ def list_context_factory(model: Type[Model], params: dict, queryset=None, pagina
|
|
159
165
|
default_filter_term='name__icontains' if has_name_field else ''
|
160
166
|
),
|
161
167
|
column_width=4,
|
162
|
-
column_height=150
|
163
|
-
|
164
|
-
)
|
165
|
-
return ctx
|
168
|
+
column_height=150
|
169
|
+
))
|
170
|
+
return ctx(**kwargs)
|
166
171
|
|
167
172
|
|
168
173
|
@dataclass
|
@@ -7,7 +7,7 @@
|
|
7
7
|
{% block content %}
|
8
8
|
<div class="columns is-multiline">
|
9
9
|
{% for obj in list_page %}
|
10
|
-
<div class="list-column column is-{{ column_width }}-fullhd is-
|
10
|
+
<div class="list-column column is-{{ column_width }}-fullhd is-{{ column_width_widescreen }}-widescreen is-{{ column_width_desktop }}-desktop is-12-touch"
|
11
11
|
style="height: {{ column_height }}{{ column_height_unit }}"
|
12
12
|
{% if endless_scroll and forloop.last and list_page.has_next %}
|
13
13
|
hx-get="{{ pagination_param_str }}&page={{ list_page.next_page_number }}"
|
@@ -37,7 +37,7 @@ accrete/contrib/system_mail/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JC
|
|
37
37
|
accrete/contrib/ui/__init__.py,sha256=jU-3gQtEwtac-NPxFYCEoYF58WmCEanedXah4lETkWU,552
|
38
38
|
accrete/contrib/ui/admin.py,sha256=suMo4x8I3JBxAFBVIdE-5qnqZ6JAZV0FESABHOSc-vg,63
|
39
39
|
accrete/contrib/ui/apps.py,sha256=E0ao2ox6PQ3ldfeR17FXJUUJuGiWjm2DPCxHbPXGzls,152
|
40
|
-
accrete/contrib/ui/context.py,sha256=
|
40
|
+
accrete/contrib/ui/context.py,sha256=F-stH2g4mybg97uUYK8Cmlc9NMgUx7RI4rxz01wag2M,10108
|
41
41
|
accrete/contrib/ui/elements.py,sha256=IhK1WuhbJzV-Pvr0OVMkKrKpYYrl2knuvGimYECONfI,1917
|
42
42
|
accrete/contrib/ui/filter.py,sha256=UAIkUNKu2nVQLafwZlkQu4PDfOPyFM61e_mE7OWRhYs,12410
|
43
43
|
accrete/contrib/ui/tests.py,sha256=mrbGGRNg5jwbTJtWWa7zSKdDyeB4vmgZCRc2nk6VY-g,60
|
@@ -166,7 +166,7 @@ accrete/contrib/ui/templates/ui/dashboard.html,sha256=udnwiSJEcn2wMaJfTs4P0Y20FU
|
|
166
166
|
accrete/contrib/ui/templates/ui/detail.html,sha256=-Nksyufbf4onufqmFGTAW_BxLRNSWv1A9n8Qs2a6aCo,564
|
167
167
|
accrete/contrib/ui/templates/ui/form.html,sha256=uCtP16THdOuRfs3JdsjadIW0k9b2rN3GAsRSTfSUWak,691
|
168
168
|
accrete/contrib/ui/templates/ui/layout.html,sha256=abdGekzMYI4twq_cRFTKEnttb-QmNWrI9oQPrbnbqCQ,15688
|
169
|
-
accrete/contrib/ui/templates/ui/list.html,sha256=
|
169
|
+
accrete/contrib/ui/templates/ui/list.html,sha256=FTODO-uwRY4lPkzDDf_Adgn7Ck7PMBm8F6J_ao72HFQ,1493
|
170
170
|
accrete/contrib/ui/templates/ui/table.html,sha256=8ELtgxoapCyNsvmGISAGXe712lG6AkP_nekb4OVLK3I,4481
|
171
171
|
accrete/contrib/ui/templates/ui/partials/filter.html,sha256=2vmeL3980rMmkRnmVtZh9mBHe6S0PTMjaGIN1J6SpNM,7184
|
172
172
|
accrete/contrib/ui/templates/ui/partials/form_errors.html,sha256=C5ktasYff2xBTiWfM6QR8qaGKSyK9QufB3B9N77KGpg,1386
|
@@ -221,7 +221,7 @@ accrete/utils/dates.py,sha256=apM6kt6JhGrKgoT0jfav1W-8AUVTxNc9xt3fJQ2n0JI,1492
|
|
221
221
|
accrete/utils/forms.py,sha256=Lll-DvAhKZDw72XeuCtb4wxQEJNFp7lQWh_Z1GyH3Zk,3049
|
222
222
|
accrete/utils/http.py,sha256=mAtQRgADv7zu1_j7A-EKVyb-oqa5a21i4Gd0QfjzGV0,3540
|
223
223
|
accrete/utils/models.py,sha256=EEhv7-sQVtQD24PEb3XcDUAh3VVhVFoMMLyFrDjGEaI,706
|
224
|
-
accrete-0.0.
|
225
|
-
accrete-0.0.
|
226
|
-
accrete-0.0.
|
227
|
-
accrete-0.0.
|
224
|
+
accrete-0.0.76.dist-info/METADATA,sha256=u25dqfmk3Hsaeg12ZKvt9WRmDSHx--BZCxPBZ5zADuw,4892
|
225
|
+
accrete-0.0.76.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
|
226
|
+
accrete-0.0.76.dist-info/licenses/LICENSE,sha256=_7laeMIHnsd3Y2vJEXDYXq_PEXxIcjgJsGt8UIKTRWc,1057
|
227
|
+
accrete-0.0.76.dist-info/RECORD,,
|
File without changes
|
File without changes
|