From d8a1b5d574787bb5c3dfa6770a8cd538676586f8 Mon Sep 17 00:00:00 2001 From: Arjun Singh Date: Wed, 8 Aug 2012 02:55:32 -0400 Subject: [PATCH 01/60] adding some styling so that the syllabus lists display reasonably --- lms/static/sass/multicourse/_course_about.scss | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lms/static/sass/multicourse/_course_about.scss b/lms/static/sass/multicourse/_course_about.scss index fcf4382109..92d19dff86 100644 --- a/lms/static/sass/multicourse/_course_about.scss +++ b/lms/static/sass/multicourse/_course_about.scss @@ -274,6 +274,17 @@ } } } + + .prerequisites, .syllabus { + ul { + li { + font: normal 1em/1.6em $serif; + } + ul { + margin: 5px 0px 10px; + } + } + } .faq { @include clearfix; From 7dd7de9566c8c7688319c401a6395be3cb1ab8ab Mon Sep 17 00:00:00 2001 From: ichuang Date: Fri, 17 Aug 2012 15:57:12 +0000 Subject: [PATCH 02/60] add gitreload to lms migration, so it doesn't have to run separately --- lms/djangoapps/lms_migration/migrate.py | 84 ++++++++++++++++++++++++- lms/urls.py | 2 + 2 files changed, 83 insertions(+), 3 deletions(-) diff --git a/lms/djangoapps/lms_migration/migrate.py b/lms/djangoapps/lms_migration/migrate.py index dfdf86b4ac..6b9d01c81c 100644 --- a/lms/djangoapps/lms_migration/migrate.py +++ b/lms/djangoapps/lms_migration/migrate.py @@ -2,13 +2,21 @@ # migration tools for content team to go from stable-edx4edx to LMS+CMS # +import json import logging +import os from pprint import pprint import xmodule.modulestore.django as xmodule_django from xmodule.modulestore.django import modulestore from django.http import HttpResponse from django.conf import settings +import track.views + +try: + from django.views.decorators.csrf import csrf_exempt +except ImportError: + from django.contrib.csrf.middleware import csrf_exempt log = logging.getLogger("mitx.lms_migrate") LOCAL_DEBUG = True @@ -18,6 +26,15 @@ def escape(s): """escape HTML special characters in string""" return str(s).replace('<','<').replace('>','>') +def getip(request): + ''' + Extract IP address of requester from header, even if behind proxy + ''' + ip = request.META.get('HTTP_X_REAL_IP','') # nginx reverse proxy + if not ip: + ip = request.META.get('REMOTE_ADDR','None') + return ip + def manage_modulestores(request,reload_dir=None): ''' Manage the static in-memory modulestores. @@ -32,9 +49,7 @@ def manage_modulestores(request,reload_dir=None): #---------------------------------------- # check on IP address of requester - ip = request.META.get('HTTP_X_REAL_IP','') # nginx reverse proxy - if not ip: - ip = request.META.get('REMOTE_ADDR','None') + ip = getip(request) if LOCAL_DEBUG: html += '

IP address: %s ' % ip @@ -108,3 +123,66 @@ def manage_modulestores(request,reload_dir=None): html += "" return HttpResponse(html) + +@csrf_exempt +def gitreload(request, reload_dir=None): + ''' + This can be used as a github WebHook Service Hook, for reloading of the content repo used by the LMS. + + If reload_dir is not None, then instruct the xml loader to reload that course directory. + ''' + html = "" + ip = getip(request) + + html += '

IP address: %s ' % ip + html += '

User: %s ' % request.user + + ALLOWED_IPS = ['207.97.227.253', '50.57.128.197', '108.171.174.178'] # hardcoded to github + if hasattr(settings,'ALLOWED_GITRELOAD_IPS'): # allow override in settings + ALLOWED_IPS = ALLOWED_GITRELOAD_IPS + + if not (ip in ALLOWED_IPS or 'any' in ALLOWED_IPS): + if request.user and request.user.is_staff: + log.debug('request allowed because user=%s is staff' % request.user) + else: + html += 'Permission denied' + html += "" + log.debug('request denied from %s, ALLOWED_IPS=%s' % (ip,ALLOWED_IPS)) + return HttpResponse(html) + + #---------------------------------------- + # see if request is from github (POST with JSON) + + if reload_dir is None and 'payload' in request.POST: + payload = request.POST['payload'] + log.debug("payload=%s" % payload) + gitargs = json.loads(payload) + log.debug("gitargs=%s" % gitargs) + reload_dir = gitargs['repository']['name'] + log.debug("github reload_dir=%s" % reload_dir) + gdir = settings.DATA_DIR / reload_dir + if not os.path.exists(gdir): + log.debug("====> ERROR in gitreload - no such directory %s" % reload_dir) + return HttpResponse('Error') + cmd = "cd %s; git reset --hard HEAD; git clean -f -d; git pull origin; chmod g+w course.xml" % gdir + log.debug(os.popen(cmd).read()) + if hasattr(settings,'GITRELOAD_HOOK'): # hit this hook after reload, if set + gh = settings.GITRELOAD_HOOK + if gh: + ghurl = '%s/%s' % (gh,reload_dir) + r = requests.get(ghurl) + log.debug("GITRELOAD_HOOK to %s: %s" % (ghurl, r.text)) + + #---------------------------------------- + # reload course if specified + + if reload_dir is not None: + def_ms = modulestore() + if reload_dir not in def_ms.courses: + html += "

Error: '%s' is not a valid course directory

" % reload_dir + else: + html += "

Reloaded course directory '%s'

" % reload_dir + def_ms.try_load_course(reload_dir) + track.views.server_track(request, 'reloaded %s' % reload_dir, {}, page='migrate') + + return HttpResponse(html) diff --git a/lms/urls.py b/lms/urls.py index 89ef4babc4..1ed04d1a07 100644 --- a/lms/urls.py +++ b/lms/urls.py @@ -204,6 +204,8 @@ if settings.MITX_FEATURES.get('ENABLE_LMS_MIGRATION'): urlpatterns += ( url(r'^migrate/modules$', 'lms_migration.migrate.manage_modulestores'), url(r'^migrate/reload/(?P[^/]+)$', 'lms_migration.migrate.manage_modulestores'), + url(r'^gitreload$', 'lms_migration.migrate.gitreload'), + url(r'^gitreload/(?P[^/]+)$', 'lms_migration.migrate.gitreload'), ) if settings.MITX_FEATURES.get('ENABLE_SQL_TRACKING_LOGS'): From 4365b4a092faa5d90cb22022132bb41e61ebf09b Mon Sep 17 00:00:00 2001 From: ichuang Date: Fri, 17 Aug 2012 16:17:00 +0000 Subject: [PATCH 03/60] more flexible event logs retrieval --- common/djangoapps/track/views.py | 18 +++++++++++++++--- lms/urls.py | 1 + 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/common/djangoapps/track/views.py b/common/djangoapps/track/views.py index b5f9c54665..910ed25d4b 100644 --- a/common/djangoapps/track/views.py +++ b/common/djangoapps/track/views.py @@ -84,15 +84,27 @@ def server_track(request, event_type, event, page=None): "time": datetime.datetime.utcnow().isoformat(), } - if event_type=="/event_logs" and request.user.is_staff: # don't log + if event_type.startswith("/event_logs") and request.user.is_staff: # don't log return log_event(event) @login_required @ensure_csrf_cookie -def view_tracking_log(request): +def view_tracking_log(request,args=''): if not request.user.is_staff: return redirect('/') - record_instances = TrackingLog.objects.all().order_by('-time')[0:100] + nlen = 100 + username = '' + if args: + for arg in args.split('/'): + if arg.isdigit(): + nlen = int(arg) + if arg.startswith('username='): + username = arg[9:] + + record_instances = TrackingLog.objects.all().order_by('-time') + if username: + record_instances = record_instances.filter(username=username) + record_instances = record_instances[0:nlen] return render_to_response('tracking_log.html',{'records':record_instances}) diff --git a/lms/urls.py b/lms/urls.py index 1ed04d1a07..776f08b49a 100644 --- a/lms/urls.py +++ b/lms/urls.py @@ -211,6 +211,7 @@ if settings.MITX_FEATURES.get('ENABLE_LMS_MIGRATION'): if settings.MITX_FEATURES.get('ENABLE_SQL_TRACKING_LOGS'): urlpatterns += ( url(r'^event_logs$', 'track.views.view_tracking_log'), + url(r'^event_logs/(?P.+)$', 'track.views.view_tracking_log'), ) urlpatterns = patterns(*urlpatterns) From a6c6d0f4d14836aa8bc528b5305eefc91f50a496 Mon Sep 17 00:00:00 2001 From: ichuang Date: Fri, 17 Aug 2012 14:49:59 -0400 Subject: [PATCH 04/60] MITX_FEATURES['USE_DJANGO_PIPELINE']=False in dev_ike by default --- lms/envs/dev_ike.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lms/envs/dev_ike.py b/lms/envs/dev_ike.py index 309ea1ac42..a9bd3ef97c 100644 --- a/lms/envs/dev_ike.py +++ b/lms/envs/dev_ike.py @@ -17,6 +17,9 @@ MITX_FEATURES['ENABLE_TEXTBOOK'] = False MITX_FEATURES['ENABLE_DISCUSSION'] = False MITX_FEATURES['ACCESS_REQUIRE_STAFF_FOR_COURSE'] = True # require that user be in the staff_* group to be able to enroll +MITX_FEATURES['DISABLE_START_DATES'] = True +MITX_FEATURES['USE_DJANGO_PIPELINE']=False # don't recompile scss + myhost = socket.gethostname() if ('edxvm' in myhost) or ('ocw' in myhost): MITX_FEATURES['DISABLE_LOGIN_BUTTON'] = True # auto-login with MIT certificate @@ -33,4 +36,9 @@ SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTOCOL', 'https') # django 1.4 fo INSTALLED_APPS = tuple([ app for app in INSTALLED_APPS if not app.startswith('debug_toolbar') ]) MIDDLEWARE_CLASSES = tuple([ mcl for mcl in MIDDLEWARE_CLASSES if not mcl.startswith('debug_toolbar') ]) -TEMPLATE_LOADERS = tuple([ app for app in TEMPLATE_LOADERS if not app.startswith('askbot') ]) +#TEMPLATE_LOADERS = tuple([ app for app in TEMPLATE_LOADERS if not app.startswith('askbot') ]) +#TEMPLATE_LOADERS = tuple([ app for app in TEMPLATE_LOADERS if not app.startswith('mitxmako') ]) +TEMPLATE_LOADERS = ( + 'django.template.loaders.filesystem.Loader', + 'django.template.loaders.app_directories.Loader', + ) From f7d4831939dc70e8afe7a51e38e332042b7a5641 Mon Sep 17 00:00:00 2001 From: ichuang Date: Fri, 17 Aug 2012 15:20:19 -0400 Subject: [PATCH 05/60] update utility scripts for djang-1.4; will make them management cmds later --- utility-scripts/create_groups.py | 13 +++-- utility-scripts/create_user.py | 12 +++-- utility-scripts/manage_class_groups.py | 74 ++++++++++++++++++++++++++ 3 files changed, 89 insertions(+), 10 deletions(-) create mode 100644 utility-scripts/manage_class_groups.py diff --git a/utility-scripts/create_groups.py b/utility-scripts/create_groups.py index 0e3245bb4d..8108498cb8 100644 --- a/utility-scripts/create_groups.py +++ b/utility-scripts/create_groups.py @@ -9,17 +9,20 @@ import os, sys, string, re sys.path.append(os.path.abspath('.')) os.environ['DJANGO_SETTINGS_MODULE'] = 'lms.envs.dev' -try: - from lms.envs.dev import * -except Exception as err: - print "Run this script from the top-level mitx directory (mitx_all/mitx), not a subdirectory." - sys.exit(-1) +#try: +# from lms.envs.dev import * +#except Exception as err: +# print "Run this script from the top-level mitx directory (mitx_all/mitx), not a subdirectory." +# sys.exit(-1) from django.conf import settings from django.contrib.auth.models import User, Group from path import path from lxml import etree +print "configured=",settings.configured +print settings.SETTINGS_MODULE + data_dir = settings.DATA_DIR print "data_dir = %s" % data_dir diff --git a/utility-scripts/create_user.py b/utility-scripts/create_user.py index 3ce9ce0ecf..5a52baff34 100644 --- a/utility-scripts/create_user.py +++ b/utility-scripts/create_user.py @@ -13,11 +13,13 @@ import readline sys.path.append(os.path.abspath('.')) os.environ['DJANGO_SETTINGS_MODULE'] = 'lms.envs.dev' -try: - from lms.envs.dev import * -except Exception as err: - print "Run this script from the top-level mitx directory (mitx_all/mitx), not a subdirectory." - sys.exit(-1) +#try: +# from lms.envs.dev import * +#except Exception as err: +# print "Run this script from the top-level mitx directory (mitx_all/mitx), not a subdirectory." +# sys.exit(-1) + +sys.path.append(os.path.abspath('common/djangoapps')) from student.models import UserProfile, Registration from external_auth.models import ExternalAuthMap diff --git a/utility-scripts/manage_class_groups.py b/utility-scripts/manage_class_groups.py new file mode 100644 index 0000000000..a21ec9151e --- /dev/null +++ b/utility-scripts/manage_class_groups.py @@ -0,0 +1,74 @@ +#!/usr/bin/python +# +# File: manage_class_groups +# +# list and edit membership in class staff group + +import os, sys, string, re +import datetime +from getpass import getpass +import json +import readline + +sys.path.append(os.path.abspath('.')) +os.environ['DJANGO_SETTINGS_MODULE'] = 'lms.envs.dev' + +#try: +# from lms.envs.dev import * +#except Exception as err: +# print "Run this script from the top-level mitx directory (mitx_all/mitx), not a subdirectory." +# sys.exit(-1) + +from django.conf import settings +from django.contrib.auth.models import User, Group + +#----------------------------------------------------------------------------- +# get all staff groups + +gset = Group.objects.all() + +print "Groups:" +for cnt,g in zip(range(len(gset)), gset): + print "%d. %s" % (cnt,g) + +gnum = int(raw_input('Choose group to manage (enter #): ')) + +group = gset[gnum] + +#----------------------------------------------------------------------------- +# users in group + +uall = User.objects.all() +print "----" +print "List of All Users: %s" % [str(x.username) for x in uall] +print "----" + +while True: + + print "Users in the group:" + + uset = group.user_set.all() + for cnt, u in zip(range(len(uset)), uset): + print "%d. %s" % (cnt, u) + + action = raw_input('Choose user to delete (enter #) or enter usernames (comma delim) to add: ') + + m = re.match('^[0-9]+$',action) + if m: + unum = int(action) + u = uset[unum] + print "Deleting user %s" % u + u.groups.remove(group) + + else: + for uname in action.split(','): + try: + user = User.objects.get(username=action) + except Exception as err: + print "Error %s" % err + continue + print "adding %s to group %s" % (user, group) + user.groups.add(group) + + + From b6e41dc05c56761acdd2e9c84b492e5027674de3 Mon Sep 17 00:00:00 2001 From: ichuang Date: Fri, 17 Aug 2012 15:46:09 -0400 Subject: [PATCH 06/60] fix view_tracking_log to show proper timezone --- common/djangoapps/track/views.py | 7 +++++++ lms/templates/tracking_log.html | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/common/djangoapps/track/views.py b/common/djangoapps/track/views.py index 910ed25d4b..434e75a63f 100644 --- a/common/djangoapps/track/views.py +++ b/common/djangoapps/track/views.py @@ -1,6 +1,7 @@ import json import logging import os +import pytz import datetime import dateutil.parser @@ -106,5 +107,11 @@ def view_tracking_log(request,args=''): if username: record_instances = record_instances.filter(username=username) record_instances = record_instances[0:nlen] + + # fix dtstamp + fmt = '%a %d-%b-%y %H:%M:%S' # "%Y-%m-%d %H:%M:%S %Z%z" + for rinst in record_instances: + rinst.dtstr = rinst.time.replace(tzinfo=pytz.utc).astimezone(pytz.timezone('US/Eastern')).strftime(fmt) + return render_to_response('tracking_log.html',{'records':record_instances}) diff --git a/lms/templates/tracking_log.html b/lms/templates/tracking_log.html index 66d375c2f3..24b249a583 100644 --- a/lms/templates/tracking_log.html +++ b/lms/templates/tracking_log.html @@ -3,7 +3,7 @@ % for rec in records: - + From 38a9631659ff754b73ea580c86f98ab1ae133406 Mon Sep 17 00:00:00 2001 From: Bridger Maxwell Date: Sun, 19 Aug 2012 17:37:58 -0400 Subject: [PATCH 07/60] Updated to use django-wiki with significantly less sql queries. --- lms/envs/common.py | 1 + lms/templates/wiki/includes/breadcrumbs.html | 2 +- requirements.txt | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lms/envs/common.py b/lms/envs/common.py index 94c39d2f81..cda3a5a8b1 100644 --- a/lms/envs/common.py +++ b/lms/envs/common.py @@ -301,6 +301,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' diff --git a/lms/templates/wiki/includes/breadcrumbs.html b/lms/templates/wiki/includes/breadcrumbs.html index 6afe248a29..6eb4a1eb89 100644 --- a/lms/templates/wiki/includes/breadcrumbs.html +++ b/lms/templates/wiki/includes/breadcrumbs.html @@ -3,7 +3,7 @@
-
+ %if create_article_root: From adbe71b5df47d825591032ec6c7c499ca65da666 Mon Sep 17 00:00:00 2001 From: Bridger Maxwell Date: Sun, 19 Aug 2012 19:57:19 -0400 Subject: [PATCH 10/60] Got simplewiki just cleaned up enough to work again, so I could view a page for reference. --- lms/djangoapps/simplewiki/views.py | 6 +++--- lms/templates/simplewiki/simplewiki_edit.html | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lms/djangoapps/simplewiki/views.py b/lms/djangoapps/simplewiki/views.py index ac807b13ed..ef0928709f 100644 --- a/lms/djangoapps/simplewiki/views.py +++ b/lms/djangoapps/simplewiki/views.py @@ -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) diff --git a/lms/templates/simplewiki/simplewiki_edit.html b/lms/templates/simplewiki/simplewiki_edit.html index 856dfb9cc8..0381a21857 100644 --- a/lms/templates/simplewiki/simplewiki_edit.html +++ b/lms/templates/simplewiki/simplewiki_edit.html @@ -69,6 +69,7 @@ ${"Edit " + wiki_title + " - " if wiki_title is not UNDEFINED else ""}MITx 6.002 %else: + %endif <%include file="simplewiki_instructions.html"/> From 3cb677f0e6373edb5798ce9c24a2f1e00f80280a Mon Sep 17 00:00:00 2001 From: Bridger Maxwell Date: Sun, 19 Aug 2012 21:19:08 -0400 Subject: [PATCH 11/60] Changed default title and content of course wiki page. --- lms/djangoapps/course_wiki/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lms/djangoapps/course_wiki/views.py b/lms/djangoapps/course_wiki/views.py index b1d9f1cf26..cfe802bbd7 100644 --- a/lms/djangoapps/course_wiki/views.py +++ b/lms/djangoapps/course_wiki/views.py @@ -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, From b23bfc75bc33fbe0c3d589f8e8d259c5799a5ab2 Mon Sep 17 00:00:00 2001 From: ichuang Date: Sun, 19 Aug 2012 23:18:06 -0400 Subject: [PATCH 12/60] additional minor change: allow "inline" attrib on textline --- common/lib/capa/capa/inputtypes.py | 4 +++- common/lib/capa/capa/templates/textinput.html | 12 ++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/common/lib/capa/capa/inputtypes.py b/common/lib/capa/capa/inputtypes.py index 8c513e7aec..9de0a52e15 100644 --- a/common/lib/capa/capa/inputtypes.py +++ b/common/lib/capa/capa/inputtypes.py @@ -293,7 +293,9 @@ def textline(element, value, status, render_template, msg=""): hidden = element.get('hidden', '') # if specified, then textline is hidden and id is stored in div of name given by hidden escapedict = {'"': '"'} value = saxutils.escape(value, escapedict) # otherwise, answers with quotes in them crashes the system! - context = {'id': eid, 'value': value, 'state': status, 'count': count, 'size': size, 'msg': msg, 'hidden': hidden} + context = {'id': eid, 'value': value, 'state': status, 'count': count, 'size': size, 'msg': msg, 'hidden': hidden, + 'inline': element.get('inline',''), + } html = render_template("textinput.html", context) try: xhtml = etree.XML(html) diff --git a/common/lib/capa/capa/templates/textinput.html b/common/lib/capa/capa/templates/textinput.html index 08aa8379a7..814517d11c 100644 --- a/common/lib/capa/capa/templates/textinput.html +++ b/common/lib/capa/capa/templates/textinput.html @@ -1,6 +1,14 @@ -
+
% if state == 'unsubmitted': -
+
% elif state == 'correct':
% elif state == 'incorrect': From 660c35f63eecf84fe329d26ec3493663494b7be4 Mon Sep 17 00:00:00 2001 From: ichuang Date: Mon, 20 Aug 2012 00:19:28 -0400 Subject: [PATCH 13/60] additional changes to make inline textinput work properly --- common/lib/capa/capa/templates/textinput.html | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/common/lib/capa/capa/templates/textinput.html b/common/lib/capa/capa/templates/textinput.html index 814517d11c..63c0609107 100644 --- a/common/lib/capa/capa/templates/textinput.html +++ b/common/lib/capa/capa/templates/textinput.html @@ -10,11 +10,23 @@ % endif > % elif state == 'correct': -
+
% elif state == 'incorrect': -
+
% elif state == 'incomplete': -
+
% endif % if hidden:
From 46d2e71ac1236ccb7b75400352c51664d32b588a Mon Sep 17 00:00:00 2001 From: Bridger Maxwell Date: Mon, 20 Aug 2012 16:24:12 -0400 Subject: [PATCH 14/60] Fixed bug in breadcrumbs. --- lms/templates/wiki/includes/breadcrumbs.html | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lms/templates/wiki/includes/breadcrumbs.html b/lms/templates/wiki/includes/breadcrumbs.html index 6fe955212e..053bc2400e 100644 --- a/lms/templates/wiki/includes/breadcrumbs.html +++ b/lms/templates/wiki/includes/breadcrumbs.html @@ -16,6 +16,10 @@ %> %endfor
  • ${article.current_revision.title}
  • + <% + if not create_article_root and urlpath.article.can_write(user): + create_article_root = urlpath + %>
    From 8543f25358b2c56ba57c2f0eb0f5de3fcc13d41a Mon Sep 17 00:00:00 2001 From: Bridger Maxwell Date: Mon, 20 Aug 2012 16:51:39 -0400 Subject: [PATCH 15/60] Updated django-wiki version. --- repo-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/repo-requirements.txt b/repo-requirements.txt index 9dc4629b49..5b50034039 100644 --- a/repo-requirements.txt +++ b/repo-requirements.txt @@ -1,5 +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/benjaoming/django-wiki.git@e237b2ac#egg=django-wiki -e common/lib/capa -e common/lib/xmodule From c0c23baac5bb0a5da56a56359cd6b3104789f4bd Mon Sep 17 00:00:00 2001 From: Bridger Maxwell Date: Mon, 20 Aug 2012 17:23:39 -0400 Subject: [PATCH 16/60] Removed inactive 'view this revision' button from history page. --- lms/templates/wiki/history.html | 34 +++++++++++---------------------- 1 file changed, 11 insertions(+), 23 deletions(-) diff --git a/lms/templates/wiki/history.html b/lms/templates/wiki/history.html index 0c120d5c54..60fe0deade 100644 --- a/lms/templates/wiki/history.html +++ b/lms/templates/wiki/history.html @@ -52,6 +52,9 @@ {% endaddtoblock %} +

    + {% 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." %} +

    @@ -60,20 +63,14 @@
    - {{ 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 %} - * - {% endif %} - {% if revision.deleted %} - {% trans "deleted" %} - {% endif %} - {% if revision.previous_revision.deleted and not revision.deleted %} - {% trans "restored" %} - {% endif %} + + {% include "wiki/includes/revision_info.html" with current_revision=article.current_revision %}
    {% if revision.user_message %} {{ revision.user_message }} + {% elif revision.automatic_log %} + {{ revision.automatic_log }} {% else %} ({% trans "no log message" %}) {% endif %} @@ -84,21 +81,12 @@
    - {% if revision == article.current_revision %} - - - {% trans "Preview this version" %} - - {% else %} + {% if not revision == article.current_revision %} {% endif %} - - - {% trans "Show changes" %} - {% if article|can_write:user %} @@ -157,7 +145,7 @@
    datetimeusernameipaddrsourcetype
    ${rec.time}${rec.dtstr} ${rec.username} ${rec.ip} ${rec.event_source}