Allow multiple client-side runtimes on a single page

Make XBlock client-side runtimes proper classes, so that handlerUrl can
be defined in a per-runtime way, and we can have multiple runtimes on a
single page.

[LMS-1630][LMS-1421][LMS-1517]
This commit is contained in:
Calen Pennington
2013-12-13 07:47:21 -05:00
parent 0f8919a6ba
commit 49217ebe8b
19 changed files with 122 additions and 124 deletions

View File

@@ -24,7 +24,6 @@ from django_comment_client.utils import has_forum_access
from django_comment_common.models import FORUM_ROLE_ADMINISTRATOR
from student.models import CourseEnrollment
from bulk_email.models import CourseAuthorization
from lms.lib.xblock.runtime import handler_prefix
from .tools import get_units_with_due_date, title_or_url
@@ -206,7 +205,7 @@ def _section_send_email(course_id, access, course):
ScopeIds(None, None, None, 'i4x://dummy_org/dummy_course/html/dummy_name')
)
fragment = course.system.render(html_module, 'studio_view')
fragment = wrap_xblock(partial(handler_prefix, course_id), html_module, 'studio_view', fragment, None)
fragment = wrap_xblock('LmsRuntime', html_module, 'studio_view', fragment, None, extra_data={"course-id": course_id})
email_editor = fragment.content
section_data = {
'section_key': 'send_email',

View File

@@ -61,7 +61,6 @@ import track.views
from xblock.field_data import DictFieldData
from xblock.fields import ScopeIds
from django.utils.translation import ugettext as _u
from lms.lib.xblock.runtime import handler_prefix
from microsite_configuration.middleware import MicrositeConfiguration
@@ -848,7 +847,7 @@ def instructor_dashboard(request, course_id):
ScopeIds(None, None, None, 'i4x://dummy_org/dummy_course/html/dummy_name')
)
fragment = html_module.render('studio_view')
fragment = wrap_xblock(partial(handler_prefix, course_id), html_module, 'studio_view', fragment, None)
fragment = wrap_xblock('LmsRuntime', html_module, 'studio_view', fragment, None, extra_data={"course-id": course_id})
email_editor = fragment.content
# Enable instructor email only if the following conditions are met: