refactor: use FragmentMixin for subscription fragments

This commit is contained in:
imperosol
2026-05-08 12:55:59 +02:00
parent e2d2eb7470
commit 7bd2f1da96
7 changed files with 55 additions and 61 deletions
@@ -0,0 +1,38 @@
<form
hx-post="{{ url("subscription:fragment-existing-user") }}"
hx-target="this"
hx-disabled-elt="find input[type='submit']"
hx-swap="outerHTML"
>
{% csrf_token %}
<div x-data="existing_user_subscription_form" class="form-content existing-user">
<fieldset>
{{ form.errors }}
{% for field in form %}
<div class="form-group">
{{ field.label_tag() }}
{{ field }}
{% if field.help_text %}
<span class="helptext">{{ field.help_text }}</span>
{% endif %}
{% if field.name == "payment_method" %}
<i>
{% trans trimmed %}
If the subscription is done using the AE account,
you must also click it on the AE counter.
{% endtrans %}
</i>
{% endif %}
</div>
{% endfor %}
</fieldset>
<div
id="subscription-form-user-mini-profile"
x-html="profileFragment"
:aria-busy="loading"
></div>
</div>
<input type="submit" value="{% trans %}Save{% endtrans %}">
</form>
@@ -1,5 +1,5 @@
<form
hx-post="{{ post_url }}"
hx-post="{{ url("subscription:fragment-existing-user") }}"
hx-target="this"
hx-disabled-elt="find input[type='submit']"
hx-swap="outerHTML"