From 9cd69e6ccd4cfc552f238f6316b7462a33445356 Mon Sep 17 00:00:00 2001 From: Bridger Maxwell Date: Wed, 22 Aug 2012 20:03:30 -0400 Subject: [PATCH 1/4] 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 From a792c5a83a8c86cb835c202cff7ba4dddf66c475 Mon Sep 17 00:00:00 2001 From: Bridger Maxwell Date: Wed, 22 Aug 2012 20:16:35 -0400 Subject: [PATCH 2/4] Fixed wiki bug with 500 errors for empty dir listing. --- repo-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/repo-requirements.txt b/repo-requirements.txt index 2da7a5d3b7..6d213ab3a9 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@50c08a3#egg=django-wiki +-e git://github.com/benjaoming/django-wiki.git@d1b97e2#egg=django-wiki -e git://github.com/dementrock/pystache_custom.git@776973740bdaad83a3b029f96e415a7d1e8bec2f#egg=pystache_custom-dev -e common/lib/capa -e common/lib/xmodule From e7732bf32f3155ff3139bacb95b3b6f9aa40f3c0 Mon Sep 17 00:00:00 2001 From: Bridger Maxwell Date: Wed, 22 Aug 2012 21:05:17 -0400 Subject: [PATCH 3/4] Wiki directory links now go to the article, with a smaller link for viewing sub-listings. --- lms/static/sass/course/wiki/_wiki.scss | 4 ++++ repo-requirements.txt | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lms/static/sass/course/wiki/_wiki.scss b/lms/static/sass/course/wiki/_wiki.scss index 9868989eff..af4ec7a5c2 100644 --- a/lms/static/sass/course/wiki/_wiki.scss +++ b/lms/static/sass/course/wiki/_wiki.scss @@ -759,6 +759,10 @@ section.wiki { padding: 8px; overflow: hidden; } + + a.list-children { + margin-left: 3px; + } tr:nth-child(even) { background: #F6F6F6; diff --git a/repo-requirements.txt b/repo-requirements.txt index 6d213ab3a9..b93dc2837f 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@d1b97e2#egg=django-wiki +-e git://github.com/benjaoming/django-wiki.git@533c7fc#egg=django-wiki -e git://github.com/dementrock/pystache_custom.git@776973740bdaad83a3b029f96e415a7d1e8bec2f#egg=pystache_custom-dev -e common/lib/capa -e common/lib/xmodule From 82ebc14bd6cd9b3cc03d77bee0dde1fea83069ff Mon Sep 17 00:00:00 2001 From: Bridger Maxwell Date: Wed, 22 Aug 2012 21:15:52 -0400 Subject: [PATCH 4/4] Fixed inline circuit editing to only work if 'circuit-schematic' is at the beginning of a line. --- common/static/js/vendor/CodeMirror/mitx_markdown.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/static/js/vendor/CodeMirror/mitx_markdown.js b/common/static/js/vendor/CodeMirror/mitx_markdown.js index b619326eb7..fe4fa46eaa 100644 --- a/common/static/js/vendor/CodeMirror/mitx_markdown.js +++ b/common/static/js/vendor/CodeMirror/mitx_markdown.js @@ -152,7 +152,7 @@ CodeMirror.defineMode("mitx_markdown", function(cmCfg, modeCfg) { function blockNormal(stream, state) { var match; - if (stream.match(circuitRE)) { + if (stream.sol() && stream.match(circuitRE)) { stream.skipToEnd(); return circuit_formatter; } else if (state.indentationDiff >= 4) {