Added a django template loader that can return Mako templates. Started pulling in new wiki.
This commit is contained in:
@@ -111,6 +111,12 @@ TEMPLATE_CONTEXT_PROCESSORS = (
|
||||
'askbot.user_messages.context_processors.user_messages',#must be before auth
|
||||
'django.contrib.auth.context_processors.auth', #this is required for admin
|
||||
'django.core.context_processors.csrf', #necessary for csrf protection
|
||||
|
||||
# Added for django-wiki
|
||||
'django.core.context_processors.media',
|
||||
'django.core.context_processors.tz',
|
||||
'django.contrib.messages.context_processors.messages',
|
||||
'sekizai.context_processors.sekizai',
|
||||
)
|
||||
|
||||
|
||||
@@ -281,9 +287,13 @@ STATICFILES_FINDERS = (
|
||||
|
||||
# List of callables that know how to import templates from various sources.
|
||||
TEMPLATE_LOADERS = (
|
||||
'django.template.loaders.filesystem.Loader',
|
||||
'django.template.loaders.app_directories.Loader',
|
||||
'askbot.skins.loaders.filesystem_load_template_source',
|
||||
'mitxmako.makoloader.MakoFilesystemLoader',
|
||||
'mitxmako.makoloader.MakoAppDirectoriesLoader',
|
||||
|
||||
# 'django.template.loaders.filesystem.Loader',
|
||||
# 'django.template.loaders.app_directories.Loader',
|
||||
|
||||
#'askbot.skins.loaders.filesystem_load_template_source',
|
||||
# 'django.template.loaders.eggs.Loader',
|
||||
)
|
||||
|
||||
@@ -514,6 +524,14 @@ INSTALLED_APPS = (
|
||||
'track',
|
||||
'util',
|
||||
'certificates',
|
||||
|
||||
#For the wiki
|
||||
'wiki', # The new django-wiki from benjaoming
|
||||
'django_notify',
|
||||
'mptt',
|
||||
'sekizai',
|
||||
'wiki.plugins.attachments',
|
||||
'wiki.plugins.notifications',
|
||||
|
||||
# For testing
|
||||
'django_jasmine',
|
||||
|
||||
48
lms/templates/wiki/article.html
Normal file
48
lms/templates/wiki/article.html
Normal file
@@ -0,0 +1,48 @@
|
||||
## mako
|
||||
<%inherit file="../main.html"/>
|
||||
<%namespace name='static' file='../static_content.html'/>
|
||||
|
||||
<%block name="bodyextra">
|
||||
|
||||
This is a mako template with inheritance!
|
||||
|
||||
</%block>
|
||||
|
||||
|
||||
<!-- {% extends "wiki/base.html" %}
|
||||
{% load wiki_tags i18n %}
|
||||
{% load url from future %}
|
||||
|
||||
{% block pagetitle %}{{ article.current_revision.title }}{% endblock %}
|
||||
|
||||
{% block wiki_breadcrumbs %}
|
||||
{% include "wiki/includes/breadcrumbs.html" %}
|
||||
{% endblock %}
|
||||
|
||||
{% block wiki_contents %}
|
||||
<h1> Did it work? </h1>
|
||||
<div class="tabbable tabs-top" style="margin-top: 20px;">
|
||||
<ul class="nav nav-tabs">
|
||||
<li style="float: left">
|
||||
<h1 style="margin-top: -10px;">{{ article.current_revision.title }}</h1>
|
||||
</li>
|
||||
{% with "view" as selected %}
|
||||
{% include "wiki/includes/article_menu.html" %}
|
||||
{% endwith %}
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
{% wiki_render article %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tabbable tabs-below" style="margin-top: 20px;">
|
||||
<ul class="nav nav-tabs">
|
||||
{% with "view" as selected %}
|
||||
{% include "wiki/includes/article_menu.html" %}
|
||||
{% endwith %}
|
||||
<li style="margin-top: 10px;"><em>{% trans "Article last modified:" %} {{ article.current_revision.modified }}</em></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
{% endblock %} -->
|
||||
|
||||
15
lms/urls.py
15
lms/urls.py
@@ -2,7 +2,6 @@ from django.conf import settings
|
||||
from django.conf.urls import patterns, include, url
|
||||
from django.contrib import admin
|
||||
from django.conf.urls.static import static
|
||||
|
||||
import django.contrib.auth.views
|
||||
|
||||
# Uncomment the next two lines to enable the admin:
|
||||
@@ -144,9 +143,17 @@ if settings.COURSEWARE_ENABLED:
|
||||
|
||||
# Multicourse wiki
|
||||
if settings.WIKI_ENABLED:
|
||||
urlpatterns += (
|
||||
url(r'^wiki/', include('simplewiki.urls')),
|
||||
url(r'^courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/wiki/', include('simplewiki.urls')),
|
||||
from wiki.urls import get_pattern as wiki_pattern
|
||||
from django_notify.urls import get_pattern as notify_pattern
|
||||
|
||||
# urlpatterns += (
|
||||
# url(r'^wiki/', include('simplewiki.urls')),
|
||||
# url(r'^courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/wiki/', include('simplewiki.urls')),
|
||||
# )
|
||||
urlpatterns += (
|
||||
|
||||
url(r'wiki/', include(wiki_pattern())),
|
||||
url(r'^notify/', include(notify_pattern())),
|
||||
)
|
||||
|
||||
if settings.QUICKEDIT:
|
||||
|
||||
Reference in New Issue
Block a user