def _section_send_email(course_key, access, course): """ Provide data for the corresponding bulk email section """ html_module = HtmlDescriptor( course.system, DictFieldData({'data': ''}), ScopeIds(None, None, None, course_key.make_usage_key('html', 'fake')) ) fragment = course.system.render(html_module, 'studio_view') fragment = wrap_xblock( 'LmsRuntime', html_module, 'studio_view', fragment, None, extra_data={"course-id": course_key.to_deprecated_string()}, usage_id_serializer=lambda usage_id: quote_slashes(usage_id.to_deprecated_string()) ) email_editor = fragment.content section_data = { 'section_key': 'send_email', 'section_display_name': _('Email'), 'access': access, 'send_email': reverse('send_email', kwargs={'course_id': course_key.to_deprecated_string()}), 'editor': email_editor, 'list_instructor_tasks_url': reverse( 'list_instructor_tasks', kwargs={'course_id': course_key.to_deprecated_string()} ), 'email_background_tasks_url': reverse( 'list_background_email_tasks', kwargs={'course_id': course_key.to_deprecated_string()} ), 'email_content_history_url': reverse( 'list_email_content', kwargs={'course_id': course_key.to_deprecated_string()} ), } return section_data
def _section_send_email(course_id, access, course): """ Provide data for the corresponding bulk email section """ html_module = HtmlDescriptor( course.system, DictFieldData({'data': ''}), 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) email_editor = fragment.content section_data = { 'section_key': 'send_email', 'section_display_name': _('Email'), 'access': access, 'send_email': reverse('send_email', kwargs={'course_id': course_id}), 'editor': email_editor, 'list_instructor_tasks_url': reverse('list_instructor_tasks', kwargs={'course_id': course_id}), 'email_background_tasks_url': reverse('list_background_email_tasks', kwargs={'course_id': course_id}), } return section_data
def _section_send_email(course_key, access, course): """ Provide data for the corresponding bulk email section """ # This HtmlDescriptor is only being used to generate a nice text editor. html_module = HtmlDescriptor( course.system, DictFieldData({'data': ''}), ScopeIds(None, None, None, course_key.make_usage_key('html', 'fake')) ) fragment = course.system.render(html_module, 'studio_view') fragment = wrap_xblock( 'LmsRuntime', html_module, 'studio_view', fragment, None, extra_data={"course-id": course_key.to_deprecated_string()}, usage_id_serializer=lambda usage_id: quote_slashes(usage_id.to_deprecated_string()), # Generate a new request_token here at random, because this module isn't connected to any other # xblock rendering. request_token=uuid.uuid1().get_hex() ) email_editor = fragment.content section_data = { 'section_key': 'send_email', 'section_display_name': _('Email'), 'access': access, 'send_email': reverse('send_email', kwargs={'course_id': course_key.to_deprecated_string()}), 'editor': email_editor, 'list_instructor_tasks_url': reverse( 'list_instructor_tasks', kwargs={'course_id': course_key.to_deprecated_string()} ), 'email_background_tasks_url': reverse( 'list_background_email_tasks', kwargs={'course_id': course_key.to_deprecated_string()} ), 'email_content_history_url': reverse( 'list_email_content', kwargs={'course_id': course_key.to_deprecated_string()} ), } return section_data
def _section_send_email(course_key, access, course): """ Provide data for the corresponding bulk email section """ html_module = HtmlDescriptor( course.system, DictFieldData({'data': ''}), ScopeIds(None, None, None, course_key.make_usage_key('html', 'fake')) ) fragment = course.system.render(html_module, 'studio_view') fragment = wrap_xblock( 'LmsRuntime', html_module, 'studio_view', fragment, None, extra_data={"course-id": course_key.to_deprecated_string()}, usage_id_serializer=lambda usage_id: quote_slashes(usage_id.to_deprecated_string()) ) email_editor = fragment.content section_data = { 'section_key': 'send_email', 'section_display_name': _('Email'), 'access': access, 'send_email': reverse('send_email', kwargs={'course_id': course_key.to_deprecated_string()}), 'editor': email_editor, 'list_instructor_tasks_url': reverse( 'list_instructor_tasks', kwargs={'course_id': course_key.to_deprecated_string()} ), 'email_background_tasks_url': reverse( 'list_background_email_tasks', kwargs={'course_id': course_key.to_deprecated_string()} ), } return section_data
def _section_send_email(course_id, access, course): """ Provide data for the corresponding bulk email section """ html_module = HtmlDescriptor(course.system, DictFieldData({'data': ''}), ScopeIds(None, None, None, None)) fragment = course.system.render(html_module, 'studio_view') fragment = wrap_xblock(html_module, 'studio_view', fragment, None) email_editor = fragment.content section_data = { 'section_key': 'send_email', 'section_display_name': _('Email'), 'access': access, 'send_email': reverse('send_email', kwargs={'course_id': course_id}), 'editor': email_editor } return section_data
def _section_send_email(course, access): """ Provide data for the corresponding bulk email section """ course_key = course.id queries = GroupedQuery.objects.filter(course_id=course_key) query_options = tuple( (query.id, query.title or u'Query saved at ' + query.created.strftime("%m-%d-%y %H:%M")) for query in queries ) # Monkey-patch applicable_aside_types to return no asides for the duration of this render with patch.object(course.runtime, 'applicable_aside_types', null_applicable_aside_types): # This HtmlDescriptor is only being used to generate a nice text editor. html_module = HtmlDescriptor( course.system, DictFieldData({'data': ''}), ScopeIds(None, None, None, course_key.make_usage_key('html', 'fake')) ) fragment = course.system.render(html_module, 'studio_view') fragment = wrap_xblock( 'LmsRuntime', html_module, 'studio_view', fragment, None, extra_data={"course-id": unicode(course_key)}, usage_id_serializer=lambda usage_id: quote_slashes(unicode(usage_id)), # Generate a new request_token here at random, because this module isn't connected to any other # xblock rendering. request_token=uuid.uuid1().get_hex() ) email_editor = fragment.content section_data = { 'section_key': 'send_email', 'section_display_name': _('Email'), 'keywords_supported': get_keywords_supported(), 'access': access, 'to_options': CourseEmail.TO_OPTION_CHOICES + query_options, 'send_email': reverse('send_email', kwargs={'course_id': unicode(course_key)}), 'editor': email_editor, 'list_instructor_tasks_url': reverse( 'list_instructor_tasks', kwargs={'course_id': unicode(course_key)} ), 'email_background_tasks_url': reverse( 'list_background_email_tasks', kwargs={'course_id': unicode(course_key)} ), 'email_content_history_url': reverse( 'list_email_content', kwargs={'course_id': unicode(course_key)} ), } return section_data
def _section_send_email(course_id, access, course): """ Provide data for the corresponding bulk email section """ html_module = HtmlDescriptor( course.system, DictFieldData({'data': ''}), ScopeIds(None, None, None, 'i4x://dummy_org/dummy_course/html/dummy_name') ) fragment = course.system.render(html_module, 'studio_view') 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', 'section_display_name': _('Email'), 'access': access, 'send_email': reverse('send_email', kwargs={'course_id': course_id}), 'editor': email_editor, 'list_instructor_tasks_url': reverse('list_instructor_tasks', kwargs={'course_id': course_id}), 'email_background_tasks_url': reverse('list_background_email_tasks', kwargs={'course_id': course_id}), } return section_data
def _section_send_email(course, access): """ Provide data for the corresponding bulk email section """ course_key = course.id # This HtmlDescriptor is only being used to generate a nice text editor. html_module = HtmlDescriptor( course.system, DictFieldData({"data": ""}), ScopeIds(None, None, None, course_key.make_usage_key("html", "fake")), ) fragment = course.system.render(html_module, "studio_view") fragment = wrap_xblock( "LmsRuntime", html_module, "studio_view", fragment, None, extra_data={"course-id": course_key.to_deprecated_string()}, usage_id_serializer=lambda usage_id: quote_slashes(usage_id.to_deprecated_string()), # Generate a new request_token here at random, because this module isn't connected to any other # xblock rendering. request_token=uuid.uuid1().get_hex(), ) email_editor = fragment.content section_data = { "section_key": "send_email", "section_display_name": _("Email"), "access": access, "send_email": reverse("send_email", kwargs={"course_id": course_key.to_deprecated_string()}), "editor": email_editor, "list_instructor_tasks_url": reverse( "list_instructor_tasks", kwargs={"course_id": course_key.to_deprecated_string()} ), "email_background_tasks_url": reverse( "list_background_email_tasks", kwargs={"course_id": course_key.to_deprecated_string()} ), "email_content_history_url": reverse( "list_email_content", kwargs={"course_id": course_key.to_deprecated_string()} ), } return section_data
def _section_send_email(course_id, access, course): """ Provide data for the corresponding bulk email section """ html_module = HtmlDescriptor( course.system, DictFieldData({"data": ""}), ScopeIds(None, None, None, "i4x://dummy_org/dummy_course/html/dummy_name"), ) fragment = course.system.render(html_module, "studio_view") 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", "section_display_name": _("Email"), "access": access, "send_email": reverse("send_email", kwargs={"course_id": course_id}), "editor": email_editor, "list_instructor_tasks_url": reverse("list_instructor_tasks", kwargs={"course_id": course_id}), "email_background_tasks_url": reverse("list_background_email_tasks", kwargs={"course_id": course_id}), } return section_data