# HG changeset patch # User BenoƮt Allard # Date 1412244528 -7200 # Node ID 69e0330c4faebcd524aa5ae27b9bac33b5dbba61 # Parent 33a3a36b5bf69f854bae361f533ebbd2c63e06ac Display the id of the current document when asking to save it diff -r 33a3a36b5bf6 -r 69e0330c4fae farol/main.py --- a/farol/main.py Thu Oct 02 12:07:40 2014 +0200 +++ b/farol/main.py Thu Oct 02 12:08:48 2014 +0200 @@ -139,7 +139,11 @@ @app.route('/new', methods=['GET', 'POST']) def new(): if request.method != 'POST': - return render_template('new.j2', has_document=has_current(), now=utcnow()) + current_id = None + cvrf = get_current() + if has_current(): + current_id = get_current()._tracking._identification._id + return render_template('new.j2', has_document=has_current(), now=utcnow(), current_id=current_id) if 'rhsa' in request.form: set_RHSA(request.form['id']) diff -r 33a3a36b5bf6 -r 69e0330c4fae farol/templates/new.j2 --- a/farol/templates/new.j2 Thu Oct 02 12:07:40 2014 +0200 +++ b/farol/templates/new.j2 Thu Oct 02 12:08:48 2014 +0200 @@ -32,7 +32,7 @@ {% block content %} {% if has_document and caching %} -

You have an unsaved document, maybe you want to save it first ?

+

You are currently editing a document: {{ current_id }}. Loading a new one will lose your modifications. Do you want to save it first ?

{% endif %}

New Document