accrete 0.0.146__py3-none-any.whl → 0.0.148__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/response.py +152 -69
- accrete/contrib/ui/static/css/accrete.css +1 -5
- accrete/contrib/ui/static/css/accrete.css.map +1 -1
- accrete/contrib/ui/static/css/accrete.scss +1 -5
- accrete/contrib/ui/templates/ui/layout.html +6 -3
- accrete/contrib/ui/templates/ui/list.html +35 -38
- accrete/contrib/ui/templates/ui/table.html +67 -69
- accrete/contrib/ui/templates/ui/table_row_update.html +3 -3
- accrete/contrib/ui/templates/ui/templatetags/field.html +9 -1
- accrete/contrib/ui/templates/ui/widgets/model_search_select_multi.html +1 -1
- accrete/contrib/ui/templatetags/ui.py +7 -3
- accrete/contrib/user/templates/user/change_email.html +2 -2
- accrete/contrib/user/templates/user/change_password.html +3 -3
- accrete/contrib/user/templates/user/user_preferences.html +6 -6
- {accrete-0.0.146.dist-info → accrete-0.0.148.dist-info}/METADATA +1 -1
- {accrete-0.0.146.dist-info → accrete-0.0.148.dist-info}/RECORD +18 -18
- {accrete-0.0.146.dist-info → accrete-0.0.148.dist-info}/WHEEL +0 -0
- {accrete-0.0.146.dist-info → accrete-0.0.148.dist-info}/licenses/LICENSE +0 -0
accrete/contrib/ui/response.py
CHANGED
@@ -21,9 +21,12 @@ class Response:
|
|
21
21
|
def add_trigger(response):
|
22
22
|
pass
|
23
23
|
|
24
|
+
def get_context(self):
|
25
|
+
return self.context
|
26
|
+
|
24
27
|
def render(self, request) -> str:
|
25
28
|
return render_to_string(
|
26
|
-
template_name=self.template, context=self.
|
29
|
+
template_name=self.template, context=self.get_context(), request=request
|
27
30
|
)
|
28
31
|
|
29
32
|
def response(self, request, extra_content: str = None, replace_body: bool = False) -> HttpResponse:
|
@@ -47,11 +50,18 @@ class OobResponse(Response):
|
|
47
50
|
|
48
51
|
def __init__(self, *, template: str, context: dict, swap: str, tag: str = 'div'):
|
49
52
|
super().__init__(template=self.oob_template, context=context)
|
50
|
-
self.
|
51
|
-
|
52
|
-
|
53
|
-
|
53
|
+
self.include_template = template
|
54
|
+
self.swap = swap
|
55
|
+
self.tag = tag
|
56
|
+
|
57
|
+
def get_context(self):
|
58
|
+
context = super().get_context()
|
59
|
+
context.update({'oob': {
|
60
|
+
'template': self.include_template,
|
61
|
+
'swap': self.swap,
|
62
|
+
'tag': self.tag
|
54
63
|
}})
|
64
|
+
return context
|
55
65
|
|
56
66
|
|
57
67
|
class WindowResponse(Response):
|
@@ -68,20 +78,29 @@ class WindowResponse(Response):
|
|
68
78
|
is_centered: bool = False
|
69
79
|
):
|
70
80
|
super().__init__(template=self.base_template, context=context)
|
81
|
+
self.title = title
|
82
|
+
self.overview_template = overview_template
|
83
|
+
self.header_template = header_template
|
71
84
|
self.panel_template = panel_template
|
72
|
-
|
73
|
-
|
74
|
-
self.context.update({
|
75
|
-
'title': title,
|
76
|
-
'overview_template': overview_template,
|
77
|
-
'header_template': header_template,
|
78
|
-
'panel_template': panel_template,
|
79
|
-
'is_centered': is_centered
|
80
|
-
})
|
85
|
+
self.panel_template = panel_template
|
86
|
+
self.is_centered = is_centered
|
81
87
|
|
82
88
|
def _has_panel(self):
|
83
89
|
return bool(self.panel_template)
|
84
90
|
|
91
|
+
def get_context(self):
|
92
|
+
context = super().get_context()
|
93
|
+
if 'has_panel' not in context.keys():
|
94
|
+
context.update(has_panel=self._has_panel())
|
95
|
+
context.update({
|
96
|
+
'title': self.title,
|
97
|
+
'overview_template': self.overview_template,
|
98
|
+
'header_template': self.header_template,
|
99
|
+
'panel_template': self.panel_template,
|
100
|
+
'is_centered': self.is_centered
|
101
|
+
})
|
102
|
+
return context
|
103
|
+
|
85
104
|
def response(self, request, extra_content: str = None, replace_body: bool = True) -> HttpResponse:
|
86
105
|
return super().response(request, extra_content, replace_body)
|
87
106
|
|
@@ -100,34 +119,50 @@ class ListResponse(WindowResponse):
|
|
100
119
|
panel_template: str = None,
|
101
120
|
column_count: int = 1,
|
102
121
|
column_height: str = '150px',
|
103
|
-
overview_template: str = 'ui/list.html'
|
122
|
+
overview_template: str = 'ui/list.html',
|
123
|
+
detail_header_template: str = None,
|
124
|
+
detail_data_template: str = None
|
104
125
|
):
|
105
126
|
assert page is not None or ui_filter is not None, _(
|
106
127
|
'Argument page or ui_filter must be supplied'
|
107
128
|
)
|
108
|
-
self.ui_filter = ui_filter
|
109
|
-
self.overview_template = overview_template
|
110
129
|
super().__init__(
|
111
130
|
title=title,
|
112
131
|
context=context,
|
113
|
-
overview_template=
|
132
|
+
overview_template=overview_template,
|
114
133
|
header_template=header_template,
|
115
134
|
panel_template=panel_template,
|
116
135
|
)
|
117
|
-
|
118
|
-
|
119
|
-
self.
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
})
|
136
|
+
self.page = page or (ui_filter and ui_filter.get_page())
|
137
|
+
self.list_entry_template = list_entry_template
|
138
|
+
self.page = page
|
139
|
+
self.ui_filter = ui_filter
|
140
|
+
self.endless_scroll = endless_scroll
|
141
|
+
self.column_count = column_count
|
142
|
+
self.column_height = column_height
|
143
|
+
self.detail_header_template = detail_header_template
|
144
|
+
self.detail_data_template = detail_data_template
|
127
145
|
|
128
146
|
def _has_panel(self):
|
129
147
|
return bool(self.panel_template or self.ui_filter)
|
130
148
|
|
149
|
+
def get_context(self):
|
150
|
+
context = super().get_context()
|
151
|
+
context.update({
|
152
|
+
'list_entry_template': self.list_entry_template,
|
153
|
+
'page': self.page,
|
154
|
+
'ui_filter': self.ui_filter,
|
155
|
+
'endless_scroll': self.endless_scroll,
|
156
|
+
'column_count': self.column_count,
|
157
|
+
'column_height': self.column_height,
|
158
|
+
'detail_header_template': self.detail_header_template,
|
159
|
+
'detail_data_template': self.detail_data_template,
|
160
|
+
'show_content_right': str(bool(
|
161
|
+
self.detail_header_template or self.detail_data_template
|
162
|
+
)).lower(),
|
163
|
+
})
|
164
|
+
return context
|
165
|
+
|
131
166
|
def response(self, request, extra_content: str = None, replace_body: bool = False) -> HttpResponse:
|
132
167
|
return super().response(request, extra_content, replace_body)
|
133
168
|
|
@@ -146,15 +181,24 @@ class ListEntryResponse(Response):
|
|
146
181
|
column_count: int = 1,
|
147
182
|
column_height: str = '150px',
|
148
183
|
):
|
149
|
-
self.page = page
|
150
184
|
super().__init__(template=self.base_template, context=context or {})
|
151
|
-
self.
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
185
|
+
self.instance = instance
|
186
|
+
self.list_entry_template = list_entry_template
|
187
|
+
self.page = page
|
188
|
+
self.is_new = is_new
|
189
|
+
self.column_count = column_count
|
190
|
+
self.column_height = column_height
|
191
|
+
|
192
|
+
def get_context(self):
|
193
|
+
context = super().get_context()
|
194
|
+
context.update({
|
195
|
+
'instance': self.instance,
|
196
|
+
'list_entry_template': self.list_entry_template,
|
197
|
+
'is_new': self.is_new,
|
198
|
+
'column_count': self.column_count,
|
199
|
+
'column_height': self.column_height
|
157
200
|
})
|
201
|
+
return context
|
158
202
|
|
159
203
|
def render(self, request) -> str:
|
160
204
|
res = super().render(request)
|
@@ -174,7 +218,7 @@ class TableResponse(WindowResponse):
|
|
174
218
|
self, *,
|
175
219
|
title: str,
|
176
220
|
context: dict,
|
177
|
-
|
221
|
+
instance_label: str,
|
178
222
|
fields: list[str],
|
179
223
|
footer: dict = None,
|
180
224
|
page: paginator.Page = None,
|
@@ -182,34 +226,49 @@ class TableResponse(WindowResponse):
|
|
182
226
|
endless_scroll: bool = True,
|
183
227
|
header_template: str = None,
|
184
228
|
panel_template: str = None,
|
185
|
-
overview_template: str = 'ui/table.html'
|
229
|
+
overview_template: str = 'ui/table.html',
|
230
|
+
detail_header_template: str = None,
|
231
|
+
detail_data_template: str = None
|
186
232
|
):
|
187
233
|
assert page is not None or ui_filter is not None, _(
|
188
234
|
'Argument page or ui_filter must be supplied'
|
189
235
|
)
|
190
|
-
self.ui_filter = ui_filter
|
191
|
-
self.overview_template = overview_template
|
192
236
|
super().__init__(
|
193
237
|
title=title,
|
194
238
|
context=context,
|
195
|
-
overview_template=
|
239
|
+
overview_template=overview_template,
|
196
240
|
header_template=header_template,
|
197
241
|
panel_template=panel_template
|
198
242
|
)
|
199
|
-
|
200
|
-
|
201
|
-
self.
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
'footer': footer
|
208
|
-
})
|
243
|
+
self.instance_label = instance_label
|
244
|
+
self.fields = fields
|
245
|
+
self.footer = footer
|
246
|
+
self.page = page or (ui_filter and ui_filter.get_page())
|
247
|
+
self.ui_filter = ui_filter
|
248
|
+
self.endless_scroll = endless_scroll
|
249
|
+
self.detail_header_template = detail_header_template
|
250
|
+
self.detail_data_template = detail_data_template
|
209
251
|
|
210
252
|
def _has_panel(self):
|
211
253
|
return bool(self.panel_template or self.ui_filter)
|
212
254
|
|
255
|
+
def get_context(self):
|
256
|
+
context = super().get_context()
|
257
|
+
context.update({
|
258
|
+
'page': self.page,
|
259
|
+
'ui_filter': self.ui_filter,
|
260
|
+
'endless_scroll': self.endless_scroll,
|
261
|
+
'fields': self.fields,
|
262
|
+
'instance_label': self.instance_label,
|
263
|
+
'footer': self.footer,
|
264
|
+
'detail_header_template': self.detail_header_template,
|
265
|
+
'detail_data_template': self.detail_data_template,
|
266
|
+
'show_content_right': str(bool(
|
267
|
+
self.detail_header_template or self.detail_data_template
|
268
|
+
)).lower()
|
269
|
+
})
|
270
|
+
return context
|
271
|
+
|
213
272
|
def response(self, request, extra_content: str = None, replace_body: bool = False) -> HttpResponse:
|
214
273
|
return super().response(request, extra_content, replace_body)
|
215
274
|
|
@@ -225,13 +284,21 @@ class TableRowResponse(Response):
|
|
225
284
|
footer: dict = None,
|
226
285
|
page: paginator.Page = None,
|
227
286
|
):
|
287
|
+
super().__init__(template=self.base_template, context={})
|
288
|
+
self.instance = instance
|
289
|
+
self.fields = fields
|
290
|
+
self.footer = footer
|
228
291
|
self.page = page
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
292
|
+
|
293
|
+
def get_context(self):
|
294
|
+
context = super().get_context()
|
295
|
+
context.update({
|
296
|
+
'instance': self.instance,
|
297
|
+
'fields': self.fields,
|
298
|
+
'footer': self.footer,
|
299
|
+
'page': self.page
|
300
|
+
})
|
301
|
+
return context
|
235
302
|
|
236
303
|
def render(self, request) -> str:
|
237
304
|
res = super().render(request)
|
@@ -252,19 +319,26 @@ class DetailResponse(Response):
|
|
252
319
|
def __init__(
|
253
320
|
self, *,
|
254
321
|
context: dict,
|
255
|
-
|
256
|
-
|
322
|
+
header_template: str = None,
|
323
|
+
data_template: str = None
|
257
324
|
):
|
258
325
|
super().__init__(template=self.base_template, context=context)
|
259
|
-
self.
|
260
|
-
|
261
|
-
|
262
|
-
})
|
326
|
+
self.header_template = header_template
|
327
|
+
self.data_template = data_template
|
328
|
+
self.context.update()
|
263
329
|
|
264
330
|
@staticmethod
|
265
331
|
def add_trigger(response):
|
266
332
|
add_trigger(response, 'activate-detail')
|
267
333
|
|
334
|
+
def get_context(self):
|
335
|
+
context = super().get_context()
|
336
|
+
context.update({
|
337
|
+
'detail_header_template': self.header_template,
|
338
|
+
'detail_data_template': self.data_template
|
339
|
+
})
|
340
|
+
return context
|
341
|
+
|
268
342
|
|
269
343
|
class ModalResponse(Response):
|
270
344
|
|
@@ -280,13 +354,22 @@ class ModalResponse(Response):
|
|
280
354
|
|
281
355
|
):
|
282
356
|
super().__init__(template=template, context=context)
|
283
|
-
self.
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
357
|
+
self.modal_id = modal_id
|
358
|
+
self.title = title
|
359
|
+
self.is_update = is_update
|
360
|
+
self.is_blocking = is_blocking
|
361
|
+
self.modal_width = modal_width
|
362
|
+
|
363
|
+
def get_context(self):
|
364
|
+
context = super().get_context()
|
365
|
+
context.update({
|
366
|
+
'title': self.title,
|
367
|
+
'modal_id': re.sub(r'[^A-Za-z-]+', '', self.modal_id).strip('-'),
|
368
|
+
'is_update': self.is_update,
|
369
|
+
'is_blocking': self.is_blocking,
|
370
|
+
'modal_width': self.modal_width
|
289
371
|
})
|
372
|
+
return context
|
290
373
|
|
291
374
|
|
292
375
|
@dataclass
|
@@ -303,7 +386,7 @@ class TriggerResponse:
|
|
303
386
|
|
304
387
|
def response(self):
|
305
388
|
res = HttpResponse()
|
306
|
-
res.headers['HX-Reswap'] = '
|
389
|
+
res.headers['HX-Reswap'] = 'none'
|
307
390
|
for trigger in self.trigger:
|
308
391
|
add_trigger(res, trigger.trigger, trigger.header)
|
309
392
|
return res
|
@@ -84,10 +84,6 @@ input[disabled] ~ .helptext {
|
|
84
84
|
font-weight: normal !important; }
|
85
85
|
|
86
86
|
textarea {
|
87
|
-
border-top: transparent !important;
|
88
|
-
border-right: transparent !important;
|
89
|
-
border-left: transparent !important;
|
90
|
-
border-radius: 0 !important;
|
91
87
|
box-shadow: none !important; }
|
92
88
|
|
93
89
|
textarea:focus {
|
@@ -161,7 +157,7 @@ select:focus {
|
|
161
157
|
max-width: calc(var(--accrete-detail-width) - 6%); }
|
162
158
|
|
163
159
|
.list-entry > .box:hover, .box.selected {
|
164
|
-
|
160
|
+
box-shadow: 0 0 5px 2px var(--bulma-success); }
|
165
161
|
|
166
162
|
.helptext {
|
167
163
|
font-style: italic !important;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
|
-
"mappings": "AAAQ,mCAAwB;AAEhC,KAAM;EACJ,iBAAiB,CAAC,KAAK;EACvB,qBAAqB,CAAC,KAAK;EAC3B,4BAA4B,CAAC,kBAAkB;EAC/C,sBAAsB,CAAC,MAAM;EAC7B,4BAA4B,CAAC,MAAM;EACnC,8BAA8B,CAAC,qBAAqB;EACpD,mBAAmB,CAAC,qBAAqB;EACzC,mBAAmB,CAAC,qBAAqB;EACzC,+BAA+B,CAAC,oBAAoB;EACpD,2BAA2B,CAAC,qBAAqB;EACj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AAuB;EAC3C,mBAAmB,CAAC,uBAAuB;EAC3C,8BAA8B,CAAC,uBAAuB;EACtD,yBAAyB,CAAC,8BAA8B;;AAG1D,kBAAmB;EACf,gBAAgB,EAAE,0BAA0B;;AAGhD,iCAAiC;AACjC;gCACiC;EAC/B,kBAAkB,EAAE,IAAI;EACxB,MAAM,EAAE,CAAC;;AAGX,aAAa;AACb,kBAAmB;EACjB,eAAe,EAAE,SAAS;;AAG5B,uEAAwE;EACtE,OAAO,EAAE,IAAI;;AAGf,6EAA8E;EAC5E,OAAO,EAAE,eAAc;;AAGzB,kEAAmE;EACjE,OAAO,EAAE,IAAI;;AAGf,wEAAyE;EACvE,OAAO,EAAE,eAAc;;AAGzB,YAAa;EACX,YAAY,EAAE,GAAG;EACjB,WAAW,EAAE,iCAAiC;EAC9C,UAAU,EAAE,IAAI;EAChB,YAAY,EAAE,IAAI;EAClB,aAAa,EAAE,IAAI;EACnB,aAAa,EAAE,CAAC;EAChB,aAAa,EAAE,GAAG;;AAGpB,mDAAoD;EAClD,YAAY,EAAE,CAAC;EACf,WAAW,EAAE,eAAc;;AAG7B,iBAAkB;EAChB,YAAY,EAAE,MAAM;EACpB,aAAa,EAAE,MAAM;EACrB,WAAW,EAAE,MAAM",
|
4
4
|
"sources": ["accrete.scss"],
|
5
5
|
"names": [],
|
6
6
|
"file": "accrete.css"
|
@@ -106,10 +106,6 @@ input[disabled] ~ .helptext {
|
|
106
106
|
}
|
107
107
|
|
108
108
|
textarea {
|
109
|
-
border-top: transparent!important;
|
110
|
-
border-right: transparent!important;
|
111
|
-
border-left: transparent!important;
|
112
|
-
border-radius: 0!important;
|
113
109
|
box-shadow: none!important;
|
114
110
|
}
|
115
111
|
|
@@ -199,7 +195,7 @@ select:focus {
|
|
199
195
|
}
|
200
196
|
|
201
197
|
.list-entry > .box:hover, .box.selected {
|
202
|
-
|
198
|
+
box-shadow: 0 0 5px 2px var(--bulma-success);
|
203
199
|
}
|
204
200
|
|
205
201
|
.helptext {
|
@@ -42,6 +42,7 @@
|
|
42
42
|
}
|
43
43
|
})
|
44
44
|
</script>
|
45
|
+
{% if script_template %}{% include script_template %}{% endif %}
|
45
46
|
<title>{% block title %}{{ title }}{% endblock %}</title>
|
46
47
|
{% endblock %}
|
47
48
|
</head>
|
@@ -137,7 +138,7 @@
|
|
137
138
|
{% endfor %}
|
138
139
|
</div>
|
139
140
|
|
140
|
-
<div x-data="{showContentRight: false}"
|
141
|
+
<div x-data="{showContentRight: {{ show_content_right|default_if_falsy:'false' }}}"
|
141
142
|
@activate-detail.window="showContentRight = true;"
|
142
143
|
@deactivate-detail.window="showContentRight = false;"
|
143
144
|
class="is-flex is-flex-direction-row"
|
@@ -197,7 +198,7 @@
|
|
197
198
|
</div>
|
198
199
|
</div>
|
199
200
|
|
200
|
-
<div id="detail-container" x-show="showContentRight" style="display: none;"
|
201
|
+
<div id="detail-container" x-show="showContentRight" {% if show_content_right != 'true' %}style="display: none;"{% endif %}
|
201
202
|
x-transition:enter.duration.200ms x-transition:leave.duration.50ms
|
202
203
|
>
|
203
204
|
<div id="detail-indicator" class="htmx-indicator">
|
@@ -208,7 +209,9 @@
|
|
208
209
|
<div id="detail-header" class="is-flex is-flex-wrap-wrap is-flex-grow-1">
|
209
210
|
{% if detail_header_template %}{% include detail_header_template %}{% endif %}
|
210
211
|
</div>
|
211
|
-
<button class="button is-light is-align-self-baseline" style="border-radius: var(--bulma-radius-medium)"
|
212
|
+
<button class="button is-light is-align-self-baseline" style="border-radius: var(--bulma-radius-medium)"
|
213
|
+
x-on:click="showContentRight = false; const url = new URL(window.location); url.searchParams.delete('detail'); history.replaceState(null, '', url);"
|
214
|
+
>
|
212
215
|
<span class="icon"><i class="fa fa-xmark"></i></span>
|
213
216
|
</button>
|
214
217
|
</div>
|
@@ -1,45 +1,42 @@
|
|
1
|
-
{#{% extends 'ui/layout.html' %}#}
|
2
1
|
{% load i18n %}
|
3
2
|
{% load ui %}
|
4
3
|
{% load partials %}
|
5
4
|
|
6
|
-
{
|
7
|
-
<div
|
8
|
-
|
9
|
-
{%
|
10
|
-
{
|
11
|
-
<div
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
>
|
20
|
-
|
21
|
-
{%
|
22
|
-
|
23
|
-
{
|
24
|
-
|
25
|
-
{% endif %}
|
26
|
-
</div>
|
5
|
+
<div class="fixed-grid has-{{ column_count }}-cols has-1-cols-mobile m-2">
|
6
|
+
<div id="list-grid" class="grid m-0">
|
7
|
+
{% for instance in page.object_list %}
|
8
|
+
{% partialdef entry inline=True %}
|
9
|
+
<div id="list-entry-{{ instance.pk }}" class="list-entry cell pb-0" style="height: {{ column_height }}">
|
10
|
+
<div class="box p-3"
|
11
|
+
style="word-break: break-word; height: 100%; overflow-y: auto; {% if instance.get_absolute_url %}cursor:pointer;{% endif %}"
|
12
|
+
{% if instance.get_absolute_url %}
|
13
|
+
hx-get="{{ instance.get_absolute_url }}{% querystring %}" hx-swap="none" hx-indicator="#detail-indicator" hx-replace-url="{% querystring detail=instance.pk %}"
|
14
|
+
x-on:click="$dispatch('unselect-list-entry'); selected = true; $nextTick(() => { $el.scrollIntoView({block: 'nearest'}) });" x-bind:class="selected ? 'selected' : ''"
|
15
|
+
{% endif %}
|
16
|
+
x-data="{selected: false}" @unselect-list-entry.window="selected = false"
|
17
|
+
>
|
18
|
+
<div id="list-data-{{ instance.pk }}">
|
19
|
+
{% if list_entry_template %}
|
20
|
+
{% include list_entry_template %}
|
21
|
+
{% else %}
|
22
|
+
{{ instance }}
|
23
|
+
{% endif %}
|
27
24
|
</div>
|
28
25
|
</div>
|
29
|
-
|
30
|
-
{%
|
31
|
-
|
32
|
-
{% if endless_scroll and page.has_next %}
|
33
|
-
<div id="endless-scroller"
|
34
|
-
hx-get="{% querystring page=page.next_page_number %}"
|
35
|
-
hx-target="#list-grid"
|
36
|
-
hx-trigger="intersect once"
|
37
|
-
hx-select=".list-entry"
|
38
|
-
hx-select-oob="#pagination-next-button,#pagination-end-index,#endless-scroller"
|
39
|
-
hx-swap="beforeend"
|
40
|
-
hx-replace-url="true"
|
41
|
-
hx-indicator="#endless-scroll-indicator"></div>
|
42
|
-
<progress id="endless-scroll-indicator" class="htmx-indicator progress is-small is-success" max="100">15%</progress>
|
43
|
-
{% endif %}
|
26
|
+
</div>
|
27
|
+
{% endpartialdef %}
|
28
|
+
{% endfor %}
|
44
29
|
</div>
|
45
|
-
{%
|
30
|
+
{% if endless_scroll and page.has_next %}
|
31
|
+
<div id="endless-scroller"
|
32
|
+
hx-get="{% querystring page=page.next_page_number %}"
|
33
|
+
hx-target="#list-grid"
|
34
|
+
hx-trigger="intersect once"
|
35
|
+
hx-select=".list-entry"
|
36
|
+
hx-select-oob="#pagination-next-button,#pagination-end-index,#endless-scroller"
|
37
|
+
hx-swap="beforeend"
|
38
|
+
hx-replace-url="true"
|
39
|
+
hx-indicator="#endless-scroll-indicator"></div>
|
40
|
+
<progress id="endless-scroll-indicator" class="htmx-indicator progress is-small is-success" max="100">15%</progress>
|
41
|
+
{% endif %}
|
42
|
+
</div>
|
@@ -1,77 +1,75 @@
|
|
1
|
-
{% extends 'ui/layout.html' %}
|
2
1
|
{% load i18n %}
|
3
2
|
{% load ui %}
|
4
3
|
{% load partials %}
|
5
4
|
|
6
|
-
|
7
|
-
<
|
8
|
-
<
|
9
|
-
<
|
10
|
-
|
11
|
-
{
|
12
|
-
<th style="text-align: {{ page.object_list|table_alignment:field }}">{{ page.object_list|verbose_field_name:field }}</th>
|
13
|
-
{% endfor %}
|
14
|
-
</tr>
|
15
|
-
</thead>
|
16
|
-
<tbody id="content-table-body" style="z-index: 9" x-ref="tbody">
|
17
|
-
{% for object in page.object_list %}
|
18
|
-
{% partialdef tr inline=True %}
|
19
|
-
<tr id="tr-{{ object.pk }}"
|
20
|
-
{% if object.get_absolute_url %}
|
21
|
-
style="cursor: pointer;"
|
22
|
-
hx-get="{{ object.get_absolute_url }}{% querystring %}" hx-swap="none"
|
23
|
-
x-data="{selected: false}" @unselect-tr.window="selected = false"
|
24
|
-
x-on:click="$dispatch('unselect-tr'); selected = true; $nextTick(() => { $el.scrollIntoView( {block: 'nearest'} ) });" x-bind:class="selected ? 'is-success' : ''"
|
25
|
-
{% endif %}
|
26
|
-
>
|
27
|
-
{% partialdef td inline=True %}
|
28
|
-
<td>{{ object }}</td>
|
29
|
-
{% for field in fields %}
|
30
|
-
<td style="text-align: {{ object|table_alignment:field }}">
|
31
|
-
<span class="">
|
32
|
-
<span class="responsive-heading has-text-weight-light" style="margin-right: .2rem">{{ object|verbose_field_name:field }}:</span>
|
33
|
-
{{ object|table_display:field|default_if_none:'' }}
|
34
|
-
</span>
|
35
|
-
</td>
|
36
|
-
{% endfor %}
|
37
|
-
{% endpartialdef %}
|
38
|
-
</tr>
|
39
|
-
{% endpartialdef %}
|
5
|
+
<table id="content-table" class="table can-compact is-fullwidth is-hoverable is-narrow my-0" hx-indicator=".htmx-indicator" x-data="">
|
6
|
+
<thead style="position: sticky; top: 0; z-index: 10; background-color: var(--bulma-scheme-main)">
|
7
|
+
<tr>
|
8
|
+
<th>{{ instance_label }}</th>
|
9
|
+
{% for field in fields %}
|
10
|
+
<th style="text-align: {{ page.object_list|table_alignment:field }}">{{ page.object_list|verbose_field_name:field }}</th>
|
40
11
|
{% endfor %}
|
41
|
-
</
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
12
|
+
</tr>
|
13
|
+
</thead>
|
14
|
+
<tbody id="content-table-body" style="z-index: 9" x-ref="tbody">
|
15
|
+
{% for instance in page.object_list %}
|
16
|
+
{% partialdef tr inline=True %}
|
17
|
+
<tr id="tr-{{ instance.pk }}"
|
18
|
+
{% if instance.get_absolute_url %}
|
19
|
+
style="cursor: pointer;"
|
20
|
+
hx-get="{{ instance.get_absolute_url }}{% querystring %}" hx-swap="none"
|
21
|
+
hx-replace-url="{% querystring detail=instance.pk %}"
|
22
|
+
x-data="{selected: false}" @unselect-tr.window="selected = false"
|
23
|
+
x-on:click="$dispatch('unselect-tr'); selected = true; $nextTick(() => { $el.scrollIntoView( {block: 'nearest'} ) });" x-bind:class="selected ? 'is-success' : ''"
|
24
|
+
{% endif %}
|
25
|
+
>
|
26
|
+
{% partialdef td inline=True %}
|
27
|
+
<td>{{ instance }}</td>
|
28
|
+
{% for field in fields %}
|
29
|
+
<td style="text-align: {{ instance|table_alignment:field }}">
|
49
30
|
<span class="">
|
50
|
-
<span class="responsive-heading has-text-weight-light" style="margin-right: .2rem">{{
|
51
|
-
{{
|
31
|
+
<span class="responsive-heading has-text-weight-light" style="margin-right: .2rem">{{ instance|verbose_field_name:field }}:</span>
|
32
|
+
{{ instance|table_display:field|default_if_none:'' }}
|
52
33
|
</span>
|
53
34
|
</td>
|
54
|
-
{%
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
35
|
+
{% endfor %}
|
36
|
+
{% endpartialdef %}
|
37
|
+
</tr>
|
38
|
+
{% endpartialdef %}
|
39
|
+
{% endfor %}
|
40
|
+
</tbody>
|
41
|
+
<tfoot style="position: sticky; bottom: 0; z-index: 10; background-color: var(--bulma-scheme-main);" class="has-text-weight-bold">
|
42
|
+
<tr id="tf-row">
|
43
|
+
{% partialdef tf inline=True %}
|
44
|
+
<td class="p-0"></td>
|
45
|
+
{% for field in fields %}
|
46
|
+
{% if field in footer %}
|
47
|
+
<td style="text-align: {{ page.object_list|table_alignment:field }}">
|
48
|
+
<span class="">
|
49
|
+
<span class="responsive-heading has-text-weight-light" style="margin-right: .2rem">{{ page.object_list|verbose_field_name:field }}:</span>
|
50
|
+
{{ footer|get_item:field }}
|
51
|
+
</span>
|
52
|
+
</td>
|
53
|
+
{% else %}
|
54
|
+
<td class="p-0"></td>
|
55
|
+
{% endif %}
|
56
|
+
{% endfor %}
|
57
|
+
{% endpartialdef %}
|
58
|
+
</tr>
|
59
|
+
</tfoot>
|
60
|
+
</table>
|
61
|
+
|
62
|
+
<div id="endless-scroller"
|
63
|
+
{% if page.has_next %}
|
64
|
+
hx-get="{% querystring page=page.next_page_number %}"
|
65
|
+
hx-trigger="intersect once"
|
66
|
+
hx-select="tbody > tr"
|
67
|
+
hx-target="#content-table-body"
|
68
|
+
hx-swap="beforeend"
|
69
|
+
hx-select-oob="#pagination-next-button,#pagination-end-index,#endless-scroller"
|
70
|
+
hx-indicator="#endless-scroll-indicator"
|
71
|
+
hx-replace-url="true"
|
72
|
+
{% endif %}
|
73
|
+
>
|
74
|
+
</div>
|
75
|
+
<progress id="endless-scroll-indicator" class="htmx-indicator progress is-small is-success" max="100">15%</progress>
|
@@ -1,13 +1,13 @@
|
|
1
1
|
<table>
|
2
2
|
<tbody>
|
3
|
-
<tr hx-swap-oob="innerHTML:#tr-{{
|
4
|
-
{% include 'ui/table.html#td' with
|
3
|
+
<tr hx-swap-oob="innerHTML:#tr-{{ instance.pk }}">
|
4
|
+
{% include 'ui/table.html#td' with instance=instance fields=fields page=page %}
|
5
5
|
</tr>
|
6
6
|
</tbody>
|
7
7
|
{% if footer %}
|
8
8
|
<tfoot>
|
9
9
|
<tr hx-swap-oob="innerHTML:#tf-row">
|
10
|
-
{% include 'ui/table.html#tf' with
|
10
|
+
{% include 'ui/table.html#tf' with instance=instance fields=fields page=page %}
|
11
11
|
</tr>
|
12
12
|
</tfoot>
|
13
13
|
{% endif %}
|
@@ -5,7 +5,15 @@
|
|
5
5
|
<label class="label mt-2 mb-5">
|
6
6
|
{{ field }}
|
7
7
|
<span class="has-text-danger is-size-6">{{ field.errors }}</span>
|
8
|
-
<
|
8
|
+
<span class="helptext {% if field.field.required %}has-text-weight-bold{% endif %}">{% if label %}{{ label }}{% else %}{{ field.help_text|default_if_falsy:field.label }}{% endif %}</span>
|
9
|
+
</label>
|
10
|
+
{% endpartialdef %}
|
11
|
+
|
12
|
+
{% partialdef textarea %}
|
13
|
+
<label class="label mt-2 mb-5">
|
14
|
+
<span class="helptext {% if field.field.required %}has-text-weight-bold{% endif %}">{% if label %}{{ label }}{% else %}{{ field.help_text|default_if_falsy:field.label }}{% endif %}</span>
|
15
|
+
<span class="has-text-danger is-size-6">{{ field.errors }}</span>
|
16
|
+
{{ field }}
|
9
17
|
</label>
|
10
18
|
{% endpartialdef %}
|
11
19
|
|
@@ -13,7 +13,7 @@
|
|
13
13
|
<div id="{{ widget.attrs.id }}_display" class="input select py-1 pl-1" tabindex="0" x-ref="inputDisplay" aria-label="inputDisplay"
|
14
14
|
style="padding-right: 30px; border-radius: 0; border-top: 0; border-right:0; border-left: 0; min-height: var(--bulma-control-height); height: fit-content; width: 100%"
|
15
15
|
x-on:keydown="if (![9, 27, 38, 40].includes($event.keyCode)) {$refs.searchInput.focus();}"
|
16
|
-
x-on:
|
16
|
+
x-on:click.stop="if (!$event.target.classList.contains('delete')) {if (open) {open = false; } else {open = true; $refs.searchInput.focus();}}"
|
17
17
|
>
|
18
18
|
<div class="tags" x-ref="inputDisplayTags"
|
19
19
|
x-on:click="
|
@@ -8,6 +8,7 @@ from django.db.models import Manager, DecimalField, IntegerField, FloatField, Mo
|
|
8
8
|
from django.apps import apps
|
9
9
|
from django.template.loader import render_to_string
|
10
10
|
from django.utils.safestring import mark_safe
|
11
|
+
from django.forms import widgets
|
11
12
|
|
12
13
|
_logger = logging.getLogger(__name__)
|
13
14
|
register = template.Library()
|
@@ -149,8 +150,11 @@ def x_ref_save(param: str):
|
|
149
150
|
return re.sub(r'[^A-Za-z]+','', param)
|
150
151
|
|
151
152
|
|
152
|
-
@register.filter(name='
|
153
|
-
def
|
153
|
+
@register.filter(name='wrap_form_field')
|
154
|
+
def wrap_form_fields(field, label=None):
|
155
|
+
if isinstance(field.field.widget, widgets.Textarea):
|
156
|
+
html = render_to_string('ui/templatetags/field.html#textarea', {'field': field, 'label': label})
|
157
|
+
return mark_safe(html)
|
154
158
|
html = render_to_string('ui/templatetags/field.html#form_field', {'field': field, 'label': label})
|
155
159
|
return mark_safe(html)
|
156
160
|
|
@@ -158,7 +162,7 @@ def wrap_label(field, label=None):
|
|
158
162
|
@register.filter(name='wrap_model_field')
|
159
163
|
def wrap_model_field(instance, field_name):
|
160
164
|
field = instance._meta.get_field(field_name)
|
161
|
-
if
|
165
|
+
if field.choices:
|
162
166
|
value = getattr(instance, f'get_{field_name}_display')()
|
163
167
|
else:
|
164
168
|
value = getattr(instance, field_name)
|
@@ -5,8 +5,8 @@
|
|
5
5
|
{% block modal_content %}
|
6
6
|
<form id="{{ modal_id }}-form" hx-post="{% url 'user:change_email' %}">
|
7
7
|
{% csrf_token %}
|
8
|
-
{{ form.email|
|
9
|
-
{{ form.password|
|
8
|
+
{{ form.email|wrap_form_field }}
|
9
|
+
{{ form.password|wrap_form_field }}
|
10
10
|
</form>
|
11
11
|
{% endblock %}
|
12
12
|
|
@@ -5,9 +5,9 @@
|
|
5
5
|
{% block modal_content %}
|
6
6
|
<form id="{{ modal_id }}-form" hx-post="{% url 'user:change_password' %}">
|
7
7
|
{% csrf_token %}
|
8
|
-
{{ form.old_password|
|
9
|
-
{{ form.new_password|
|
10
|
-
{{ form.new_password_confirm|
|
8
|
+
{{ form.old_password|wrap_form_field }}
|
9
|
+
{{ form.new_password|wrap_form_field }}
|
10
|
+
{{ form.new_password_confirm|wrap_form_field }}
|
11
11
|
</form>
|
12
12
|
{% endblock %}
|
13
13
|
|
@@ -23,19 +23,19 @@
|
|
23
23
|
{% include 'ui/form_error.html' %}
|
24
24
|
</div>
|
25
25
|
</div>
|
26
|
-
<div class="columns
|
26
|
+
<div class="columns">
|
27
27
|
<div class="column is-6">
|
28
28
|
{% translate 'Username' as username %}
|
29
|
-
{{ form.username|
|
30
|
-
{{ form.first_name|
|
31
|
-
{{ form.last_name|
|
29
|
+
{{ form.username|wrap_form_field:username }}
|
30
|
+
{{ form.first_name|wrap_form_field }}
|
31
|
+
{{ form.last_name|wrap_form_field }}
|
32
32
|
</div>
|
33
33
|
<div class="column is-6">
|
34
34
|
{% if not user.is_managed %}
|
35
35
|
{{ user|wrap_model_field:'email' }}
|
36
36
|
{% endif %}
|
37
|
-
{{ form.language_code|
|
38
|
-
{{ form.theme|
|
37
|
+
{{ form.language_code|wrap_form_field }}
|
38
|
+
{{ form.theme|wrap_form_field }}
|
39
39
|
</div>
|
40
40
|
</div>
|
41
41
|
</form>
|
@@ -66,7 +66,7 @@ accrete/contrib/ui/apps.py,sha256=E0ao2ox6PQ3ldfeR17FXJUUJuGiWjm2DPCxHbPXGzls,15
|
|
66
66
|
accrete/contrib/ui/filter.py,sha256=WWELsSZF-v7FxAWw1gGvYHFBB0BhmQWuWacI_joTKas,13703
|
67
67
|
accrete/contrib/ui/middleware.py,sha256=QprWR8FXK9iMPIvLQAeYASaUJSW0uD9BHoYroMKrph0,1560
|
68
68
|
accrete/contrib/ui/models.py,sha256=Vjc0p2XbAPgE6HyTF6vll98A4eDhA5AvaQqsc4kQ9AQ,57
|
69
|
-
accrete/contrib/ui/response.py,sha256=
|
69
|
+
accrete/contrib/ui/response.py,sha256=dXc0G6HDg0CfQieumqQmaloYwLzd72LiMgRiNEKlG0g,13419
|
70
70
|
accrete/contrib/ui/tests.py,sha256=mrbGGRNg5jwbTJtWWa7zSKdDyeB4vmgZCRc2nk6VY-g,60
|
71
71
|
accrete/contrib/ui/urls.py,sha256=5XUfK85HYWYf7oopMoJEEYmQ6pNgHgZBErBEn97pBt4,337
|
72
72
|
accrete/contrib/ui/views.py,sha256=5VUbP0jgMcLMv9-3AKxkV315RA0qXuw5PmTRejPc0Yg,1136
|
@@ -167,9 +167,9 @@ accrete/contrib/ui/static/bulma/versions/bulma-no-dark-mode.scss,sha256=1tXoYLlK
|
|
167
167
|
accrete/contrib/ui/static/bulma/versions/bulma-no-helpers-prefixed.scss,sha256=NRrD7Euz_mfDI02D92a63M6H4UhArjhWy3g5DIhQr5o,366
|
168
168
|
accrete/contrib/ui/static/bulma/versions/bulma-no-helpers.scss,sha256=gyRiEug6frpDJEaxZ7VybdApnmNS5R5A9Zn1R0yWLJg,335
|
169
169
|
accrete/contrib/ui/static/bulma/versions/bulma-prefixed.scss,sha256=cDhte1VyFupdjYFXpUyQb7wGB8aUKDGYuKluZCY5CtA,133
|
170
|
-
accrete/contrib/ui/static/css/accrete.css,sha256=
|
171
|
-
accrete/contrib/ui/static/css/accrete.css.map,sha256=
|
172
|
-
accrete/contrib/ui/static/css/accrete.scss,sha256=
|
170
|
+
accrete/contrib/ui/static/css/accrete.css,sha256=i3NxjXuMwb-wgnDgX_GohHdWxfDRakv-isig-y_Li18,8065
|
171
|
+
accrete/contrib/ui/static/css/accrete.css.map,sha256=pue97ypofcpAUPiKg7jIHJB8UeGnash813UNiNA0QFY,4712
|
172
|
+
accrete/contrib/ui/static/css/accrete.scss,sha256=OTD_70Fv1q38PBghFop-IGmZidmPFXqw_Grzys5DbkU,8114
|
173
173
|
accrete/contrib/ui/static/css/fa.css,sha256=wiz7ZSCn_btzhjKDQBms9Hx4sSeUYsDrTLg7roPstac,102641
|
174
174
|
accrete/contrib/ui/static/css/icons.css,sha256=5550KHsaayeEtRaUdf0h7esQhyec-_5ZfecZ_sOC6v0,6334
|
175
175
|
accrete/contrib/ui/static/icons/Logo.svg,sha256=hGZuxrAa-LRpFavFiF8Lnc7X9OQcqmb6Xl_dxx-27hM,1861
|
@@ -200,25 +200,25 @@ accrete/contrib/ui/templates/ui/content_right.html,sha256=aOFjbtXjjlqwmHpGoEpAUz
|
|
200
200
|
accrete/contrib/ui/templates/ui/detail.html,sha256=V0HccLE0Pb-5haQFpvIoWZfF1UOrvMwPYv2UTwRnt_A,293
|
201
201
|
accrete/contrib/ui/templates/ui/favicon.html,sha256=ZSK6qDGV4Cexgt0VA3KOHYN100yZHOFjfOiFZVudWg0,90
|
202
202
|
accrete/contrib/ui/templates/ui/form_error.html,sha256=WWqfFWyJ_LCzm5IkxXztn23GFak5wyM2HZcmiZ3Eq9s,417
|
203
|
-
accrete/contrib/ui/templates/ui/layout.html,sha256=
|
204
|
-
accrete/contrib/ui/templates/ui/list.html,sha256=
|
203
|
+
accrete/contrib/ui/templates/ui/layout.html,sha256=sMCoIDFS-LKyTiUaOJwhDMoKZH9K0tPbnTQlP_cTUJ0,14022
|
204
|
+
accrete/contrib/ui/templates/ui/list.html,sha256=5ORnXkIZdGXl5HB77oI_FbgfLGI6GZscbTc567pCxiw,2264
|
205
205
|
accrete/contrib/ui/templates/ui/list_update.html,sha256=CUV-OJCieOBrtSbh0vAoyZYL-_e9lP7vQrY4j1TlT7M,276
|
206
206
|
accrete/contrib/ui/templates/ui/message.html,sha256=dQnPNkHIrrOzelXCTO8CLWG5ufmxJ8MuWp66YLZbmro,773
|
207
207
|
accrete/contrib/ui/templates/ui/modal.html,sha256=3FzvnFVWvwRQ_r1-2qd9N5wYIOh6_oYDDp7uk6XoJPE,3481
|
208
208
|
accrete/contrib/ui/templates/ui/oob.html,sha256=lZHIBBYclefbGkKguS1A7vrtOhODJizbSRaGAAHDvG8,267
|
209
|
-
accrete/contrib/ui/templates/ui/table.html,sha256=
|
210
|
-
accrete/contrib/ui/templates/ui/table_row_update.html,sha256=
|
209
|
+
accrete/contrib/ui/templates/ui/table.html,sha256=WNAclm7qmeFbRX8itc7PIHYHfeWwAxFpRTA-k1zK3OE,3700
|
210
|
+
accrete/contrib/ui/templates/ui/table_row_update.html,sha256=v3YHCzQbGbp3zC6zmJ_EvNvtgvCH_84R6gUsH5mpC0k,439
|
211
211
|
accrete/contrib/ui/templates/ui/filter/filter.html,sha256=GOTXouHH4RSCFsIzg1UPFAcmKaNNxTPmRj5Bx9K1m4o,759
|
212
212
|
accrete/contrib/ui/templates/ui/filter/query_input.html,sha256=Qg_41fODXMgL534ohktb0QOxNzAEbaeBzAajJCEK7Pg,2035
|
213
213
|
accrete/contrib/ui/templates/ui/filter/query_operator.html,sha256=h4WWLDnse6DK5Rb_0TTb0wqWxhvY_g3qjwx8_eENMuI,569
|
214
214
|
accrete/contrib/ui/templates/ui/filter/query_params.html,sha256=wCkyZ9oSK_ivraNiL-UAY_9TflYw5EspnHHm6V6uOzk,9548
|
215
215
|
accrete/contrib/ui/templates/ui/filter/query_tags.html,sha256=ooeIwIwvhT0fG5SMAuLoMquTVUmYf5n50DM-3gC_iAo,1567
|
216
|
-
accrete/contrib/ui/templates/ui/templatetags/field.html,sha256=
|
216
|
+
accrete/contrib/ui/templates/ui/templatetags/field.html,sha256=G029l141G0VICuEgPxr6jfr3eBV4MuE-yt6iQLVrrlg,1168
|
217
217
|
accrete/contrib/ui/templates/ui/widgets/model_search_select.html,sha256=AUlWN2gKhHk_tWP1-KGel5ifaRMTF60MUtgbap7CGQ4,2938
|
218
|
-
accrete/contrib/ui/templates/ui/widgets/model_search_select_multi.html,sha256=
|
218
|
+
accrete/contrib/ui/templates/ui/widgets/model_search_select_multi.html,sha256=0YtxEmKqagUAIjkP0a36G2T4z0ySi8He4qmMu9EmMVw,4682
|
219
219
|
accrete/contrib/ui/templates/ui/widgets/model_search_select_options.html,sha256=4Wky0XkYWZlIKXTXzGjJkJTX3H9rhjXTY1hYai3Q3TA,242
|
220
220
|
accrete/contrib/ui/templatetags/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
221
|
-
accrete/contrib/ui/templatetags/ui.py,sha256=
|
221
|
+
accrete/contrib/ui/templatetags/ui.py,sha256=YRiIdTat-CCKjYP5FG3o-JaHpO4RffqUn6V14B4emeI,5124
|
222
222
|
accrete/contrib/ui/widgets/__init__.py,sha256=W_y10jfu37lygp4frXuKFSGec97gpNbWskG6DMhTKtY,69
|
223
223
|
accrete/contrib/ui/widgets/search_select.py,sha256=zKmOt54QsxUobNkDNEA2ut3pPAl8a5DqmEpcfam1l1I,3762
|
224
224
|
accrete/contrib/user/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -243,11 +243,11 @@ accrete/contrib/user/migrations/0007_user_managed_login.py,sha256=SfG1Yj9m_g-sZb
|
|
243
243
|
accrete/contrib/user/migrations/0008_remove_user_no_email_for_managed_user_and_more.py,sha256=XypG6tN0WmLyJV8sbZgSVqNFbTxRsBHWhIRyMJGfV7c,655
|
244
244
|
accrete/contrib/user/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
245
245
|
accrete/contrib/user/templates/user/accrete_navbar_end_dropdown.html,sha256=suPoeu1Dm49rDCrhnrkSZY8cBDsovnKqKGXcS5q-7o0,334
|
246
|
-
accrete/contrib/user/templates/user/change_email.html,sha256=
|
247
|
-
accrete/contrib/user/templates/user/change_password.html,sha256=
|
246
|
+
accrete/contrib/user/templates/user/change_email.html,sha256=frkoUCUwNtVSe9fhxmFmiM8T3RaFzLKOpAv5gZ7F-AY,473
|
247
|
+
accrete/contrib/user/templates/user/change_password.html,sha256=e9_8pGJoEj8FqfgrC_IcDiHuP3gB9BD8ayj-BU-R8kA,538
|
248
248
|
accrete/contrib/user/templates/user/login.html,sha256=SXbxgq3baEch3ksGMsZqIws5heqAtpkdCLAFX3SLhtQ,2669
|
249
249
|
accrete/contrib/user/templates/user/password_forgotten.html,sha256=aoNR9VUhLkDFLIQ3NUA2Oh19bFlro0ZXvcRUdGDNPnc,30
|
250
|
-
accrete/contrib/user/templates/user/user_preferences.html,sha256=
|
250
|
+
accrete/contrib/user/templates/user/user_preferences.html,sha256=KkRwI1NdLTN0JlGEZIx38pjJ7robb08u6FpvzKfKLdc,1667
|
251
251
|
accrete/contrib/user_registration/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
252
252
|
accrete/contrib/user_registration/admin.py,sha256=kwmGTsg4Hii-lsw9-UaJG7AhQ4k4SPi48GSrtpZ4YR4,119
|
253
253
|
accrete/contrib/user_registration/apps.py,sha256=mYu3fuuubfjImeJHk4D_Wd6Edw2r3oUNXGcFbAkhir4,181
|
@@ -276,7 +276,7 @@ accrete/utils/forms.py,sha256=naV4urdfvmpxcx5Vf3Fo72M5Fy8DjGg5-vkysMKptbA,3914
|
|
276
276
|
accrete/utils/log.py,sha256=BH0MBDweAjx30wGBO4F3sFhbgkSoEs7T1lLLjlYZNnA,407
|
277
277
|
accrete/utils/models.py,sha256=2xTacvcpmDK_Bp4rAK7JdVLf8HU009LYNJ6eSpMgYZI,1014
|
278
278
|
accrete/utils/views.py,sha256=mHfcKNDOiq-38LQ6tz9pDPQt-xs03b2qMxwJClprqu8,5022
|
279
|
-
accrete-0.0.
|
280
|
-
accrete-0.0.
|
281
|
-
accrete-0.0.
|
282
|
-
accrete-0.0.
|
279
|
+
accrete-0.0.148.dist-info/METADATA,sha256=SLPaFIGp5oZTsazu0XIeEoAs1jzlZ4PJFz4-rVJT75s,4953
|
280
|
+
accrete-0.0.148.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
281
|
+
accrete-0.0.148.dist-info/licenses/LICENSE,sha256=vHwb4Qnv8UfYKFiCWyTuRGsi49x19UQwHRCky3b2_NE,1057
|
282
|
+
accrete-0.0.148.dist-info/RECORD,,
|
File without changes
|
File without changes
|