adds create and delete vehicle

This commit is contained in:
2016-04-23 17:11:43 +02:00
parent d19b0a5858
commit 267c59cbb3
5 changed files with 60 additions and 2 deletions

View File

@@ -5,11 +5,13 @@
<a href='{{ url_for('security.change_password') }}'>Change password</a>
<a href="{{ url_for('create_vehicle') }}">create</a>
<table>
{% for vehicle in current_user.vehicles %}
<tr>
<td>{{vehicle.name}}</td>
<td><a href="{{ url_for('edit_vehicle', vid=vehicle.id) }}">edit</a></td>
<td><a href="{{ url_for('delete_vehicle', vid=vehicle.id) }}">delete</a></td>
</tr>
{% endfor %}
</table>

View File

@@ -0,0 +1,12 @@
{% extends "layout.html" %}
{% block body %}
<h1>Create vehicle</h1>
<form class='form-horizontal' method="POST">
{{ form.hidden_tag() }}
{{ render_field_with_errors(form.name) }}
<input type="submit" value="Go">
</form>
{% endblock %}

View File

@@ -0,0 +1,11 @@
{% extends "layout.html" %}
{% block body %}
<h1>Delete vehicle "{{vehicle.name}}"</h1>
<form class='form-horizontal' method="POST">
{{ form.hidden_tag() }}
<input type="submit" value="Go">
</form>
{% endblock %}

View File

@@ -1,6 +1,7 @@
{% extends "layout.html" %}
{% block body %}
<h1>Edit vehicle</h1>
<form class='form-horizontal' method="POST">
{{ form.hidden_tag() }}
{{ render_field_with_errors(form.name) }}