From 6e96b885186b8ea44b76a38aa788538b9a0d68c2 Mon Sep 17 00:00:00 2001 From: cahrens Date: Wed, 19 Jun 2013 11:28:16 -0400 Subject: [PATCH 01/12] On marketing site, disable course settings options that do not work. When on the marketing site (edx.org) disable portions of the course settings page in Studio that do not actually work in that environment. --- .../tests/test_course_settings.py | 45 +++++ cms/djangoapps/contentstore/views/course.py | 3 +- cms/templates/settings.html | 172 ++++++++++-------- 3 files changed, 139 insertions(+), 81 deletions(-) diff --git a/cms/djangoapps/contentstore/tests/test_course_settings.py b/cms/djangoapps/contentstore/tests/test_course_settings.py index 8c15b1ae95..3d676390ea 100644 --- a/cms/djangoapps/contentstore/tests/test_course_settings.py +++ b/cms/djangoapps/contentstore/tests/test_course_settings.py @@ -1,11 +1,13 @@ import datetime import json import copy +import mock from django.contrib.auth.models import User from django.test.client import Client from django.core.urlresolvers import reverse from django.utils.timezone import UTC +from django.test.utils import override_settings from xmodule.modulestore import Location from models.settings.course_details import (CourseDetails, CourseSettingsEncoder) @@ -118,6 +120,49 @@ class CourseDetailsTestCase(CourseTestCase): jsondetails.effort, "After set effort" ) + @override_settings(MKTG_URLS={'ROOT': 'dummy-root'}) + def test_marketing_site_fetch(self): + settings_details_url = reverse('settings_details', + kwargs= {'org': self.course_location.org, + 'name': self.course_location.name, + 'course': self.course_location.course + }) + + with mock.patch.dict('django.conf.settings.MITX_FEATURES', {'ENABLE_MKTG_SITE': True}): + response = self.client.get(settings_details_url) + self.assertContains(response, "Course Summary Page") + self.assertContains(response, "your course summary page will not be viewable") + + self.assertContains(response, "Course Start Date") + self.assertContains(response, "Course End Date") + self.assertNotContains(response, "Enrollment Start Date") + self.assertNotContains(response, "Enrollment End Date") + self.assertContains(response, "not the dates shown on your course summary page") + + self.assertNotContains(response, "Introducing Your Course") + self.assertNotContains(response, "Requirements") + + def test_regular_site_fetch(self): + settings_details_url = reverse('settings_details', + kwargs= {'org': self.course_location.org, + 'name': self.course_location.name, + 'course': self.course_location.course + }) + + with mock.patch.dict('django.conf.settings.MITX_FEATURES', {'ENABLE_MKTG_SITE': False}): + response = self.client.get(settings_details_url) + self.assertContains(response, "Course Summary Page") + self.assertNotContains(response, "your course summary page will not be viewable") + + self.assertContains(response, "Course Start Date") + self.assertContains(response, "Course End Date") + self.assertContains(response, "Enrollment Start Date") + self.assertContains(response, "Enrollment End Date") + self.assertNotContains(response, "not the dates shown on your course summary page") + + self.assertContains(response, "Introducing Your Course") + self.assertContains(response, "Requirements") + class CourseDetailsViewTest(CourseTestCase): def alter_field(self, url, details, field, val): diff --git a/cms/djangoapps/contentstore/views/course.py b/cms/djangoapps/contentstore/views/course.py index 8762eb3a2a..62df50d5f4 100644 --- a/cms/djangoapps/contentstore/views/course.py +++ b/cms/djangoapps/contentstore/views/course.py @@ -230,7 +230,8 @@ def get_course_settings(request, org, course, name): kwargs={"org": org, "course": course, "name": name, - "section": "details"}) + "section": "details"}), + 'about_page_editable': not settings.MITX_FEATURES.get('ENABLE_MKTG_SITE', False) }) diff --git a/cms/templates/settings.html b/cms/templates/settings.html index 2adc0cd980..55dd2b67b2 100644 --- a/cms/templates/settings.html +++ b/cms/templates/settings.html @@ -1,3 +1,5 @@ +<%! from django.utils.translation import ugettext as _ %> + <%inherit file="base.html" /> <%block name="title">Schedule & Details Settings <%block name="bodyclass">is-signedin course schedule settings @@ -50,8 +52,8 @@ from contentstore import utils

