Merge branch 'master' into feature/bk_forum_int
This commit is contained in:
@@ -80,8 +80,8 @@ def course_wiki_redirect(request, course_id):
|
||||
urlpath = URLPath.create_article(
|
||||
root,
|
||||
course_slug,
|
||||
title=course.title,
|
||||
content="This is the wiki for " + course.title + ".",
|
||||
title=course.number,
|
||||
content="{0}\n===\nThis is the wiki for **{1}**'s _{2}_.".format(course.number, course.org, course.title),
|
||||
user_message="Course page automatically created.",
|
||||
user=None,
|
||||
ip_address=None,
|
||||
|
||||
@@ -155,8 +155,18 @@ def progress_summary(student, course, grader, student_module_cache):
|
||||
chapters = []
|
||||
# Don't include chapters that aren't displayable (e.g. due to error)
|
||||
for c in course.get_display_items():
|
||||
# Skip if the chapter is hidden
|
||||
hidden = c.metadata.get('hide_from_toc','false')
|
||||
if hidden.lower() == 'true':
|
||||
continue
|
||||
|
||||
sections = []
|
||||
for s in c.get_display_items():
|
||||
# Skip if the section is hidden
|
||||
hidden = s.metadata.get('hide_from_toc','false')
|
||||
if hidden.lower() == 'true':
|
||||
continue
|
||||
|
||||
# Same for sections
|
||||
graded = s.metadata.get('graded', False)
|
||||
scores = []
|
||||
|
||||
@@ -39,7 +39,7 @@ def update_template_dictionary(dictionary, request=None, course=None, article=No
|
||||
if course:
|
||||
dictionary['course'] = course
|
||||
if 'namespace' not in dictionary:
|
||||
dictionary['namespace'] = course.wiki_namespace
|
||||
dictionary['namespace'] = "edX"
|
||||
else:
|
||||
dictionary['course'] = None
|
||||
|
||||
@@ -99,7 +99,7 @@ def root_redirect(request, course_id=None):
|
||||
course = get_opt_course_with_access(request.user, course_id, 'load')
|
||||
|
||||
#TODO: Add a default namespace to settings.
|
||||
namespace = course.wiki_namespace if course else "edX"
|
||||
namespace = "edX"
|
||||
|
||||
try:
|
||||
root = Article.get_root(namespace)
|
||||
@@ -479,7 +479,7 @@ def not_found(request, article_path, course):
|
||||
"""Generate a NOT FOUND message for some URL"""
|
||||
d = {'wiki_err_notfound': True,
|
||||
'article_path': article_path,
|
||||
'namespace': course.wiki_namespace}
|
||||
'namespace': "edX"}
|
||||
update_template_dictionary(d, request, course)
|
||||
return render_to_response('simplewiki/simplewiki_error.html', d)
|
||||
|
||||
|
||||
@@ -304,6 +304,7 @@ SIMPLE_WIKI_REQUIRE_LOGIN_VIEW = False
|
||||
################################# WIKI ###################################
|
||||
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
|
||||
|
||||
################################# Jasmine ###################################
|
||||
JASMINE_TEST_DIRECTORY = PROJECT_ROOT + '/static/coffee'
|
||||
|
||||
@@ -84,11 +84,17 @@ DATABASES = {
|
||||
'ENGINE': 'django.db.backends.sqlite3',
|
||||
'NAME': ENV_ROOT / "db" / "course1.db",
|
||||
},
|
||||
|
||||
|
||||
'edx/full/6.002_Spring_2012': {
|
||||
'ENGINE': 'django.db.backends.sqlite3',
|
||||
'NAME': ENV_ROOT / "db" / "course2.db",
|
||||
}
|
||||
},
|
||||
|
||||
'edX/toy/TT_2012_Fall': {
|
||||
'ENGINE': 'django.db.backends.sqlite3',
|
||||
'NAME': ENV_ROOT / "db" / "course3.db",
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
CACHES = {
|
||||
|
||||
@@ -59,8 +59,8 @@
|
||||
<div id="course-errors">
|
||||
<ul>
|
||||
% for (msg, err) in course_errors:
|
||||
<li>${msg}
|
||||
<ul><li><pre>${err}</pre></li></ul>
|
||||
<li>${msg | h}
|
||||
<ul><li><pre>${err | h}</pre></li></ul>
|
||||
</li>
|
||||
% endfor
|
||||
</ul>
|
||||
|
||||
@@ -69,6 +69,7 @@ ${"Edit " + wiki_title + " - " if wiki_title is not UNDEFINED else ""}MITx 6.002
|
||||
%else:
|
||||
<input type="submit" id="submit_edit" name="edit" value="Save Changes" />
|
||||
<input type="submit" id="submit_delete" name="delete" value="Delete article" />
|
||||
%endif
|
||||
|
||||
<%include file="simplewiki_instructions.html"/>
|
||||
|
||||
|
||||
@@ -52,6 +52,9 @@
|
||||
</style>
|
||||
{% endaddtoblock %}
|
||||
|
||||
<p class="lead">
|
||||
{% trans "Click each revision to see a list of edited lines. Click the Preview button to see how the article looked at this stage. At the bottom of this page, you can change to a particular revision or merge an old revision with the current one." %}
|
||||
</p>
|
||||
|
||||
<form method="GET">
|
||||
<div class="tab-content" style="overflow: visible;">
|
||||
@@ -60,20 +63,14 @@
|
||||
<div class="accordion-group">
|
||||
<div class="accordion-heading">
|
||||
<a class="accordion-toggle" style="float: left;" href="#collapse{{ revision.revision_number }}" onclick="get_diff_json('{% url 'wiki:diff' revision.id %}', $('#collapse{{ revision.revision_number }}'))">
|
||||
{{ revision.created }} (#{{ revision.revision_number }}) by {% if revision.user %}{{ revision.user }}{% else %}{% if user|is_moderator %}{{ revision.ip_address|default:"anonymous (IP not logged)" }}{% else %}{% trans "anonymous (IP logged)" %}{% endif %}{% endif %}
|
||||
{% if revision == article.current_revision %}
|
||||
<strong>*</strong>
|
||||
{% endif %}
|
||||
{% if revision.deleted %}
|
||||
<span class="badge badge-important">{% trans "deleted" %}</span>
|
||||
{% endif %}
|
||||
{% if revision.previous_revision.deleted and not revision.deleted %}
|
||||
<span class="badge badge-success">{% trans "restored" %}</span>
|
||||
{% endif %}
|
||||
<span class="icon-plus"></span>
|
||||
{% include "wiki/includes/revision_info.html" with current_revision=article.current_revision %}
|
||||
<div style="color: #CCC;">
|
||||
<small>
|
||||
{% if revision.user_message %}
|
||||
{{ revision.user_message }}
|
||||
{% elif revision.automatic_log %}
|
||||
{{ revision.automatic_log }}
|
||||
{% else %}
|
||||
({% trans "no log message" %})
|
||||
{% endif %}
|
||||
@@ -84,21 +81,12 @@
|
||||
<div class="bar" style="width: 100%;"></div>
|
||||
</div>
|
||||
<div class="pull-right" style="vertical-align: middle; margin: 8px 3px;">
|
||||
{% if revision == article.current_revision %}
|
||||
<a href="#" class="btn disabled">
|
||||
<span class="icon-lock"></span>
|
||||
{% trans "Preview this version" %}
|
||||
</a>
|
||||
{% else %}
|
||||
{% if not revision == article.current_revision %}
|
||||
<button type="submit" class="btn" onclick="$('#previewModal').modal('show'); this.form.target='previewWindow'; this.form.r.value='{{ revision.id }}'; this.form.action='{% url 'wiki:preview_revision' article.id %}'; $('#previewModal .switch-to-revision').attr('href', '{% url 'wiki:change_revision' path=urlpath.path article_id=article.id revision_id=revision.id %}')">
|
||||
<span class="icon-eye-open"></span>
|
||||
{% trans "Preview this version" %}
|
||||
{% trans "Preview this revision" %}
|
||||
</button>
|
||||
{% endif %}
|
||||
<a class="btn btn-info" href="#collapse{{ revision.revision_number }}" onclick="get_diff_json('{% url 'wiki:diff' revision_id=revision.id %}', $('#collapse{{ revision.revision_number }}'))">
|
||||
<span class="icon-list-alt"></span>
|
||||
{% trans "Show changes" %}
|
||||
</a>
|
||||
|
||||
{% if article|can_write:user %}
|
||||
<input type="radio"{% if revision == article.current_revision %} disabled="true"{% endif %} style="margin: 0 10px;" value="{{ revision.id }}" name="revision_id" switch-button-href="{% url 'wiki:change_revision' path=urlpath.path revision_id=revision.id %}" merge-button-href="{% url 'wiki:merge_revision_preview' article_id=article.id revision_id=revision.id %}" merge-button-commit-href="{% url 'wiki:merge_revision' path=urlpath.path article_id=article.id revision_id=revision.id %}" />
|
||||
@@ -157,7 +145,7 @@
|
||||
<input type="hidden" name="r" value="" />
|
||||
<div class="modal hide fade" id="previewModal">
|
||||
<div class="modal-body">
|
||||
<iframe name="previewWindow" frameborder="0"></iframe>
|
||||
<iframe name="previewWindow"></iframe>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<a href="#" class="btn btn-large" data-dismiss="modal">
|
||||
@@ -184,7 +172,7 @@
|
||||
<p class="lead"><span class="icon-info-sign"></span> {% trans "When you merge a revision with the current, all data will be retained from both versions and merged at its approximate location from each revision." %} <strong>{% trans "After this, it's important to do a manual review." %}</strong></p>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<iframe name="mergeWindow" frameborder="0"></iframe>
|
||||
<iframe name="mergeWindow"></iframe>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<a href="#" class="btn btn-large" data-dismiss="modal">
|
||||
|
||||
@@ -1,52 +1,38 @@
|
||||
{% load i18n %}{% load url from future %}
|
||||
{% if urlpath %}
|
||||
## mako
|
||||
<%! from django.core.urlresolvers import reverse %>
|
||||
|
||||
%if urlpath is not Undefined and urlpath:
|
||||
<header>
|
||||
<ul class="breadcrumb pull-left" class="">
|
||||
{% for ancestor in urlpath.get_ancestors.all %}
|
||||
<li><a href="{% url 'wiki:get' path=ancestor.path %}">{{ ancestor.article.current_revision.title }}</a></li>
|
||||
{% endfor %}
|
||||
<li class="active"><a href="{% url 'wiki:get' path=urlpath.path %}">{{ article.current_revision.title }}</a></li>
|
||||
<%
|
||||
# The create button links to the highest ancestor we have edit priveleges to
|
||||
create_article_root = None
|
||||
%>
|
||||
%for ancestor in urlpath.cached_ancestors:
|
||||
<li><a href="${reverse('wiki:get', kwargs={'path' : ancestor.path})}">${ancestor.article.current_revision.title}</a></li>
|
||||
<%
|
||||
if not create_article_root and ancestor.article.can_write(user):
|
||||
create_article_root = ancestor
|
||||
%>
|
||||
%endfor
|
||||
<li class="active"><a href="${reverse('wiki:get', kwargs={'path' : urlpath.path})}">${article.current_revision.title}</a></li>
|
||||
<%
|
||||
if not create_article_root and urlpath.article.can_write(user):
|
||||
create_article_root = urlpath
|
||||
%>
|
||||
</ul>
|
||||
|
||||
|
||||
<div class="pull-left" style="margin-left: 10px;">
|
||||
<div class="btn-group">
|
||||
<a class="btn dropdown-toggle" data-toggle="dropdown" href="#" style="padding: 7px;" title="{% trans "Sub-articles for" %} {{ article.current_revision.title }}">
|
||||
<span class="icon-list"></span>
|
||||
<span class="caret"></span>
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
{% for child in children_slice %}
|
||||
<li>
|
||||
<a href="{% url 'wiki:get' path=child.path %}">
|
||||
{{ child.article.current_revision.title }}
|
||||
</a>
|
||||
</li>
|
||||
{% empty %}
|
||||
<li><a href="#"><em>{% trans "No sub-articles" %}</em></a></li>
|
||||
{% endfor %}
|
||||
{% if children_slice_more %}
|
||||
<li><a href="#"><em>{% trans "...and more" %}</em></a></li>
|
||||
{% endif %}
|
||||
<li class="divider"></li>
|
||||
<li>
|
||||
<a href="" onclick="alert('TODO')">{% trans "List sub-pages" %} »</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="global-functions pull-right">
|
||||
<form class="search-wiki pull-left">
|
||||
<!-- <form class="search-wiki pull-left">
|
||||
<input type="search" placeholder="search wiki" />
|
||||
</form>
|
||||
<a class="add-article-btn btn pull-left" href="{% url 'wiki:create' path=urlpath.path %}" style="padding: 7px;">
|
||||
</form> -->
|
||||
%if create_article_root:
|
||||
<a class="add-article-btn btn pull-left" href="${reverse('wiki:create', kwargs={'path' : create_article_root.path})}" style="padding: 7px;">
|
||||
<span class="icon-plus"></span>
|
||||
{% trans "Add article" %}
|
||||
Add article
|
||||
</a>
|
||||
%endif
|
||||
</div>
|
||||
</header>
|
||||
|
||||
{% endif %}
|
||||
%endif
|
||||
|
||||
18
lms/templates/wiki/wiki-404.html
Normal file
18
lms/templates/wiki/wiki-404.html
Normal file
@@ -0,0 +1,18 @@
|
||||
{% 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 %}
|
||||
|
||||
<div class="missing-wrapper">
|
||||
<p>This article was not found, and neither was the parent. <a href="#">Go back to the main wiki article.</a></p>
|
||||
<button type="submit">Create a new article</button>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
@@ -1,6 +1,5 @@
|
||||
-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@c145596#egg=django-wiki
|
||||
-e git://github.com/dementrock/pystache_custom.git#egg=pystache_custom
|
||||
-e git://github.com/benjaoming/django-wiki.git@e237b2ac#egg=django-wiki
|
||||
-e common/lib/capa
|
||||
-e common/lib/xmodule
|
||||
|
||||
Reference in New Issue
Block a user