1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2024-12-19 05:52:21 +00:00
nk20/apps/wei/templates/wei/weiregistration_form.html

50 lines
1.4 KiB
HTML
Raw Normal View History

{% extends "wei/base.html" %}
2020-08-25 16:36:49 +00:00
{% comment %}
SPDX-License-Identifier: GPL-3.0-or-later
{% endcomment %}
2020-04-12 01:31:08 +00:00
{% load i18n %}
{% load crispy_forms_tags %}
2020-04-18 01:27:12 +00:00
{% block profile_content %}
2020-08-25 16:36:49 +00:00
<div class="card bg-light mb-3">
<h3 class="card-header text-center">
{{ title }}
</h3>
<div class="card-body">
<form method="post">
{% csrf_token %}
{{ form|crispy }}
{{ membership_form|crispy }}
<button class="btn btn-primary" type="submit">{% trans "Submit" %}</button>
</form>
</div>
</div>
2020-04-12 01:31:08 +00:00
{% endblock %}
2020-08-03 11:33:25 +00:00
{% block extrajavascript %}
2020-08-25 16:36:49 +00:00
{% if not object.membership %}
<script>
$(document).ready(function () {
function refreshTeams() {
let buses = [];
$("input[name='bus']:checked").each(function (ignored) {
buses.push($(this).parent().text().trim());
});
console.log(buses);
$("input[name='team']").each(function () {
let label = $(this).parent();
$(this).parent().addClass('d-none');
buses.forEach(function (bus) {
if (label.text().includes(bus))
label.removeClass('d-none');
2020-08-03 11:33:25 +00:00
});
2020-08-25 16:36:49 +00:00
});
}
2020-08-03 11:33:25 +00:00
2020-08-25 16:36:49 +00:00
$("input[name='bus']").change(refreshTeams);
2020-08-03 11:33:25 +00:00
2020-08-25 16:36:49 +00:00
refreshTeams();
});
</script>
{% endif %}
{% endblock %}