Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #985 from darkwing/new-document-revision-844636

fix bug 844636 - Add rev comment to new docs
  • Loading branch information...
commit 2a85f78f42a1678da3e90742fa7c45f4064501eb 2 parents 7e48045 + c5960d2
@lmorchard lmorchard authored
View
6 apps/wiki/templates/wiki/edit_document.html
@@ -132,11 +132,7 @@
{% include 'wiki/includes/title_autosuggest_url.html' %}
- <section class="page-meta"><section id="page-comment">
- <h2>{{_('Revision Comment')}}</h2>
- <p>{{_('Tell us why you made this change.')}}</p>
- {{ revision_form.comment | safe }}
- </section></section>
+ {% include 'wiki/includes/revision_comment.html' %}
<section class="page-meta">
{% set tags = document.tags.all() %}
View
5 apps/wiki/templates/wiki/includes/revision_comment.html
@@ -0,0 +1,5 @@
+<section class="page-meta"><section id="page-comment">
+ <h2>{{_('Revision Comment')}}</h2>
+ <p>{{_('Tell us why you made additions and changes.')}}</p>
+ {{ revision_form.comment | safe }}
+</section></section>
View
7 apps/wiki/templates/wiki/new_document.html
@@ -47,12 +47,7 @@
{% include 'wiki/includes/title_autosuggest_url.html' %}
- <section class="page-meta">
- <section>
- <h4>{{_('Review needed?')}}</h4>
- {{ revision_form.review_tags|safe }}
- </section>
- </section>
+ {% include 'wiki/includes/revision_comment.html' %}
<section class="page-meta">
<section id="page-tags">
View
6 apps/wiki/templates/wiki/translate.html
@@ -118,11 +118,7 @@
</section>
</div>
- <section class="page-meta" style="clear:both;"><section id="page-comment">
- <h2>{{_('Revision Comment')}}</h2>
- <p>{{_('Tell us why you made this change.')}}</p>
- {{ revision_form.comment | safe }}
- </section></section>
+ {% include 'wiki/includes/revision_comment.html' %}
</details>
{% endif %}
View
16 apps/wiki/tests/test_views.py
@@ -915,6 +915,22 @@ def test_create_on_404(self):
args=['Template:NoExist'],
locale=locale))
eq_(302, response.status_code)
+
+ def test_new_document_comment(self):
+ """ Creating a new document with a revision comment saves the comment """
+ client = LocalizingClient()
+ client.login(username='admin', password='testpass')
+
+ comment = 'I am the revision comment'
+ slug = 'Test-doc-comment'
+ loc = settings.WIKI_DEFAULT_LANGUAGE
+
+ # Create a new doc.
+ data = new_document_data()
+ data.update({'slug': slug, 'comment': comment})
+ resp = client.post(reverse('wiki.new_document'), data)
+ eq_(comment,
+ Document.uncached.get(slug=slug, locale=loc).current_revision.comment)
@attr('retitle')
def test_retitling_solo_doc(self):
Please sign in to comment.
Something went wrong with that request. Please try again.