# HG changeset patch # User BenoƮt Allard # Date 1414148375 -7200 # Node ID 812e613cbbb43d8da7de7ca083958061c4ee382f # Parent 75c053bf2c3ac36a54df3ad99b5bac279d3d3cc9 Add possibility to delete the current document. diff -r 75c053bf2c3a -r 812e613cbbb4 farol/document.py --- a/farol/document.py Fri Oct 24 10:53:37 2014 +0200 +++ b/farol/document.py Fri Oct 24 12:59:35 2014 +0200 @@ -34,7 +34,7 @@ update_reference_from_request, create_reference_from_request, update_acknowledgment_from_request, create_acknowledgment_from_request, split_fields, parseDate, parseVersion) -from .session import document_required, get_current +from .session import document_required, get_current, del_current document = Blueprint('document', __name__) @@ -45,6 +45,11 @@ cvrf = get_current() return render_template('document/view.j2', cvrf=cvrf) +@document.route('/delete', methods=['POST']) +def delete(): + del_current() + return redirect(url_for('welcome')) + @document.route('/title/edit', methods=['GET', 'POST']) @document_required def edit_title(): diff -r 75c053bf2c3a -r 812e613cbbb4 farol/templates/document/view.j2 --- a/farol/templates/document/view.j2 Fri Oct 24 10:53:37 2014 +0200 +++ b/farol/templates/document/view.j2 Fri Oct 24 12:59:35 2014 +0200 @@ -169,4 +169,13 @@ {% endcall %} +
delete
+{% call modal('delete_modal', 'Delete document') %} +

This will delete the document {{ current_id }}.

+

Are you sure ?

+ +