First step

This commit is contained in:
Joachim Lusiardi 2016-05-24 23:55:58 +02:00
parent 227dc79e6b
commit ef55b4e479
3 changed files with 24 additions and 1 deletions

View File

@ -27,7 +27,8 @@ from rollerverbrauch.forms import \
CreatePitstopForm, \ CreatePitstopForm, \
EditVehicleForm, \ EditVehicleForm, \
DeleteVehicleForm, \ DeleteVehicleForm, \
SelectVehicleForm SelectVehicleForm, \
DeleteAccountForm
from rollerverbrauch.entities import \ from rollerverbrauch.entities import \
User, \ User, \
@ -217,3 +218,13 @@ def get_statistics():
for vehicle in current_user.vehicles: for vehicle in current_user.vehicles:
stats.append(tools.VehicleStats(vehicle)) stats.append(tools.VehicleStats(vehicle))
return render_template('statistics.html', data=stats) return render_template('statistics.html', data=stats)
@app.route('/account/delete', methods=['GET', 'POST'])
@login_required
def delete_account():
form = DeleteAccountForm()
if form.validate_on_submit():
return redirect(url_for('get_account_page'))
return render_template('deleteVehicleForm.html', form=form, vehicle=vehicle)

View File

@ -44,3 +44,7 @@ class EditVehicleForm(Form):
class DeleteVehicleForm(Form): class DeleteVehicleForm(Form):
submit = SubmitField(label='Do it!') submit = SubmitField(label='Do it!')
class DeleteAccountForm(Form):
submit = SubmitField(label='Do it!')

View File

@ -53,4 +53,12 @@
{% endfor %} {% endfor %}
</table> </table>
</div> </div>
<div class="panel panel-default">
<div class="panel-heading">Account</div>
<div class="panel-body">
<a href='{{ url_for('security.change_password') }}'>
<span class="glyphicon glyphicon-remove" aria-hidden="true"></span> Delete
</a>
</div>
</div>
{% endblock %} {% endblock %}