accrete 0.0.74__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 -12
- accrete/contrib/ui/templates/ui/detail.html +6 -8
- accrete/contrib/ui/templates/ui/form.html +6 -8
- accrete/contrib/ui/templates/ui/layout.html +0 -18
- accrete/contrib/ui/templates/ui/list.html +1 -1
- accrete/contrib/ui/templates/ui/partials/header.html +0 -23
- {accrete-0.0.74.dist-info → accrete-0.0.76.dist-info}/METADATA +1 -1
- {accrete-0.0.74.dist-info → accrete-0.0.76.dist-info}/RECORD +10 -10
- {accrete-0.0.74.dist-info → accrete-0.0.76.dist-info}/WHEEL +0 -0
- {accrete-0.0.74.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
|
@@ -171,7 +176,6 @@ class DetailContext(Context):
|
|
171
176
|
object: Model
|
172
177
|
detail_page: DetailPagination = None
|
173
178
|
pagination_param_str: str = ''
|
174
|
-
info_panel: bool = False
|
175
179
|
|
176
180
|
|
177
181
|
@dataclass
|
@@ -181,7 +185,6 @@ class FormContext(Context):
|
|
181
185
|
form_id: str = 'form'
|
182
186
|
form_method: str = 'post'
|
183
187
|
form_action: str = ''
|
184
|
-
info_panel: bool = False
|
185
188
|
|
186
189
|
|
187
190
|
@dataclass
|
@@ -3,19 +3,17 @@
|
|
3
3
|
{% load accrete_ui %}
|
4
4
|
|
5
5
|
{% block content %}
|
6
|
-
<div class="columns is-desktop m-0">
|
6
|
+
<div class="columns is-desktop m-0" style="gap: 8px">
|
7
7
|
<div class="column p-0 is-8-desktop">
|
8
8
|
<div class="box mt-2">
|
9
9
|
{% block detail_content %}{% endblock %}
|
10
10
|
</div>
|
11
11
|
</div>
|
12
|
-
|
13
|
-
<div id="info-panel" class="
|
14
|
-
|
15
|
-
|
16
|
-
{% endblock %}
|
17
|
-
</div>
|
12
|
+
<div id="info-panel" class="column pt-0 px-0">
|
13
|
+
<div id="info-panel-content" class="p-0 mt-2">
|
14
|
+
{% block info_panel %}
|
15
|
+
{% endblock %}
|
18
16
|
</div>
|
19
|
-
|
17
|
+
</div>
|
20
18
|
</div>
|
21
19
|
{% endblock %}
|
@@ -2,7 +2,7 @@
|
|
2
2
|
{% load i18n %}
|
3
3
|
|
4
4
|
{% block content %}
|
5
|
-
<div class="columns is-desktop m-0">
|
5
|
+
<div class="columns is-desktop m-0" style="gap: 8px">
|
6
6
|
<div id="form-content" class="column p-0 is-8-desktop">
|
7
7
|
<div class="box mt-2">
|
8
8
|
{% if form.is_saved is False %}
|
@@ -11,13 +11,11 @@
|
|
11
11
|
{% block form %}{% endblock %}
|
12
12
|
</div>
|
13
13
|
</div>
|
14
|
-
|
15
|
-
<div id="info-panel" class="
|
16
|
-
|
17
|
-
|
18
|
-
{% endblock %}
|
19
|
-
</div>
|
14
|
+
<div id="info-panel" class="column pt-0 px-0">
|
15
|
+
<div id="info-panel-content" class="p-0 mt-2">
|
16
|
+
{% block info_panel %}
|
17
|
+
{% endblock %}
|
20
18
|
</div>
|
21
|
-
|
19
|
+
</div>
|
22
20
|
</div>
|
23
21
|
{% endblock %}
|
@@ -264,23 +264,5 @@
|
|
264
264
|
</div>
|
265
265
|
</div>
|
266
266
|
{% endif %}
|
267
|
-
{% if info_panel %}
|
268
|
-
<div id="info-panel-modal" class="modal">
|
269
|
-
<div class="modal-background" onclick="hideInfoPanelModal()"></div>
|
270
|
-
<div class="modal-card" style="height: 100%; border-top-left-radius: var(--bulma-radius-large); border-top-right-radius: var(--bulma-radius-large)">
|
271
|
-
{# <header class="modal-card-head">#}
|
272
|
-
{# <p class="modal-card-title"></p>#}
|
273
|
-
{# <button class="delete" aria-label="close" onclick="hideInfoPanelModal()"></button>#}
|
274
|
-
{# </header>#}
|
275
|
-
<section id="info-panel-modal-content" class="modal-card-body p-0" style="margin-top: -8px">
|
276
|
-
</section>
|
277
|
-
<footer class="modal-card-foot">
|
278
|
-
<button class="button is-fullwidth" onclick="hideInfoPanelModal()">
|
279
|
-
{% translate 'Close' %}
|
280
|
-
</button>
|
281
|
-
</footer>
|
282
|
-
</div>
|
283
|
-
</div>
|
284
|
-
{% endif %}
|
285
267
|
{% endblock %}
|
286
268
|
</body>
|
@@ -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 }}"
|
@@ -108,13 +108,6 @@
|
|
108
108
|
</button>
|
109
109
|
</div>
|
110
110
|
{% endif %}
|
111
|
-
{% if info_panel %}
|
112
|
-
<div class="is-flex is-hidden-desktop ml-2 py-1 pr-3">
|
113
|
-
<button id="modal-info-panel-button" class="button has-icon" onclick="showInfoPanelModal()">
|
114
|
-
<i class="fa fa-info"></i>
|
115
|
-
</button>
|
116
|
-
</div>
|
117
|
-
{% endif %}
|
118
111
|
</div>
|
119
112
|
<script>
|
120
113
|
function showActions(el) {
|
@@ -126,21 +119,5 @@
|
|
126
119
|
function closeActionsModal(modalId) {
|
127
120
|
document.getElementById(modalId).classList.remove('is-active');
|
128
121
|
}
|
129
|
-
|
130
|
-
function showInfoPanelModal() {
|
131
|
-
let infoPanelModal = document.getElementById('info-panel-modal');
|
132
|
-
let infoPanelModalContent = document.getElementById('info-panel-modal-content');
|
133
|
-
let infoPanelContent = document.getElementById('info-panel-content');
|
134
|
-
infoPanelModalContent.appendChild(infoPanelContent);
|
135
|
-
infoPanelModal.classList.add('is-active');
|
136
|
-
}
|
137
|
-
|
138
|
-
function hideInfoPanelModal() {
|
139
|
-
let infoPanelModal = document.getElementById('info-panel-modal');
|
140
|
-
let infoPanel = document.getElementById('info-panel');
|
141
|
-
let infoPanelContent = document.getElementById('info-panel-content');
|
142
|
-
infoPanelModal.classList.remove('is-active');
|
143
|
-
infoPanel.appendChild(infoPanelContent);
|
144
|
-
}
|
145
122
|
</script>
|
146
123
|
</div>
|
@@ -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
|
@@ -163,14 +163,14 @@ accrete/contrib/ui/templates/django/forms/widgets/select.html,sha256=jT_UnHizHfd
|
|
163
163
|
accrete/contrib/ui/templates/django/forms/widgets/text.html,sha256=MSmLlQc7PsPoDLVtTOOiWNprrsPriNr712yFxaHyDIo,47
|
164
164
|
accrete/contrib/ui/templates/django/forms/widgets/textarea.html,sha256=c9BTedqb3IkXLyVYd0p9pR8DFnsXCNGoxVBWZTk_Fic,278
|
165
165
|
accrete/contrib/ui/templates/ui/dashboard.html,sha256=udnwiSJEcn2wMaJfTs4P0Y20FU79VguK_9Lq4K2BqtM,160
|
166
|
-
accrete/contrib/ui/templates/ui/detail.html,sha256
|
167
|
-
accrete/contrib/ui/templates/ui/form.html,sha256=
|
168
|
-
accrete/contrib/ui/templates/ui/layout.html,sha256=
|
169
|
-
accrete/contrib/ui/templates/ui/list.html,sha256=
|
166
|
+
accrete/contrib/ui/templates/ui/detail.html,sha256=-Nksyufbf4onufqmFGTAW_BxLRNSWv1A9n8Qs2a6aCo,564
|
167
|
+
accrete/contrib/ui/templates/ui/form.html,sha256=uCtP16THdOuRfs3JdsjadIW0k9b2rN3GAsRSTfSUWak,691
|
168
|
+
accrete/contrib/ui/templates/ui/layout.html,sha256=abdGekzMYI4twq_cRFTKEnttb-QmNWrI9oQPrbnbqCQ,15688
|
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
|
173
|
-
accrete/contrib/ui/templates/ui/partials/header.html,sha256=
|
173
|
+
accrete/contrib/ui/templates/ui/partials/header.html,sha256=F-ffQGuqmL4ahhjW_tj9rCgrtqi1L-_KLRCs1ASmb90,6993
|
174
174
|
accrete/contrib/ui/templates/ui/partials/modal_form.html,sha256=XCeKjhvIi-vGl9wbFT-eBuFgKNOdKrG9mrVA95lBMkg,2033
|
175
175
|
accrete/contrib/ui/templates/ui/partials/onchange_form.html,sha256=8wNgZYnpa6ttc-OraOi1i02isJCcnaMtYwsmObc3qcY,109
|
176
176
|
accrete/contrib/ui/templates/ui/partials/pagination_detail.html,sha256=58nA3X7Il0FAD4VcYyr7tTGWRiVf_FN1TkImmKEpKHU,1014
|
@@ -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
|