- Settings - > Schedule & Details + ${_("Settings")} + > ${_("Schedule & Details")}

@@ -62,36 +64,40 @@ from contentstore import utils
-

Basic Information

- The nuts and bolts of your course +

${_("Basic Information")}

+ ${_("The nuts and bolts of your course")}
  1. - - + +
  2. - - + +
  3. - - + +
-

Course Summary Page (for student enrollment and access)

+

${_("Course Summary Page")} ${_("(for student enrollment and access)")}

- + % if not about_page_editable: +
+

${_("Note: your course summary page will not be viewable until your course has been announced. To provide content for the page and preview it, follow the instructions provided by your PM or Conrad Warre (conrad@edx.org).")}

+
+ % endif
@@ -101,20 +107,26 @@ from contentstore import utils
-

Course Schedule

- Important steps and segments of your course +

${_('Course Schedule')}

+ ${_('Dates that control when your course can be viewed.')}
+ % if not about_page_editable: +
+

${_("Note: these dates impact when your courseware can be viewed, but they are not the dates shown on your course summary page. To provide the course start and registration dates as shown on your course summary page, follow the instructions provided by your PM or Conrad Warre (conrad@edx.org).")}

+
+ % endif +
  1. - + - First day the course begins + ${_("First day the course begins")}
    - +
    @@ -122,29 +134,29 @@ from contentstore import utils
  2. - + - Last day your course is active + ${_("Last day your course is active")}
    - +
- + % if about_page_editable:
  1. - + - First day students can enroll + ${_("First day students can enroll")}
    - +
    @@ -152,91 +164,91 @@ from contentstore import utils
  2. - + - Last day students can enroll + ${_("Last day students can enroll")}
    - +
+ % endif
-
+ % if about_page_editable: +
+
+

${_("Introducing Your Course")}

+ ${_("Information for prospective students")} +
-
-
-

Introducing Your Course

- Information for prospective students -
+
    +
  1. + + + ${_("Introductions, prerequisites, FAQs that are used on ")}${_("your course summary page")}${_(" (formatted in HTML)")} +
  2. -
      -
    1. - - - Introductions, prerequisites, FAQs that are used on your course summary page (formatted in HTML) -
    2. +
    3. + + -
    4. - -
      -
      - -
      - -
      +
      + + ${_("Enter your YouTube video's ID (along with any restriction parameters)")} +
      +
    5. +
    +
-
- - Enter your YouTube video's ID (along with any restriction parameters) -
- - -
+
-
+
+
+

${_("Requirements")}

+ ${_("Expectations of the students taking this course")} +
-
-
-

Requirements

- Expectations of the students taking this course -
- -
    -
  1. - - - Time spent on all course work -
  2. -
-
+
    +
  1. + + + ${_("Time spent on all course work")} +
  2. +
+
+ % endif -

@@ -111,12 +116,6 @@ from contentstore import utils ${_('Dates that control when your course can be viewed.')} - % if not about_page_editable: -
-

${_("Note: these dates impact when your courseware can be viewed, but they are not the dates shown on your course summary page. To provide the course start and registration dates as shown on your course summary page, follow the instructions provided by your PM or Conrad Warre (conrad@edx.org).")}

-
- % endif -
  1. @@ -146,6 +145,7 @@ from contentstore import utils
+ % if about_page_editable:
  1. @@ -177,6 +177,15 @@ from contentstore import utils
% endif + + % if not about_page_editable: +
+

${_("Note: These Dates Are Not Used When Promoting Your Course")}

+
+

${_('These dates impact when your courseware can be viewed, but they are not the dates shown on your course summary page. To provide the course start and registration dates as shown on your course summary page, follow the instructions provided by your PM or Conrad Warre (conrad@edx.org).')}

