accrete 0.0.129__py3-none-any.whl → 0.0.131__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.
@@ -8,3 +8,4 @@ from . context import (
8
8
  TableRowContext,
9
9
  ModalContext
10
10
  )
11
+ from .utils import update_modal
@@ -147,6 +147,9 @@
147
147
  <div class="mr-2">
148
148
  <p class="title is-5 px-2 py-1 my-1">{{ title }}</p>
149
149
  </div>
150
+ <div class="buttons">
151
+ {% block header_left_buttons %}{% endblock %}
152
+ </div>
150
153
  {% endblock %}
151
154
  </div>
152
155
  {% if page %}
@@ -3,10 +3,6 @@
3
3
  {% load ui %}
4
4
  {% load partials %}
5
5
 
6
- {% block header_left %}
7
- {{ block.super }}
8
- {% endblock %}
9
-
10
6
  {% block content_left %}
11
7
  <div class="fixed-grid has-{{ column_count }}-cols has-1-cols-mobile m-2">
12
8
  <div id="list-grid" class="grid m-0">
@@ -0,0 +1,17 @@
1
+ from django.http import HttpRequest, HttpResponse
2
+ from django.shortcuts import render
3
+ from .context import ModalContext
4
+
5
+
6
+ def update_modal(
7
+ request: HttpRequest,
8
+ template: str,
9
+ context: ModalContext | dict
10
+ ) -> HttpResponse:
11
+
12
+ if isinstance(context, ModalContext):
13
+ context = context.dict()
14
+ res = render(request, template, context)
15
+ res.headers['HX-Retarget'] = f'#{context["modal_id"]}'
16
+ res.headers['HX-Reswap'] = 'outerHTML'
17
+ return res
@@ -1,12 +1,11 @@
1
1
  {% extends 'ui/layout.html' %}
2
2
  {% load i18n %}
3
3
 
4
- {% block header_left %}
5
- {{ block.super }}
6
- <button class="button p-2 my-1 mr-1 is-light" hx-get="{% url 'user:change_password' %}" hx-target="body" hx-swap="beforeend">
4
+ {% block header_left_buttons %}
5
+ <button class="button is-light" hx-get="{% url 'user:change_password' %}" hx-target="body" hx-swap="beforeend">
7
6
  <span>{% translate 'Change Password' %}</span>
8
7
  </button>
9
- <button class="button p-2 my-1 mr-1 is-light" hx-get="{% url 'user:change_email' %}" hx-target="body" hx-swap="beforeend">
8
+ <button class="button is-light" hx-get="{% url 'user:change_email' %}" hx-target="body" hx-swap="beforeend">
10
9
  <span>{% translate 'Change E-Mail' %}</span>
11
10
  </button>
12
11
  {% endblock %}
@@ -77,10 +77,7 @@ def user_change_password(request):
77
77
  + f'?{request.GET.urlencode()}'
78
78
  )
79
79
  ctx.update(form=form)
80
- res = render(request, 'user/change_password.html', ctx)
81
- res.headers['HX-Retarget'] = f'#{ctx["modal_id"]}'
82
- res.headers['HX-Reswap'] = 'outerHTML'
83
- return res
80
+ return ui.update_modal(request, 'user/change_password.html', ctx)
84
81
  return render(request, 'user/change_password.html', ctx)
85
82
 
86
83
 
@@ -101,8 +98,5 @@ def user_change_email(request):
101
98
  if form.is_saved:
102
99
  return redirect('user:detail')
103
100
  ctx.update(form=form)
104
- res = render(request, 'user/change_email.html', ctx)
105
- res.headers['HX-Retarget'] = f'#{ctx["modal_id"]}'
106
- res.headers['HX-Reswap'] = 'outerHTML'
107
- return res
101
+ return ui.update_modal(request, 'user/change_email.html', ctx)
108
102
  return render(request, 'user/change_email.html', ctx)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: accrete
3
- Version: 0.0.129
3
+ Version: 0.0.131
4
4
  Summary: Django Shared Schema Multi Tenant
5
5
  Author-email: Benedikt Jilek <benedikt.jilek@pm.me>
6
6
  License: Copyright (c) 2023 Benedikt Jilek
@@ -60,7 +60,7 @@ accrete/contrib/system_mail/tests.py,sha256=mrbGGRNg5jwbTJtWWa7zSKdDyeB4vmgZCRc2
60
60
  accrete/contrib/system_mail/views.py,sha256=xc1IQHrsij7j33TUbo-_oewy3vs03pw_etpBWaMYJl0,63
