mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-10 11:59:23 +00:00
add back user profiles on subscription form
This commit is contained in:
@ -0,0 +1,14 @@
|
||||
{% load static %}
|
||||
{% load i18n %}
|
||||
|
||||
|
||||
<div x-data="existing_user_subscription_form" class="form-content existing-user">
|
||||
<fieldset>
|
||||
{{ form.as_p }}
|
||||
</fieldset>
|
||||
<div
|
||||
id="subscription-form-user-mini-profile"
|
||||
x-html="profileFragment"
|
||||
:aria-busy="loading"
|
||||
></div>
|
||||
</div>
|
@ -0,0 +1 @@
|
||||
{{ form.as_p }}
|
@ -5,6 +5,6 @@
|
||||
hx-swap="outerHTML"
|
||||
>
|
||||
{% csrf_token %}
|
||||
{{ form.as_p() }}
|
||||
{{ form }}
|
||||
<input type="submit" value="{% trans %}Save{% endtrans %}">
|
||||
</form>
|
||||
|
@ -4,18 +4,21 @@
|
||||
{% 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.
|
||||
{% 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() }}">
|
||||
<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") }}">
|
||||
<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
|
||||
|
@ -13,10 +13,16 @@
|
||||
If the aforementioned bug is resolved, you can remove this. #}
|
||||
{% block additional_js %}
|
||||
<script type="module" defer src="{{ static("bundled/core/components/ajax-select-index.ts") }}"></script>
|
||||
<script
|
||||
type="module"
|
||||
defer
|
||||
src="{{ static("bundled/subscription/creation-form-existing-user-index.ts") }}"
|
||||
></script>
|
||||
{% endblock %}
|
||||
{% block additional_css %}
|
||||
<link rel="stylesheet" href="{{ static("bundled/core/components/ajax-select-index.css") }}">
|
||||
<link rel="stylesheet" href="{{ static("core/components/ajax-select.scss") }}">
|
||||
<link rel="stylesheet" href="{{ static("subscription/css/subscription.scss") }}">
|
||||
{% endblock %}
|
||||
|
||||
{% macro form_fragment(form_object, post_url) %}
|
||||
@ -30,9 +36,11 @@
|
||||
{% block content %}
|
||||
<h3>{% trans %}New subscription{% endtrans %}</h3>
|
||||
<div id="subscription-form" hx-ext="response-targets">
|
||||
{{ tabs([
|
||||
(_("Existing member"), form_fragment(existing_user_form, existing_user_post_url)),
|
||||
(_("New member"), form_fragment(new_user_form, new_user_post_url)),
|
||||
]) }}
|
||||
{% with title1=_("Existing member"), title2=_("New member") %}
|
||||
{{ tabs([
|
||||
(title1, form_fragment(existing_user_form, existing_user_post_url)),
|
||||
(title2, form_fragment(new_user_form, new_user_post_url)),
|
||||
]) }}
|
||||
{% endwith %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
Reference in New Issue
Block a user