+
+
+ % endif
% if about_page_editable: From d2f0d85085f5b4ca00c3b1076b8adfbd208c0853 Mon Sep 17 00:00:00 2001 From: Brian Talbot Date: Wed, 19 Jun 2013 17:42:05 -0400 Subject: [PATCH 05/12] studio - adds in basic rules for notices UI --- cms/static/sass/elements/_system-help.scss | 39 ++++++++++++++++++++++ cms/static/sass/views/_settings.scss | 8 ++++- common/static/sass/_mixins.scss | 7 ++++ 3 files changed, 53 insertions(+), 1 deletion(-) diff --git a/cms/static/sass/elements/_system-help.scss b/cms/static/sass/elements/_system-help.scss index 7fcb218282..017faab54d 100644 --- a/cms/static/sass/elements/_system-help.scss +++ b/cms/static/sass/elements/_system-help.scss @@ -1,2 +1,41 @@ // studio - elements - system help // ==================== + +// notices - in-context: to be used as notices to users within the context of a form/action +.notice-incontext { + @extend .ui-well; + + .title { + @extend .t-title7; + margin-bottom: ($baseline/4); + font-weight: 600; + + [class^="icon-"] { + @extend .t-icon5; + display: inline-block; + vertical-align: middle; + margin-right: ($baseline/4); + } + } + + .copy { + @extend .t-copy-sub2; + } + + strong { + font-weight: 600; + } +} + +// particular warnings around a workflow for something +.notice-workflow { + background: $yellow-l5; + + .copy { + color: $gray-d1; + } + + .icon-warning-sign { + color: $yellow-s3; + } +} diff --git a/cms/static/sass/views/_settings.scss b/cms/static/sass/views/_settings.scss index 735774511f..cbb1034626 100644 --- a/cms/static/sass/views/_settings.scss +++ b/cms/static/sass/views/_settings.scss @@ -21,7 +21,7 @@ body.course.settings { font-size: 14px; } - .message-status { + .message-status { display: none; @include border-top-radius(2px); @include box-sizing(border-box); @@ -52,6 +52,12 @@ body.course.settings { } } + // notices - used currently for edx mktg + .notice-workflow { + margin-top: ($baseline); + } + + // in form - elements .group-settings { margin: 0 0 ($baseline*2) 0; diff --git a/common/static/sass/_mixins.scss b/common/static/sass/_mixins.scss index c3a548bbf7..c26738a1b7 100644 --- a/common/static/sass/_mixins.scss +++ b/common/static/sass/_mixins.scss @@ -189,3 +189,10 @@ } } + +// UI archetypes - well +.ui-well { + @include box-shadow(inset 0 1px 2px 1px $shadow-l1); + padding: ($baseline*0.75); +} + From 7904464975f3d20ebb33a65600c0c589352434a7 Mon Sep 17 00:00:00 2001 From: Brian Talbot Date: Wed, 19 Jun 2013 17:42:36 -0400 Subject: [PATCH 06/12] studio - revises notice headings to use icons --- cms/templates/settings.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cms/templates/settings.html b/cms/templates/settings.html index 2ee4ad1c07..e0a99acff9 100644 --- a/cms/templates/settings.html +++ b/cms/templates/settings.html @@ -100,7 +100,7 @@ from contentstore import utils % if not about_page_editable:
-

${_("Note: About Your Course's Promotion")}

+

${_("Note: About Your Course's Promotion")}

${_('Your course summary page will not be viewable until your course has been announced. To provide content for the page and preview it, follow the instructions provided by PM or Conrad Warre (conrad@edx.org).')}

@@ -180,7 +180,7 @@ from contentstore import utils % if not about_page_editable:
-

${_("Note: These Dates Are Not Used When Promoting Your Course")}

+

${_("Note: These Dates Are Not Used When Promoting Your Course")}

${_('These dates impact when your courseware can be viewed, but they are not the dates shown on your course summary page. To provide the course start and registration dates as shown on your course summary page, follow the instructions provided by your PM or Conrad Warre (conrad@edx.org).')}