61
61
  accrete/contrib/system_mail/migrations/0001_initial.py,sha256=6cwkkRXGjXvwXoMjjgmWmcPyXSTlUbhW1vMiHObk9MQ,1074
62
62
  accrete/contrib/system_mail/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
63
- accrete/contrib/ui/__init__.py,sha256=hZShhQbnjxUnNfzDYS16-Zapo_HPxhIKO3oorZosuyY,184
63
+ accrete/contrib/ui/__init__.py,sha256=n24ecHNTZgyXWhJXLg1P8AAwZKgm5ga3m9yeI-Z2GMs,216
64
64
  accrete/contrib/ui/admin.py,sha256=suMo4x8I3JBxAFBVIdE-5qnqZ6JAZV0FESABHOSc-vg,63
65
65
  accrete/contrib/ui/apps.py,sha256=E0ao2ox6PQ3ldfeR17FXJUUJuGiWjm2DPCxHbPXGzls,152
66
66
  accrete/contrib/ui/context.py,sha256=MLITEVZndD_3QZ4nnBT4Bpl9s1bc7RZ3d6LlQKMM54Q,1922
@@ -69,6 +69,7 @@ accrete/contrib/ui/middleware.py,sha256=QprWR8FXK9iMPIvLQAeYASaUJSW0uD9BHoYroMKr
69
69
  accrete/contrib/ui/models.py,sha256=Vjc0p2XbAPgE6HyTF6vll98A4eDhA5AvaQqsc4kQ9AQ,57
70
70
  accrete/contrib/ui/tests.py,sha256=mrbGGRNg5jwbTJtWWa7zSKdDyeB4vmgZCRc2nk6VY-g,60
71
71
  accrete/contrib/ui/urls.py,sha256=5XUfK85HYWYf7oopMoJEEYmQ6pNgHgZBErBEn97pBt4,337
72
+ accrete/contrib/ui/utils.py,sha256=WmifdFOuFygGqtHBauAlUw88LTkS4wUZTIy0Vr7cyYg,475
72
73
  accrete/contrib/ui/views.py,sha256=5VUbP0jgMcLMv9-3AKxkV315RA0qXuw5PmTRejPc0Yg,1136
73
74
  accrete/contrib/ui/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
74
75
  accrete/contrib/ui/static/bulma/LICENSE,sha256=--fY7Bi3Lt7RXXnKc9pe756OJY9fGv-D5OmT5pdSJ5w,1080
@@ -197,8 +198,8 @@ accrete/contrib/ui/templates/django/forms/widgets/text.html,sha256=MSmLlQc7PsPoD
197
198
  accrete/contrib/ui/templates/django/forms/widgets/textarea.html,sha256=c9BTedqb3IkXLyVYd0p9pR8DFnsXCNGoxVBWZTk_Fic,278
198
199
  accrete/contrib/ui/templates/ui/content_right.html,sha256=XUF1tYpSKfO9FleYtJ2QmWPmwdLYxLHXdBLRa-BrFUs,221
199
200
  accrete/contrib/ui/templates/ui/form_error.html,sha256=uA8FLdZyeU0vXJHlGK3rcBqcmXb63MLPV32uQyUTak4,348
200
- accrete/contrib/ui/templates/ui/layout.html,sha256=g4ai6b39bu2NXv106dLIKLqe2oJJe-Vd8lyIis3Z9Wc,12678
201
- accrete/contrib/ui/templates/ui/list.html,sha256=NY8DmHGl3n5O1u-_B9a_mlAck19ZmpYthzecADuc3BM,2250
201
+ accrete/contrib/ui/templates/ui/layout.html,sha256=QTkcHPwOLdNq_HpT3AYUUCsH9yjINeN0QNbIkjFwQ8Y,12889
202
+ accrete/contrib/ui/templates/ui/list.html,sha256=XLcZn7H3DAwCzwd5ejd5IWLFhWhXUtIhj2OvLq2cjtE,2188
202
203
  accrete/contrib/ui/templates/ui/list_update.html,sha256=mLQTCgkKfVI5jrgei-Upc1u87iXL0Q63uLzXHPwMyeo,110
203
204
  accrete/contrib/ui/templates/ui/message.html,sha256=t3bZ5EE7IgQYJroCdLKFeUkZiNbgKkErVYQm6Y3IKpg,532
204
205
  accrete/contrib/ui/templates/ui/modal.html,sha256=9Gnj5qhIJrnAPgAuIUkrSWeuYyKppywvmK1483AMhxY,1870
