nk20/templates/wei/weiregistration_form.html

43 lines
1.2 KiB
HTML
Raw Normal View History

2020-04-18 01:27:12 +00:00
{% extends "member/noteowner_detail.html" %}
2020-04-12 01:31:08 +00:00
{% load i18n %}
{% load crispy_forms_tags %}
2020-04-18 01:27:12 +00:00
{% block profile_info %}
{% include "wei/weiclub_info.html" %}
{% endblock %}
{% block profile_content %}
2020-04-20 23:06:54 +00:00
<form method="post">
{% csrf_token %}
{{ form|crispy }}
{{ membership_form|crispy }}
<button class="btn btn-primary" type="submit">{% trans "Submit" %}</button>
</form>
2020-04-12 01:31:08 +00:00
{% endblock %}
2020-08-03 11:33:25 +00:00
{% block extrajavascript %}
<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');
});
});
}
$("input[name='bus']").change(refreshTeams);
refreshTeams();
});
</script>
{% endblock %}