From 4ddca36bbecfd8df3f4f4d53ccb48d31ea6b4c9a Mon Sep 17 00:00:00 2001 From: Brian Talbot Date: Wed, 19 Jun 2013 18:13:54 -0400 Subject: [PATCH 07/12] Studio - adds minor UI/content changes to settings notices --- cms/static/sass/elements/_system-help.scss | 1 + cms/templates/settings.html | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/cms/static/sass/elements/_system-help.scss b/cms/static/sass/elements/_system-help.scss index 017faab54d..5f4cec26d7 100644 --- a/cms/static/sass/elements/_system-help.scss +++ b/cms/static/sass/elements/_system-help.scss @@ -4,6 +4,7 @@ // notices - in-context: to be used as notices to users within the context of a form/action .notice-incontext { @extend .ui-well; + @include border-radius(($baseline/10)); .title { @extend .t-title7; diff --git a/cms/templates/settings.html b/cms/templates/settings.html index e0a99acff9..6f2ef7653d 100644 --- a/cms/templates/settings.html +++ b/cms/templates/settings.html @@ -100,9 +100,9 @@ from contentstore import utils % if not about_page_editable:
-

${_("Note: About Your Course's Promotion")}

+

${_("Promoting Your Course with edX")}

-

${_('Your course summary page will not be viewable until your course has been announced. To provide content for the page and preview it, follow the instructions provided by PM or Conrad Warre (conrad@edx.org).')}

+

${_('Your course summary page will not be viewable until your course has been announced. To provide content for the page and preview it, follow the instructions provided by your PM or Conrad Warre (conrad@edx.org).')}

% endif @@ -180,7 +180,7 @@ from contentstore import utils % if not about_page_editable:
-

${_("Note: These Dates Are Not Used When Promoting Your Course")}

+

${_("These Dates Are Not Used When Promoting Your Course")}

${_('These dates impact when your courseware can be viewed, but they are not the dates shown on your course summary page. To provide the course start and registration dates as shown on your course summary page, follow the instructions provided by your PM or Conrad Warre (conrad@edx.org).')}

From 419c5e7a5ce513d64291759658d6d8930e5fe2c5 Mon Sep 17 00:00:00 2001 From: Brian Talbot Date: Thu, 20 Jun 2013 09:23:16 -0400 Subject: [PATCH 08/12] studio - removes course settings promo link and notice icons --- cms/templates/settings.html | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cms/templates/settings.html b/cms/templates/settings.html index 6f2ef7653d..72df12cdd5 100644 --- a/cms/templates/settings.html +++ b/cms/templates/settings.html @@ -85,6 +85,7 @@ from contentstore import utils + % if about_page_editable:

${_("Course Summary Page")} ${_("(for student enrollment and access)")}

@@ -97,10 +98,11 @@ from contentstore import utils
+ % endif % if not about_page_editable:
-

${_("Promoting Your Course with edX")}

+

${_("Promoting Your Course with edX")}

${_('Your course summary page will not be viewable until your course has been announced. To provide content for the page and preview it, follow the instructions provided by your PM or Conrad Warre (conrad@edx.org).')}

@@ -180,7 +182,7 @@ from contentstore import utils % if not about_page_editable:
-

${_("These Dates Are Not Used When Promoting Your Course")}

+

${_("These Dates Are Not Used When Promoting Your Course")}

${_('These dates impact when your courseware can be viewed, but they are not the dates shown on your course summary page. To provide the course start and registration dates as shown on your course summary page, follow the instructions provided by your PM or Conrad Warre (conrad@edx.org).')}