@@ -225,7 +226,7 @@ accrete/contrib/user/middleware.py,sha256=qblcujwJsthopagyT-hPFq4HsMyGt-VvqZw5TQ
225
226
  accrete/contrib/user/models.py,sha256=9U7SPbR9IuXhEVdlncsPOZdcbPoWcHRcQi3i25y07Hc,4331
226
227
  accrete/contrib/user/tests.py,sha256=mrbGGRNg5jwbTJtWWa7zSKdDyeB4vmgZCRc2nk6VY-g,60
227
228
  accrete/contrib/user/urls.py,sha256=_fBa--3NfyYN10Td7PGHpetJYy42SMqTyCCXhgynkEQ,407
228
- accrete/contrib/user/views.py,sha256=8_on6l7GRhoRG74j70JQKUcqxx21AZP_5IRWf0I8ZCc,3447
229
+ accrete/contrib/user/views.py,sha256=uP2n-ixb13JYLpfWoSxg6Xl-Kfcn5oxowJhqIn9ld4c,3217
229
230
  accrete/contrib/user/locale/de/LC_MESSAGES/django.mo,sha256=p3rgUg6WltAVIMkQsjvjBqTsd_usLhSr1GH4Cyltc2c,433
230
231
  accrete/contrib/user/locale/de/LC_MESSAGES/django.po,sha256=f_Nxpo3HTm2L3f3zoHLfeWsZ-4IQp_EEVSku6TCZSvw,1870
231
232
  accrete/contrib/user/migrations/0001_initial.py,sha256=JWfM9PcMDfkJUdCjLWuWieGs6643qP0KdbCyr5uAZoY,2950
@@ -235,7 +236,7 @@ accrete/contrib/user/templates/user/accrete_navbar_end_dropdown.html,sha256=suPo
235
236
  accrete/contrib/user/templates/user/change_email.html,sha256=w9gBnU_O45YchY0EqD9mUK5oeDaD4cN92tHN80QjReA,815
236
237
  accrete/contrib/user/templates/user/change_password.html,sha256=1U7cI-xshsy_nhSj3TUqL3tPtYaBF17XFDgJHXXDzIw,1021
237
238
  accrete/contrib/user/templates/user/login.html,sha256=SXbxgq3baEch3ksGMsZqIws5heqAtpkdCLAFX3SLhtQ,2669
238
- accrete/contrib/user/templates/user/user_form.html,sha256=KVHqtoss9ttft0K4yukSr4lB4ob8Ayj-eTokh60Efn8,2683
239
+ accrete/contrib/user/templates/user/user_form.html,sha256=fPbbUnx2URhdW9-by26q3xe3_w23de42Nj25BOC3qrs,2641
239
240
  accrete/contrib/user_registration/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
240
241
  accrete/contrib/user_registration/admin.py,sha256=kwmGTsg4Hii-lsw9-UaJG7AhQ4k4SPi48GSrtpZ4YR4,119
241
242
  accrete/contrib/user_registration/apps.py,sha256=mYu3fuuubfjImeJHk4D_Wd6Edw2r3oUNXGcFbAkhir4,181
@@ -261,7 +262,7 @@ accrete/utils/forms.py,sha256=1UQoG0cXel4Tg-a_cG9doJNrl62a0JMDVEYrT5TSX1s,3383
261
262
  accrete/utils/log.py,sha256=BH0MBDweAjx30wGBO4F3sFhbgkSoEs7T1lLLjlYZNnA,407
262
263
  accrete/utils/models.py,sha256=2xTacvcpmDK_Bp4rAK7JdVLf8HU009LYNJ6eSpMgYZI,1014
263
264
  accrete/utils/views.py,sha256=AutijWetWGgjdO1PNc4gxCblT-i1fAfldNDFRbO9Sac,5012
264
- accrete-0.0.129.dist-info/METADATA,sha256=Ak-a0g5oHBQbDWpeg0ekq4Fi-RPP80PmqyeHp8W7uhM,4953
265
- accrete-0.0.129.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
266
- accrete-0.0.129.dist-info/licenses/LICENSE,sha256=_7laeMIHnsd3Y2vJEXDYXq_PEXxIcjgJsGt8UIKTRWc,1057
267
- accrete-0.0.129.dist-info/RECORD,,
265
+ accrete-0.0.131.dist-info/METADATA,sha256=U50p60IxKECtHAk-yUBYg9KBgs9gAMpCXD-sTt-euV8,4953
266
+ accrete-0.0.131.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
267
+ accrete-0.0.131.dist-info/licenses/LICENSE,sha256=_7laeMIHnsd3Y2vJEXDYXq_PEXxIcjgJsGt8UIKTRWc,1057
268
+ accrete-0.0.131.dist-info/RECORD,,