diff --git a/common/lib/mitxmako/mitxmako/makoloader.py b/common/lib/mitxmako/mitxmako/makoloader.py index fc1633c35a..53334d1a1b 100644 --- a/common/lib/mitxmako/mitxmako/makoloader.py +++ b/common/lib/mitxmako/mitxmako/makoloader.py @@ -23,7 +23,7 @@ class MakoLoader(object): return self.load_template(template_name, template_dirs) def load_template(self, template_name, template_dirs=None): - source, display_name = self.base_loader.load_template_source(template_name, template_dirs) + source, display_name = self.load_template_source(template_name, template_dirs) if source.startswith("## mako\n"): # This is a mako template @@ -42,9 +42,9 @@ class MakoLoader(object): # not exist. return source, display_name - def load_template_source(self): + def load_template_source(self, template_name, template_dirs=None): # Just having this makes the template load as an instance, instead of a class. - raise NotImplementedError + return self.base_loader.load_template_source(template_name, template_dirs) def reset(self): self.base_loader.reset() diff --git a/common/lib/mitxmako/mitxmako/template.py b/common/lib/mitxmako/mitxmako/template.py index fa6b1293f8..65328ae830 100644 --- a/common/lib/mitxmako/mitxmako/template.py +++ b/common/lib/mitxmako/mitxmako/template.py @@ -53,6 +53,7 @@ class Template(MakoTemplate): context_dictionary.update(d) context_dictionary['settings'] = settings context_dictionary['MITX_ROOT_URL'] = settings.MITX_ROOT_URL - + context_dictionary['django_context'] = context_instance + return super(Template, self).render(**context_dictionary) diff --git a/common/lib/mitxmako/mitxmako/templatetag_helpers.py b/common/lib/mitxmako/mitxmako/templatetag_helpers.py index 10c502fbfe..6742f3ee1c 100644 --- a/common/lib/mitxmako/mitxmako/templatetag_helpers.py +++ b/common/lib/mitxmako/mitxmako/templatetag_helpers.py @@ -3,7 +3,10 @@ from django.template.base import Template, Context from django.template.loader import get_template, select_template -def render_inclusion(func, file_name, *args, **kwargs): +def render_inclusion(func, file_name, takes_context, django_context, *args, **kwargs): + if takes_context: + args = [django_context] + list(args) + _dict = func(*args, **kwargs) if isinstance(file_name, Template): t = file_name @@ -15,6 +18,10 @@ def render_inclusion(func, file_name, *args, **kwargs): nodelist = t.nodelist new_context = Context(_dict) + csrf_token = django_context.get('csrf_token', None) + if csrf_token is not None: + new_context['csrf_token'] = csrf_token + # **{ # 'autoescape': context.autoescape, # 'current_app': context.current_app, diff --git a/lms/envs/common.py b/lms/envs/common.py index 6354d58bdf..af5e3184a3 100644 --- a/lms/envs/common.py +++ b/lms/envs/common.py @@ -274,6 +274,9 @@ djcelery.setup_loader() SIMPLE_WIKI_REQUIRE_LOGIN_EDIT = True SIMPLE_WIKI_REQUIRE_LOGIN_VIEW = False +################################# WIKI ################################### +WIKI_ACCOUNT_HANDLING = False + ################################# Jasmine ################################### JASMINE_TEST_DIRECTORY = PROJECT_ROOT + '/static/coffee' diff --git a/lms/envs/devplus.py b/lms/envs/devplus.py index b15322c2c7..bb4524a1ab 100644 --- a/lms/envs/devplus.py +++ b/lms/envs/devplus.py @@ -65,5 +65,7 @@ DEBUG_TOOLBAR_PANELS = ( # Django=1.3.1/1.4 where requests to views get duplicated (your method gets # hit twice). So you can uncomment when you need to diagnose performance # problems, but you shouldn't leave it on. -# 'debug_toolbar.panels.profiling.ProfilingDebugPanel', + 'debug_toolbar.panels.profiling.ProfilingDebugPanel', ) + +#PIPELINE = True diff --git a/lms/templates/wiki/article.html b/lms/templates/wiki/article.html index 3a2c9653fa..0dfb9cb4bd 100644 --- a/lms/templates/wiki/article.html +++ b/lms/templates/wiki/article.html @@ -27,7 +27,7 @@ ${breadcrumbs.body(article, urlpath)}
You have django-wiki installed... but there are no articles. So it's time to create the first one, the root article. In the beginning, it will only be editable by administrators, but you can define permissions after. +
+ +