diff --git a/cms/static/css/tiny-mce.css b/common/static/css/tiny-mce.css similarity index 100% rename from cms/static/css/tiny-mce.css rename to common/static/css/tiny-mce.css diff --git a/lms/djangoapps/instructor/views/legacy.py b/lms/djangoapps/instructor/views/legacy.py index da67444d4a..0aacf516a8 100644 --- a/lms/djangoapps/instructor/views/legacy.py +++ b/lms/djangoapps/instructor/views/legacy.py @@ -23,9 +23,11 @@ from django.core.urlresolvers import reverse from django.core.mail import send_mail from django.utils import timezone +from xmodule_modifiers import wrap_xmodule import xmodule.graders as xmgraders from xmodule.modulestore.django import modulestore from xmodule.modulestore.exceptions import ItemNotFoundError +from xmodule.html_module import HtmlDescriptor from courseware import grades from courseware.access import (has_access, get_access_group_name, @@ -83,7 +85,7 @@ def instructor_dashboard(request, course_id): msg = '' to = None subject = None - html_message = None + html_message = '' problems = [] plots = [] datatable = {} @@ -785,6 +787,13 @@ s (~10k), it may take 1-2 hours to send all emails." else: instructor_tasks = None + # HTML editor for email + if idash_mode == 'Email': + html_module = HtmlDescriptor(course.system, {'data': html_message}) + editor = wrap_xmodule(html_module.get_html, html_module, 'xmodule_edit.html')() + else: + editor = None + # display course stats only if there is no other table to display: course_stats = None if not datatable: @@ -801,9 +810,9 @@ s (~10k), it may take 1-2 hours to send all emails." 'course_stats': course_stats, 'msg': msg, 'modeflag': {idash_mode: 'selectedmode'}, - 'to': to, # email - 'subject': subject, # email - 'message': html_message, # email + 'to': to, # email + 'subject': subject, # email + 'editor': editor, # email 'problems': problems, # psychometrics 'plots': plots, # psychometrics 'course_errors': modulestore().get_item_errors(course.location), diff --git a/lms/envs/common.py b/lms/envs/common.py index bb19a70993..51fba25e69 100644 --- a/lms/envs/common.py +++ b/lms/envs/common.py @@ -616,6 +616,11 @@ PIPELINE_JS = { 'output_filename': 'js/lms-main_vendor.js', 'test_order': 0, }, + 'module-descriptor-js': { + 'source_filenames': rooted_glob(COMMON_ROOT / 'static/', 'xmodule/descriptors/js/*.js'), + 'output_filename': 'js/lms-module-descriptors.js', + 'test_order': 8, + }, 'module-js': { 'source_filenames': rooted_glob(COMMON_ROOT / 'static', 'xmodule/modules/js/*.js'), 'output_filename': 'js/lms-modules.js', diff --git a/lms/static/img/problem-editor-icons.png b/lms/static/img/problem-editor-icons.png new file mode 100644 index 0000000000..27eb57b668 Binary files /dev/null and b/lms/static/img/problem-editor-icons.png differ diff --git a/lms/static/sass/base/_variables.scss b/lms/static/sass/base/_variables.scss index 93297f4043..29fab36f1c 100644 --- a/lms/static/sass/base/_variables.scss +++ b/lms/static/sass/base/_variables.scss @@ -41,6 +41,10 @@ $green: rgb(37, 184, 90); $light-gray: #ddd; $dark-gray: #333; +// used by descriptor css +$lightGrey: #edf1f5; +$darkGrey: #8891a1; + // edx.org marketing site variables $m-gray: #8A8C8F; $m-gray-l1: #97999B; @@ -197,4 +201,4 @@ $homepage-bg-image: '../images/homepage-bg.jpg'; $login-banner-image: url(../images/bg-banner-login.png); $register-banner-image: url(../images/bg-banner-register.png); -$video-thumb-url: '../images/courses/video-thumb.jpg'; \ No newline at end of file +$video-thumb-url: '../images/courses/video-thumb.jpg'; diff --git a/lms/static/sass/course.scss.mako b/lms/static/sass/course.scss.mako index 93b0b681d4..bef3afa9cd 100644 --- a/lms/static/sass/course.scss.mako +++ b/lms/static/sass/course.scss.mako @@ -66,6 +66,7 @@ @import "course/instructor/instructor"; @import "course/instructor/instructor_2"; @import "course/instructor/email"; +@import "xmodule/descriptors/css/module-styles.scss"; // discussion @import "course/discussion/form-wmd-toolbar"; diff --git a/lms/static/sass/course/instructor/_email.scss b/lms/static/sass/course/instructor/_email.scss index ed33e985ab..bc38d64394 100644 --- a/lms/static/sass/course/instructor/_email.scss +++ b/lms/static/sass/course/instructor/_email.scss @@ -1,3 +1,21 @@ +.email-editor { + border: 1px solid #c8c8c8; +} + +.xmodule_edit { + ul { + margin: 0; + padding: 0; + margin-bottom: 10px; + list-style: none; + } + + a { + line-height: (16*1.48) + px; + line-height: 1.48rem; + } +} + .submit-email-action { margin-top: 10px; line-height: 1.3; diff --git a/lms/templates/courseware/instructor_dashboard.html b/lms/templates/courseware/instructor_dashboard.html index 71fc0646e6..35e15076fe 100644 --- a/lms/templates/courseware/instructor_dashboard.html +++ b/lms/templates/courseware/instructor_dashboard.html @@ -10,6 +10,12 @@ + + + + + + <%static:js group='module-descriptor-js'/> %if instructor_tasks is not None: %endif @@ -458,12 +464,11 @@ function goto( mode) %else: %endif - - %if message: - - %else: - - %endif + +
+ ${editor} +
+

Please try not to email students more than once a day. Important things to consider before sending: @@ -473,6 +478,13 @@ function goto( mode)
+ %endif diff --git a/lms/templates/widgets/html-edit.html b/lms/templates/widgets/html-edit.html new file mode 100644 index 0000000000..0cb0ca4f0a --- /dev/null +++ b/lms/templates/widgets/html-edit.html @@ -0,0 +1,13 @@ +<%! from django.utils.translation import ugettext as _ %> + +
+ + +
+ + +
+