2019-06-25 23:43:23 +02:00
|
|
|
{% extends "index.html" %}
|
|
|
|
{% load dict %}
|
|
|
|
{% block form %}
|
|
|
|
{% if sailors_forms.initial|length <= 0 %}
|
|
|
|
<em>No one is yet assigned for this boat</em>
|
|
|
|
{% else %}
|
2019-07-18 13:37:07 +02:00
|
|
|
<!-- necessary to work with formsets -->
|
|
|
|
{{ sailors_forms.management_form }}
|
2019-06-25 23:43:23 +02:00
|
|
|
|
|
|
|
Previous passengers :
|
|
|
|
<table>
|
|
|
|
<tr>
|
|
|
|
<th>Person</th>
|
|
|
|
<th>Captain</th>
|
|
|
|
<th>Crew</th>
|
|
|
|
<th>Owner</th>
|
|
|
|
<th>Guest</th>
|
|
|
|
<th>Pet</th>
|
|
|
|
<th>On the boat</th>
|
|
|
|
</tr>
|
|
|
|
{% for sailors_form in sailors_forms %}
|
|
|
|
<tr>
|
|
|
|
{% with id=sailors_form.person.value %}
|
2019-07-18 13:37:07 +02:00
|
|
|
<td>{{ persons|get:id }}
|
|
|
|
{{ sailors_form.person }}</td>
|
2019-06-25 23:43:23 +02:00
|
|
|
{% endwith %}
|
|
|
|
<td>{{ sailors_form.is_captain }}</td>
|
|
|
|
<td>{{ sailors_form.is_crew }}</td>
|
|
|
|
<td>{{ sailors_form.is_owner }}</td>
|
|
|
|
<td>{{ sailors_form.is_guest }}</td>
|
|
|
|
<td>{{ sailors_form.is_pet }}</td>
|
|
|
|
<td>{{ sailors_form.present }}</td>
|
|
|
|
</tr>
|
|
|
|
{% endfor %}
|
|
|
|
</table>
|
|
|
|
<br />
|
|
|
|
<input type="submit" value="Next" />
|
|
|
|
<br />
|
|
|
|
{% endif %}
|
|
|
|
{% endblock %}
|
|
|
|
{% block formnew %}
|
|
|
|
<form action="{% url 'person:add' %}" method="post">
|
2024-07-15 11:01:34 +02:00
|
|
|
{% csrf_token %}
|
2019-06-25 23:43:23 +02:00
|
|
|
<div class="new hidden" id="new_person">
|
|
|
|
{{ person_form }}
|
|
|
|
<input type="submit" value="Add person" />
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
{% endblock %}
|