From 604e820211755d80a9aac6759c75930ec58c9c4a Mon Sep 17 00:00:00 2001 From: Brian Talbot Date: Thu, 20 Jun 2013 09:23:56 -0400 Subject: [PATCH 09/12] studio - revises styling of in-context notices UI --- cms/static/sass/elements/_system-help.scss | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/cms/static/sass/elements/_system-help.scss b/cms/static/sass/elements/_system-help.scss index 5f4cec26d7..a9a3e16128 100644 --- a/cms/static/sass/elements/_system-help.scss +++ b/cms/static/sass/elements/_system-help.scss @@ -10,22 +10,24 @@ @extend .t-title7; margin-bottom: ($baseline/4); font-weight: 600; - - [class^="icon-"] { - @extend .t-icon5; - display: inline-block; - vertical-align: middle; - margin-right: ($baseline/4); - } } .copy { - @extend .t-copy-sub2; + @extend .t-copy-sub1; + @include transition(opacity 0.25s ease-in-out 0); + opacity: 0.75; } strong { font-weight: 600; } + + &:hover { + + .copy { + opacity: 1.0; + } + } } // particular warnings around a workflow for something @@ -35,8 +37,4 @@ .copy { color: $gray-d1; } - - .icon-warning-sign { - color: $yellow-s3; - } } From 485b5b2d6dada79a31a0f7b5276d5140f3faab69 Mon Sep 17 00:00:00 2001 From: Brian Talbot Date: Thu, 20 Jun 2013 10:50:15 -0400 Subject: [PATCH 10/12] studio - unconditionalizes course summary info in settings --- cms/templates/settings.html | 2 -- 1 file changed, 2 deletions(-) diff --git a/cms/templates/settings.html b/cms/templates/settings.html index 72df12cdd5..14c79e586a 100644 --- a/cms/templates/settings.html +++ b/cms/templates/settings.html @@ -85,7 +85,6 @@ from contentstore import utils - % if about_page_editable:

${_("Course Summary Page")} ${_("(for student enrollment and access)")}

@@ -98,7 +97,6 @@ from contentstore import utils
- % endif % if not about_page_editable:
From a498fa52bae85ed9ae6d02714efbaaeadea9593a Mon Sep 17 00:00:00 2001 From: cahrens Date: Thu, 20 Jun 2013 11:29:31 -0400 Subject: [PATCH 11/12] Modify after UX text changes. --- cms/djangoapps/contentstore/tests/test_course_settings.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cms/djangoapps/contentstore/tests/test_course_settings.py b/cms/djangoapps/contentstore/tests/test_course_settings.py index d038b9f1e2..6b8622f992 100644 --- a/cms/djangoapps/contentstore/tests/test_course_settings.py +++ b/cms/djangoapps/contentstore/tests/test_course_settings.py @@ -138,7 +138,7 @@ class CourseDetailsTestCase(CourseTestCase): with mock.patch.dict('django.conf.settings.MITX_FEATURES', {'ENABLE_MKTG_SITE': True}): response = self.client.get(settings_details_url) self.assertContains(response, "Course Summary Page") - self.assertContains(response, "your course summary page will not be viewable") + self.assertContains(response, "course summary page will not be viewable") self.assertContains(response, "Course Start Date") self.assertContains(response, "Course End Date") @@ -157,7 +157,7 @@ class CourseDetailsTestCase(CourseTestCase): with mock.patch.dict('django.conf.settings.MITX_FEATURES', {'ENABLE_MKTG_SITE': False}): response = self.client.get(settings_details_url) self.assertContains(response, "Course Summary Page") - self.assertNotContains(response, "your course summary page will not be viewable") + self.assertNotContains(response, "course summary page will not be viewable") self.assertContains(response, "Course Start Date") self.assertContains(response, "Course End Date") From 9a753f1cc529e3a1fe0b9a14c48342958daca8ca Mon Sep 17 00:00:00 2001 From: cahrens Date: Thu, 20 Jun 2013 12:03:59 -0400 Subject: [PATCH 12/12] Studio feature to disable course settings on Drupal site. --- CHANGELOG.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 9c405ed365..3bc3b6b9bf 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -11,6 +11,9 @@ XModule: Don't delete generated xmodule asset files when compiling (for instance, when XModule provides a coffeescript file, don't delete the associated javascript) +Studio: For courses running on edx.org (marketing site), disable fields in +Course Settings that do not apply. + Common: Make asset watchers run as singletons (so they won't start if the watcher is already running in another shell).