mirror of
https://github.com/ae-utbm/sith.git
synced 2026-03-31 15:59:42 +00:00
Split SubscriptionForm into SubscriptionNewUserForm and SubscriptionExistingUserForm
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
<form
|
||||
hx-post="{{ post_url }}"
|
||||
hx-target="this"
|
||||
hx-disabled-elt="find input[type='submit']"
|
||||
hx-swap="outerHTML"
|
||||
>
|
||||
{% csrf_token %}
|
||||
{{ form.as_p() }}
|
||||
<input type="submit" value="{% trans %}Save{% endtrans %}">
|
||||
</form>
|
||||
@@ -0,0 +1,27 @@
|
||||
<div class="alert alert-green">
|
||||
<div class="alert-main">
|
||||
<h3 class="alert-title">
|
||||
{% trans user=subscription.member %}Subscription created for {{ user }}{% endtrans %}
|
||||
</h3>
|
||||
<p>
|
||||
|
||||
{% trans trimmed user=subscription.member.get_short_name(), type=subscription.subscription_type, end=subscription.subscription_end %}
|
||||
{{ user }} received its new {{ type }} subscription.
|
||||
It will be active until {{ end }} included.
|
||||
{% endtrans %}
|
||||
</p>
|
||||
</div>
|
||||
<div class="alert-aside">
|
||||
<a class="btn btn-blue" href="{{ subscription.member.get_absolute_url() }}">
|
||||
{% trans %}Go to user profile{% endtrans %}
|
||||
</a>
|
||||
<a class="btn btn-grey" href="{{ url("subscription:subscription") }}">
|
||||
{# We don't know if this fragment is displayed after creating a subscription
|
||||
for a previously existing user or for a newly created one.
|
||||
Thus, we don't know which form should be used to create another subscription
|
||||
in this place.
|
||||
Therefore, we reload the entire page. It just works. #}
|
||||
{% trans %}Create another subscription{% endtrans %}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user