Commit fcd66a50 by Roderick Morales Committed by Awais Qureshi

Applying feedback from demo ECOM-6961

ECOM-6961
parent 794b1457
...@@ -175,14 +175,6 @@ class CourseRunForm(BaseCourseForm): ...@@ -175,14 +175,6 @@ class CourseRunForm(BaseCourseForm):
class CustomCourseRunForm(CourseRunForm): class CustomCourseRunForm(CourseRunForm):
""" Course Run Form. """ """ Course Run Form. """
contacted_partner_manager = forms.ChoiceField(
label=_('Contacted PM'),
widget=forms.RadioSelect,
choices=((True, _("Yes")), (False, _("No"))),
required=True
)
start = forms.DateTimeField(label=_('Course Start Date'), required=True) start = forms.DateTimeField(label=_('Course Start Date'), required=True)
end = forms.DateTimeField(label=_('Course End Date'), required=True) end = forms.DateTimeField(label=_('Course End Date'), required=True)
staff = PersonModelMultipleChoice( staff = PersonModelMultipleChoice(
...@@ -238,7 +230,7 @@ class CustomCourseRunForm(CourseRunForm): ...@@ -238,7 +230,7 @@ class CustomCourseRunForm(CourseRunForm):
class Meta(CourseRunForm.Meta): class Meta(CourseRunForm.Meta):
fields = ( fields = (
'length', 'transcript_languages', 'language', 'min_effort', 'max_effort', 'length', 'transcript_languages', 'language', 'min_effort', 'max_effort',
'contacted_partner_manager', 'target_content', 'pacing_type', 'video_language', 'target_content', 'pacing_type', 'video_language',
'staff', 'start', 'end', 'is_xseries', 'xseries_name', 'is_micromasters', 'staff', 'start', 'end', 'is_xseries', 'xseries_name', 'is_micromasters',
'micromasters_name', 'lms_course_id', 'micromasters_name', 'lms_course_id',
) )
......
...@@ -252,33 +252,22 @@ class CreateCourseViewTests(TestCase): ...@@ -252,33 +252,22 @@ class CreateCourseViewTests(TestCase):
) )
) )
@ddt.data('contacted_partner_manager', 'pacing_type') def test_create_without_selecting_radio_buttons(self):
def test_create_without_selecting_radio_buttons(self, button_field):
""" """
Verify that without selecting pacing type and contacted_partner_manager Verify that without selecting pacing type course cannot be created.
course cannot be created.
""" """
data = {'number': 'course_1', 'image': ''} data = {'number': 'course_1', 'image': ''}
course_dict = self._post_data(data, self.course, self.course_run, self.seat) course_dict = self._post_data(data, self.course, self.course_run, self.seat)
course_dict.pop(button_field) course_dict.pop('pacing_type')
response = self.client.post(reverse('publisher:publisher_courses_new'), course_dict) response = self.client.post(reverse('publisher:publisher_courses_new'), course_dict)
self.assertEqual(response.status_code, 400) self.assertEqual(response.status_code, 400)
def test_page_with_pilot_switch_enable(self): def test_page_with_pilot_switch_enable(self):
""" Verify that if pilot switch is enable then about page information """ Verify that about page information panel is not visible on new course page."""
panel is not visible.
"""
toggle_switch('publisher_hide_features_for_pilot', True)
response = self.client.get(reverse('publisher:publisher_courses_new'))
self.assertContains(response, '<div class="layout-full publisher-layout layout hidden"')
def test_page_with_pilot_switch_disable(self):
""" Verify that if pilot switch is disable then about page information
panel is visible.
"""
toggle_switch('publisher_hide_features_for_pilot', False)
response = self.client.get(reverse('publisher:publisher_courses_new')) response = self.client.get(reverse('publisher:publisher_courses_new'))
self.assertContains(response, '<div class="layout-full publisher-layout layout"') self.assertNotIn(
'<div id="about-page" class="layout-full publisher-layout layout', response.content.decode('UTF-8')
)
def _post_data(self, data, course, course_run, seat): def _post_data(self, data, course, course_run, seat):
course_dict = model_to_dict(course) course_dict = model_to_dict(course)
...@@ -289,6 +278,7 @@ class CreateCourseViewTests(TestCase): ...@@ -289,6 +278,7 @@ class CreateCourseViewTests(TestCase):
course_dict.pop('video_language') course_dict.pop('video_language')
course_dict.pop('end') course_dict.pop('end')
course_dict.pop('priority') course_dict.pop('priority')
course_dict.pop('contacted_partner_manager')
course_dict['start'] = self.start_date_time course_dict['start'] = self.start_date_time
course_dict['end'] = self.end_date_time course_dict['end'] = self.end_date_time
course_dict['organization'] = self.organization_extension.organization.id course_dict['organization'] = self.organization_extension.organization.id
...@@ -332,7 +322,7 @@ class CreateCourseViewTests(TestCase): ...@@ -332,7 +322,7 @@ class CreateCourseViewTests(TestCase):
self.assertEqual(course.course_user_roles.filter(role=PublisherUserRole.CourseTeam).count(), 1) self.assertEqual(course.course_user_roles.filter(role=PublisherUserRole.CourseTeam).count(), 1)
self.assertEqual(self.course_run.language, course_run.language) self.assertEqual(self.course_run.language, course_run.language)
self.assertEqual(self.course_run.contacted_partner_manager, course_run.contacted_partner_manager) self.assertFalse(course_run.contacted_partner_manager)
self.assertEqual(self.course_run.pacing_type, course_run.pacing_type) self.assertEqual(self.course_run.pacing_type, course_run.pacing_type)
self.assertEqual(course_run.start.strftime("%Y-%m-%d %H:%M:%S"), self.start_date_time) self.assertEqual(course_run.start.strftime("%Y-%m-%d %H:%M:%S"), self.start_date_time)
self.assertEqual(course_run.end.strftime("%Y-%m-%d %H:%M:%S"), self.end_date_time) self.assertEqual(course_run.end.strftime("%Y-%m-%d %H:%M:%S"), self.end_date_time)
...@@ -1418,7 +1408,7 @@ class CourseListViewTests(TestCase): ...@@ -1418,7 +1408,7 @@ class CourseListViewTests(TestCase):
""" Dry method to assert course list page content. """ """ Dry method to assert course list page content. """
response = self.client.get(self.courses_url) response = self.client.get(self.courses_url)
self.assertContains(response, '{} Courses'.format(course_count)) self.assertContains(response, '{} Courses'.format(course_count))
self.assertContains(response, 'Add Course') self.assertContains(response, 'Create New Course')
if course_count > 0: if course_count > 0:
self.assertContains(response, self.course.title) self.assertContains(response, self.course.title)
...@@ -2100,6 +2090,24 @@ class CourseRunEditViewTests(TestCase): ...@@ -2100,6 +2090,24 @@ class CourseRunEditViewTests(TestCase):
response = self.client.get(self.edit_page_url) response = self.client.get(self.edit_page_url)
self.assertContains(response, '<div id="SeatPriceBlock" class="col col-6') self.assertContains(response, '<div id="SeatPriceBlock" class="col col-6')
def test_page_with_enable_waffle_switch(self):
"""
Verify that edit pages shows the about page information block but only visible
if the switch `publisher_hide_features_for_pilot` is enable.
"""
toggle_switch('publisher_hide_features_for_pilot', True)
response = self.client.get(self.edit_page_url)
self.assertContains(response, '<div id="about-page" class="layout-full publisher-layout layout hidden">')
def test_page_with_disable_waffle_switch(self):
"""
Verify that edit pages shows the about page information block but hidden
if the switch `publisher_hide_features_for_pilot` is disable
"""
toggle_switch('publisher_hide_features_for_pilot', False)
response = self.client.get(self.edit_page_url)
self.assertContains(response, '<div id="about-page" class="layout-full publisher-layout layout ">')
class CourseRevisionViewTests(TestCase): class CourseRevisionViewTests(TestCase):
""" Tests for CourseReview""" """ Tests for CourseReview"""
......
...@@ -248,9 +248,15 @@ class CreateCourseView(mixins.LoginRequiredMixin, mixins.PublisherUserRequiredMi ...@@ -248,9 +248,15 @@ class CreateCourseView(mixins.LoginRequiredMixin, mixins.PublisherUserRequiredMi
user=User.objects.get(id=course_form.data['team_admin'])) user=User.objects.get(id=course_form.data['team_admin']))
# pylint: disable=no-member # pylint: disable=no-member
messages.success(request, _( messages.success(
'EdX will create a Studio instance for this course. You will receive a notification message at ' request, _(
'{email} when the Studio instance has been created.').format(email=request.user.email)) "You have successfully created a course. You can edit the course information or enter "
"information for the course About page at any time. "
"An edX project coordinator will create a Studio instance for this course. When you "
"receive an email notification that the Studio instance is ready, you can enter course "
"content in Studio."
)
)
# sending email for notifying new course is created. # sending email for notifying new course is created.
emails.send_email_for_course_creation(course, run_course) emails.send_email_for_course_creation(course, run_course)
......
...@@ -7,7 +7,7 @@ msgid "" ...@@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-02-09 15:57+0500\n" "POT-Creation-Date: 2017-02-10 14:57+0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
...@@ -507,7 +507,11 @@ msgstr "" ...@@ -507,7 +507,11 @@ msgstr ""
msgid "Course Title" msgid "Course Title"
msgstr "" msgstr ""
#: apps/publisher/forms.py templates/publisher/course_revision_history.html #: apps/publisher/forms.py templates/publisher/course_detail.html
#: templates/publisher/course_revision_history.html
#: templates/publisher/dashboard/_in_progress.html
#: templates/publisher/dashboard/_preview_ready.html
#: templates/publisher/dashboard/_published.html
#: templates/publisher/dashboard/_studio_requests.html #: templates/publisher/dashboard/_studio_requests.html
msgid "Course Number" msgid "Course Number"
msgstr "" msgstr ""
...@@ -547,18 +551,6 @@ msgstr "" ...@@ -547,18 +551,6 @@ msgstr ""
msgid "Tertiary (optional)" msgid "Tertiary (optional)"
msgstr "" msgstr ""
#: apps/publisher/forms.py
msgid "Contacted PM"
msgstr ""
#: apps/publisher/forms.py
msgid "Yes"
msgstr ""
#: apps/publisher/forms.py
msgid "No"
msgstr ""
#: apps/publisher/forms.py templates/publisher/course_run_detail/_all.html #: apps/publisher/forms.py templates/publisher/course_run_detail/_all.html
msgid "Course Start Date" msgid "Course Start Date"
msgstr "" msgstr ""
...@@ -572,6 +564,14 @@ msgid "instructor" ...@@ -572,6 +564,14 @@ msgid "instructor"
msgstr "" msgstr ""
#: apps/publisher/forms.py #: apps/publisher/forms.py
msgid "Yes"
msgstr ""
#: apps/publisher/forms.py
msgid "No"
msgstr ""
#: apps/publisher/forms.py
msgid "Pacing" msgid "Pacing"
msgstr "" msgstr ""
...@@ -719,7 +719,7 @@ msgstr "" ...@@ -719,7 +719,7 @@ msgstr ""
msgid "Course Role" msgid "Course Role"
msgstr "" msgstr ""
#: apps/publisher/views.py templates/publisher/add_update_course_form.html #: apps/publisher/views.py
msgid "PARTNER MANAGER" msgid "PARTNER MANAGER"
msgstr "" msgstr ""
...@@ -736,10 +736,12 @@ msgid "PUBLISHER" ...@@ -736,10 +736,12 @@ msgid "PUBLISHER"
msgstr "" msgstr ""
#: apps/publisher/views.py #: apps/publisher/views.py
#, python-brace-format
msgid "" msgid ""
"EdX will create a Studio instance for this course. You will receive a " "You have successfully created a course. You can edit the course information "
"notification message at {email} when the Studio instance has been created." "or enter information for the course About page at any time. An edX project "
"coordinator will create a Studio instance for this course. When you receive "
"an email notification that the Studio instance is ready, you can enter "
"course content in Studio."
msgstr "" msgstr ""
#: apps/publisher/views.py #: apps/publisher/views.py
...@@ -849,6 +851,7 @@ msgstr "" ...@@ -849,6 +851,7 @@ msgstr ""
#: templates/metadata/admin/course_run.html #: templates/metadata/admin/course_run.html
#: templates/publisher/_add_instructor_popup.html #: templates/publisher/_add_instructor_popup.html
#: templates/publisher/add_update_course_form.html
#: templates/publisher/course_edit_form.html #: templates/publisher/course_edit_form.html
msgid "Cancel" msgid "Cancel"
msgstr "" msgstr ""
...@@ -1165,7 +1168,6 @@ msgid "" ...@@ -1165,7 +1168,6 @@ msgid ""
msgstr "" msgstr ""
#: templates/publisher/add_courserun_form.html #: templates/publisher/add_courserun_form.html
#: templates/publisher/add_update_course_form.html
msgid "Save Draft" msgid "Save Draft"
msgstr "" msgstr ""
...@@ -1181,23 +1183,18 @@ msgstr "" ...@@ -1181,23 +1183,18 @@ msgstr ""
#: templates/publisher/add_update_course_form.html #: templates/publisher/add_update_course_form.html
#: templates/publisher/courses.html #: templates/publisher/courses.html
msgid "Add Course" msgid "Create New Course"
msgstr "" msgstr ""
#: templates/publisher/add_update_course_form.html #: templates/publisher/add_update_course_form.html
#: templates/publisher/course_edit_form.html #, python-format
msgid "" msgid ""
"The information in the Studio Instance section is required before edX can " "To create a parent course, enter the following information about the course "
"create a Studio instance for the course run." "and select %(strong_start)sCreate New Course%(strong_end)s."
msgstr "" msgstr ""
#: templates/publisher/add_update_course_form.html #: templates/publisher/add_update_course_form.html
#: templates/publisher/course_edit_form.html msgid "All of the following information is required."
msgid ""
"The information in the About Page section is not required before edX creates"
" a Studio instance for the course run. You can return to this page and enter"
" this information later. This information is required before edX announces "
"the course."
msgstr "" msgstr ""
#: templates/publisher/add_update_course_form.html #: templates/publisher/add_update_course_form.html
...@@ -1207,19 +1204,6 @@ msgstr "" ...@@ -1207,19 +1204,6 @@ msgstr ""
#: templates/publisher/add_update_course_form.html #: templates/publisher/add_update_course_form.html
#: templates/publisher/course_edit_form.html #: templates/publisher/course_edit_form.html
msgid ""
"This information is required before edX can create a Studio instance for a "
"course run."
msgstr ""
#: templates/publisher/add_update_course_form.html
msgid ""
"EdX recommends that you contact a partner manager before you begin to plan a"
" new course. "
msgstr ""
#: templates/publisher/add_update_course_form.html
#: templates/publisher/course_edit_form.html
msgid "Examples" msgid "Examples"
msgstr "" msgstr ""
...@@ -1625,6 +1609,21 @@ msgid "" ...@@ -1625,6 +1609,21 @@ msgid ""
"3rd or 4th year university student or a masters degree student" "3rd or 4th year university student or a masters degree student"
msgstr "" msgstr ""
#: templates/publisher/add_update_course_form.html
msgid ""
"After you submit this information, an edX project coordinator creates an "
"instance for the course as well as a course run in Studio. When the Studio "
"instance is ready, you will receive an email notification. You can then "
"enter course content in Studio."
msgstr ""
#: templates/publisher/add_update_course_form.html
msgid ""
"If you have additional information for your course About page, you can enter"
" it on the next page. You can edit this information at any time before edX "
"publishes the course About page."
msgstr ""
#: templates/publisher/base.html templates/publisher/dashboard.html #: templates/publisher/base.html templates/publisher/dashboard.html
msgid "Dashboard" msgid "Dashboard"
msgstr "" msgstr ""
...@@ -1690,6 +1689,36 @@ msgid "" ...@@ -1690,6 +1689,36 @@ msgid ""
msgstr "" msgstr ""
#: templates/publisher/course_edit_form.html #: templates/publisher/course_edit_form.html
msgid ""
"The information in the Studio Instance section is required before edX can "
"create a Studio instance for the course run."
msgstr ""
#: templates/publisher/course_edit_form.html
msgid ""
"The information in the About Page section is not required before edX creates"
" a Studio instance for the course run. You can return to this page and enter"
" this information later. This information is required before edX announces "
"the course."
msgstr ""
#: templates/publisher/course_edit_form.html
msgid ""
"This information is required before edX can create a Studio instance for a "
"course run."
msgstr ""
#: templates/publisher/course_edit_form.html
msgid ""
"You can enter this information at any time before edX publishes the About "
"page."
msgstr ""
#: templates/publisher/course_edit_form.html
msgid "You must enter this information both in this section and in Studio."
msgstr ""
#: templates/publisher/course_edit_form.html
msgid "UPDATE COURSE" msgid "UPDATE COURSE"
msgstr "" msgstr ""
......
...@@ -7,7 +7,7 @@ msgid "" ...@@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-02-09 15:57+0500\n" "POT-Creation-Date: 2017-02-10 14:57+0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
......
...@@ -7,7 +7,7 @@ msgid "" ...@@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-02-09 15:57+0500\n" "POT-Creation-Date: 2017-02-10 14:57+0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
......
...@@ -152,7 +152,13 @@ ...@@ -152,7 +152,13 @@
} }
} }
.action-buttons{
@include float(right);
button {
@include margin-left(20px);
}
}
.course-information { .course-information {
margin-bottom: 30px; margin-bottom: 30px;
......
...@@ -36,9 +36,6 @@ ...@@ -36,9 +36,6 @@
</p> </p>
</div> </div>
<fieldset class="form-group grid-container grid-manual"> <fieldset class="form-group grid-container grid-manual">
<div class="hidden">{{ run_form.contacted_partner_manager }}</div>
<div class="field-title">{% trans "COURSE TITLE" %}</div> <div class="field-title">{% trans "COURSE TITLE" %}</div>
<div class="row"> <div class="row">
<div class="col col-6 help-text"> <div class="col col-6 help-text">
......
...@@ -116,6 +116,8 @@ ...@@ -116,6 +116,8 @@
<div class="layout-full publisher-layout layout {% if publisher_hide_features_for_pilot %}hidden{% endif %}"> <div class="layout-full publisher-layout layout {% if publisher_hide_features_for_pilot %}hidden{% endif %}">
<h2 class="layout-title">{% trans "About page information" %}</h2> <h2 class="layout-title">{% trans "About page information" %}</h2>
<p>{% trans "You can enter this information at any time before edX publishes the About page." %}</p>
<p>{% trans "You must enter this information both in this section and in Studio." %}</p>
<div class="card course-form"> <div class="card course-form">
<div class="course-information"> <div class="course-information">
<fieldset class="form-group grid-container grid-manual"> <fieldset class="form-group grid-container grid-manual">
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
{% block page_content %} {% block page_content %}
<h2 class="hd-2 course-count-heading">{{ object_list.count }} Courses</h2> <h2 class="hd-2 course-count-heading">{{ object_list.count }} Courses</h2>
<a href="{% url 'publisher:publisher_courses_new' %}" class="btn btn-brand btn-small btn-course-add"> <a href="{% url 'publisher:publisher_courses_new' %}" class="btn btn-brand btn-small btn-course-add">
{% trans "Add Course" %} {% trans "Create New Course" %}
</a> </a>
<div class="coursesTable"> <div class="coursesTable">
<table id="dataTableCourse" class="display" cellspacing="0" width="100%"> <table id="dataTableCourse" class="display" cellspacing="0" width="100%">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment