# HG changeset patch # User BenoƮt Allard # Date 1412841057 -7200 # Node ID 023080ffd9953727a5ddd87f0f5330c2519ce3e0 # Parent f1705e90695b1bb57d0a72242910ed85ab596c32 Allow deletion of revisions diff -r f1705e90695b -r 023080ffd995 farol/document.py --- a/farol/document.py Thu Oct 09 09:48:05 2014 +0200 +++ b/farol/document.py Thu Oct 09 09:50:57 2014 +0200 @@ -142,6 +142,13 @@ tracking._currentDate = date return redirect(url_for('.view')) +@document.route('/revision/del', methods=['POST']) +@document_required +def del_revision(): + index = int(request.form['index']) + del get_current()._tracking._history[index] + return redirect(url_for('.view')) + @document.route('/distribution/edit', methods=['GET', 'POST']) @document_required def edit_distribution(): diff -r f1705e90695b -r 023080ffd995 farol/static/style.css --- a/farol/static/style.css Thu Oct 09 09:48:05 2014 +0200 +++ b/farol/static/style.css Thu Oct 09 09:50:57 2014 +0200 @@ -13,6 +13,11 @@ margin-bottom: -50px; } */ + +form.delete { + display: inline-block; +} + .footer { height: 130px; margin-top: 20px; diff -r f1705e90695b -r 023080ffd995 farol/templates/document/view.j2 --- a/farol/templates/document/view.j2 Thu Oct 09 09:48:05 2014 +0200 +++ b/farol/templates/document/view.j2 Thu Oct 09 09:50:57 2014 +0200 @@ -60,7 +60,10 @@ {% for revision in cvrf._tracking._history %}
  • - edit revision +
    + edit +
    +
    {{ label_value('Number', revision._number | join('.'), right=8) }} {{ label_value('Date', revision._date) }} {{ label_value('Description', revision._description) }}