From fa4b587a0b1a1d2c3d0bb51c47d52c26b9edd497 Mon Sep 17 00:00:00 2001 From: Maxim Starodubcev Date: Thu, 23 Aug 2018 17:28:54 +0300 Subject: [PATCH] Change popup text and disable hide on blur --- lms/djangoapps/courseware/views/index.py | 6 ++++-- lms/templates/courseware/courseware.html | 10 +++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/lms/djangoapps/courseware/views/index.py b/lms/djangoapps/courseware/views/index.py index 26db810df351..4c2bbf6999d2 100644 --- a/lms/djangoapps/courseware/views/index.py +++ b/lms/djangoapps/courseware/views/index.py @@ -21,7 +21,7 @@ from django.views.decorators.csrf import ensure_csrf_cookie from django.views.generic import View from django.utils.translation import ugettext as _ -from opaque_keys.edx.keys import CourseKey +from opaque_keys.edx.keys import CourseKey, UsageKey from web_fragments.fragment import Fragment from edxmako.shortcuts import render_to_response, render_to_string @@ -597,7 +597,9 @@ def check_prerequisite(request, course_id): 'location': prereq[0], } ) - msg = _('Subsection blocked by this prerequisite.').format(url) + descriptor = modulestore().get_item(UsageKey.from_string(prereq[0])) + name = descriptor.display_name_with_default + msg = _('In order to proceed, you must successfully complete section "{}" first.').format(url, name) return JsonResponse({'next': False, 'msg': msg, 'url': url}) next_url = reverse( diff --git a/lms/templates/courseware/courseware.html b/lms/templates/courseware/courseware.html index 8c45246a803a..4a4c473b4448 100644 --- a/lms/templates/courseware/courseware.html +++ b/lms/templates/courseware/courseware.html @@ -277,10 +277,10 @@ } }); - $(window).focus(function() { - $("body").show(); - }).blur(function() { - $("body").hide(); - }); +// $(window).focus(function() { +// $("body").show(); +// }).blur(function() { +// $("body").hide(); +// }); });