From 9cd69e6ccd4cfc552f238f6316b7462a33445356 Mon Sep 17 00:00:00 2001 From: Bridger Maxwell Date: Wed, 22 Aug 2012 20:03:30 -0400 Subject: [PATCH] Added ability for staff users to moderate an article. --- lms/envs/common.py | 5 ++++- lms/templates/wiki/includes/article_menu.html | 12 ++++++++---- repo-requirements.txt | 2 +- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/lms/envs/common.py b/lms/envs/common.py index e016d4a859..d2397c166d 100644 --- a/lms/envs/common.py +++ b/lms/envs/common.py @@ -318,7 +318,10 @@ WIKI_ACCOUNT_HANDLING = False WIKI_EDITOR = 'course_wiki.editors.CodeMirror' WIKI_SHOW_MAX_CHILDREN = 0 # We don't use the little menu that shows children of an article in the breadcrumb WIKI_ANONYMOUS = False # Don't allow anonymous access until the styling is figured out -WIKI_CAN_CHANGE_PERMISSIONS = lambda article, user: user.has_perm('wiki.assign') +WIKI_CAN_CHANGE_PERMISSIONS = lambda article, user: user.is_staff or user.is_superuser +WIKI_CAN_ASSIGN = lambda article, user: user.is_staff or user.is_superuser + +WIKI_USE_BOOTSTRAP_SELECT_WIDGET = False ################################# Jasmine ################################### JASMINE_TEST_DIRECTORY = PROJECT_ROOT + '/static/coffee' diff --git a/lms/templates/wiki/includes/article_menu.html b/lms/templates/wiki/includes/article_menu.html index 0d505ccebd..dd46a3d7fd 100644 --- a/lms/templates/wiki/includes/article_menu.html +++ b/lms/templates/wiki/includes/article_menu.html @@ -1,5 +1,8 @@ ## mako -<%! from django.core.urlresolvers import reverse %> +<%! + from django.core.urlresolvers import reverse + from wiki.core.permissions import can_change_permissions +%>
  • @@ -37,9 +40,10 @@ <%doc> -The settings link has been disabled because the notifications app hasn't been integrated yet and those are the only useful settings. +This should be enabled for all non-anonymous users once the notifications app has been integrated and styled. + -%if not user.is_anonymous(): +%if can_change_permissions(article,user):
  • @@ -47,6 +51,6 @@ The settings link has been disabled because the notifications app hasn't been in
  • %endif - + diff --git a/repo-requirements.txt b/repo-requirements.txt index 82c0b06b34..2da7a5d3b7 100644 --- a/repo-requirements.txt +++ b/repo-requirements.txt @@ -1,6 +1,6 @@ -e git://github.com/MITx/django-staticfiles.git@6d2504e5c8#egg=django-staticfiles -e git://github.com/MITx/django-pipeline.git#egg=django-pipeline --e git://github.com/benjaoming/django-wiki.git@3576a2d#egg=django-wiki +-e git://github.com/benjaoming/django-wiki.git@50c08a3#egg=django-wiki -e git://github.com/dementrock/pystache_custom.git@776973740bdaad83a3b029f96e415a7d1e8bec2f#egg=pystache_custom-dev -e common/lib/capa -e common/lib/xmodule