Permalink
Browse files

Merge pull request #235 from nickolay/759184-section-editing

Bug 759184: Allow logged-in users to edit sections
  • Loading branch information...
2 parents 50d42db + 066a2f8 commit 93ab1f2941c4b7c96f591dfa51829ccb2912d960 @groovecoder groovecoder committed May 31, 2012
Showing with 4 additions and 3 deletions.
  1. +2 −2 apps/wiki/templates/wiki/document.html
  2. +2 −1 apps/wiki/views.py
@@ -82,7 +82,7 @@ <h1 class="page-title">{{ document.title }}</h1>
{% if request.user.is_authenticated() %}
<li class="page-watch"><a href="{{ url('wiki.document_watch', document.full_path) }}">{{_('Watch')}}</a></li>
{% endif %}
- {% if document.allows_editing_by(request.user) or document.allows_revision_by(request.user) %}
+ {% if document.allows_revision_by(request.user) %}
<li class="page-edit"><a href="{{ url('wiki.edit_document', document.full_path) }}">{{_('Edit')}}</a></li>
{% endif %}
</ul>
@@ -202,7 +202,7 @@ <h2>{{ _('Tags') }}</h2>
#}
</div>
</div>
- {% if document.allows_editing_by(request.user) %}
+ {% if document.allows_revision_by(request.user) and request.user.is_authenticated() %}
<div class="edited-section-ui template">
<a class="btn-save" href="#">{{ _('Save') }}</a>
<a class="btn-cancel" href="#">{{ _('Cancel') }}</a>
View
@@ -288,7 +288,8 @@ def set_common_headers(r):
# If this user can edit the document, inject some section editing
# links.
if ((need_edit_links or not show_raw) and
- doc.allows_editing_by(request.user)):
+ request.user.is_authenticated() and
+ doc.allows_revision_by(request.user)):
tool.injectSectionEditingLinks(doc.full_path, doc.locale)
doc_html = tool.serialize()

0 comments on commit 93ab1f2

Please sign in to comment.