Sith/subscription/templates/subscription/subscription.jinja

50 lines
2.0 KiB
Plaintext
Raw Normal View History

2016-03-22 10:42:00 +00:00
{% extends "core/base.jinja" %}
{% block title %}
2016-07-19 17:03:16 +00:00
{% trans %}New subscription{% endtrans %}
2016-03-22 10:42:00 +00:00
{% endblock %}
{% block content %}
2016-07-19 17:03:16 +00:00
<h3>{% trans %}New subscription{% endtrans %}</h3>
2016-08-14 17:28:14 +00:00
<div id="user_info"></div>
<form action="" method="post" id="subscription_form">
2016-03-22 10:42:00 +00:00
{% csrf_token %}
2016-09-02 10:29:50 +00:00
{{ form.non_field_errors() }}
2016-08-14 17:28:14 +00:00
<p>{{ form.member.errors }}<label for="{{ form.member.name }}">{{ form.member.label }}</label> {{ form.member }}</p>
<div id="new_member">
<p>{{ form.first_name.errors }}<label for="{{ form.first_name.name }}">{{ form.first_name.label }}</label> {{ form.first_name }}</p>
<p>{{ form.last_name.errors }}<label for="{{ form.last_name.name }}">{{ form.last_name.label }}</label> {{ form.last_name }}</p>
2016-08-14 17:28:14 +00:00
<p>{{ form.email.errors }}<label for="{{ form.email.name }}">{{ form.email.label }}</label> {{ form.email }}</p>
</div>
<p>{{ form.subscription_type.errors }}<label for="{{ form.subscription_type.name }}">{{ form.subscription_type.label }}</label> {{ form.subscription_type }}</p>
<p>{{ form.payment_method.errors }}<label for="{{ form.payment_method.name }}">{{ form.payment_method.label }}</label> {{
form.payment_method }}</p>
<p>{{ form.location.errors }}<label for="{{ form.location.name }}">{{ form.location.label }}</label> {{ form.location }}</p>
2016-07-19 17:03:16 +00:00
<p><input type="submit" value="{% trans %}Save{% endtrans %}" /></p>
2016-03-22 10:42:00 +00:00
</form>
{% endblock %}
2016-08-14 17:28:14 +00:00
{% block script %}
{{ super() }}
<script type="text/javascript" charset="utf-8">
$( function() {
select = $("#id_member");
2016-08-14 17:28:14 +00:00
member_block = $("#subscription_form #new_member");
user_info = $("#user_info");
function display_new_member() {
if (select.val()) {
member_block.hide();
user_info.load("/user/"+select.val()+"/mini");
user_info.show();
2016-08-14 17:28:14 +00:00
} else {
member_block.show();
user_info.empty();
user_info.hide();
2016-08-14 17:28:14 +00:00
}
}
select.on("change", display_new_member);
display_new_member();
} );
</script>
{% endblock %}