Permalink
Browse files

Add a message for document edition

  • Loading branch information...
1 parent bed7b61 commit 4dc2fba7ca062496ecb61ce89c2d12665e272e4e @liZe liZe committed Apr 27, 2012
Showing with 8 additions and 3 deletions.
  1. +3 −1 pynuts/document.py
  2. +5 −2 pynuts/templates/edit_document.jinja2
View
@@ -247,7 +247,9 @@ def edit(cls, template, part='index.rst.jinja2', version=None,
document.git.tree.add(part, 0100644, blob_id)
document.git.store.add_object(document.git.tree)
if message is None:
- message = 'Edit %s' % document.document_id
+ message = (
+ request.form.get('message') or
+ 'Edit %s' % document.document_id)
commit_id = document.git.store_commit(
document.git.tree.id, [document.git.commit.id], 'Pynuts',
message)
@@ -1,5 +1,8 @@
<form action="" method="post">
<input type="hidden" value="{{ old_commit }}" name="_old_commit" />
- <textarea name="document" cols="100" rows="20">{{ text }}</textarea>
- <input type=submit value="Save">
+ <label for="document">Content</label>
+ <textarea name="document" id="message">{{ text }}</textarea>
+ <label for="message">Message</label>
+ <input type="text" name="message" id="message" />
+ <input type="text" value="Save">
</form>

0 comments on commit 4dc2fba

Please sign in to comment.