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):
class CustomCourseRunForm(CourseRunForm):
""" 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)
end = forms.DateTimeField(label=_('Course End Date'), required=True)
staff = PersonModelMultipleChoice(
......@@ -238,7 +230,7 @@ class CustomCourseRunForm(CourseRunForm):
class Meta(CourseRunForm.Meta):
fields = (
'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',
'micromasters_name', 'lms_course_id',
)
......
......@@ -252,33 +252,22 @@ class CreateCourseViewTests(TestCase):
)
)
@ddt.data('contacted_partner_manager', 'pacing_type')
def test_create_without_selecting_radio_buttons(self, button_field):
def test_create_without_selecting_radio_buttons(self):
"""
Verify that without selecting pacing type and contacted_partner_manager
course cannot be created.
Verify that without selecting pacing type course cannot be created.
"""
data = {'number': 'course_1', 'image': ''}
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)
self.assertEqual(response.status_code, 400)
def test_page_with_pilot_switch_enable(self):
""" Verify that if pilot switch is enable then about page information
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)
""" Verify that about page information panel is not visible on new course page."""
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):
course_dict = model_to_dict(course)
......@@ -289,6 +278,7 @@ class CreateCourseViewTests(TestCase):
course_dict.pop('video_language')
course_dict.pop('end')
course_dict.pop('priority')
course_dict.pop('contacted_partner_manager')
course_dict['start'] = self.start_date_time
course_dict['end'] = self.end_date_time
course_dict['organization'] = self.organization_extension.organization.id
......@@ -332,7 +322,7 @@ class CreateCourseViewTests(TestCase):
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.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(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)
......@@ -1418,7 +1408,7 @@ class CourseListViewTests(TestCase):
""" Dry method to assert course list page content. """
response = self.client.get(self.courses_url)
self.assertContains(response, '{} Courses'.format(course_count))
self.assertContains(response, 'Add Course')
self.assertContains(response, 'Create New Course')
if course_count > 0:
self.assertContains(response, self.course.title)
......@@ -2100,6 +2090,24 @@ class CourseRunEditViewTests(TestCase):
response = self.client.get(self.edit_page_url)
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):
""" Tests for CourseReview"""
......
......@@ -248,9 +248,15 @@ class CreateCourseView(mixins.LoginRequiredMixin, mixins.PublisherUserRequiredMi
user=User.objects.get(id=course_form.data['team_admin']))
# pylint: disable=no-member
messages.success(request, _(
'EdX will create a Studio instance for this course. You will receive a notification message at '
'{email} when the Studio instance has been created.').format(email=request.user.email))
messages.success(
request, _(
"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.
emails.send_email_for_course_creation(course, run_course)
......
......@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\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"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
......@@ -507,7 +507,11 @@ msgstr ""
msgid "Course Title"
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
msgid "Course Number"
msgstr ""
......@@ -547,18 +551,6 @@ msgstr ""
msgid "Tertiary (optional)"
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
msgid "Course Start Date"
msgstr ""
......@@ -572,6 +564,14 @@ msgid "instructor"
msgstr ""
#: apps/publisher/forms.py
msgid "Yes"
msgstr ""
#: apps/publisher/forms.py
msgid "No"
msgstr ""
#: apps/publisher/forms.py
msgid "Pacing"
msgstr ""
......@@ -719,7 +719,7 @@ msgstr ""
msgid "Course Role"
msgstr ""
#: apps/publisher/views.py templates/publisher/add_update_course_form.html
#: apps/publisher/views.py
msgid "PARTNER MANAGER"
msgstr ""
......@@ -736,10 +736,12 @@ msgid "PUBLISHER"
msgstr ""
#: apps/publisher/views.py
#, python-brace-format
msgid ""
"EdX will create a Studio instance for this course. You will receive a "
"notification message at {email} when the Studio instance has been created."
"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."
msgstr ""
#: apps/publisher/views.py
......@@ -849,6 +851,7 @@ msgstr ""
#: templates/metadata/admin/course_run.html
#: templates/publisher/_add_instructor_popup.html
#: templates/publisher/add_update_course_form.html
#: templates/publisher/course_edit_form.html
msgid "Cancel"
msgstr ""
......@@ -1165,7 +1168,6 @@ msgid ""
msgstr ""
#: templates/publisher/add_courserun_form.html
#: templates/publisher/add_update_course_form.html
msgid "Save Draft"
msgstr ""
......@@ -1181,23 +1183,18 @@ msgstr ""
#: templates/publisher/add_update_course_form.html
#: templates/publisher/courses.html
msgid "Add Course"
msgid "Create New Course"
msgstr ""
#: templates/publisher/add_update_course_form.html
#: templates/publisher/course_edit_form.html
#, python-format
msgid ""
"The information in the Studio Instance section is required before edX can "
"create a Studio instance for the course run."
"To create a parent course, enter the following information about the course "
"and select %(strong_start)sCreate New Course%(strong_end)s."
msgstr ""
#: templates/publisher/add_update_course_form.html
#: 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."
msgid "All of the following information is required."
msgstr ""
#: templates/publisher/add_update_course_form.html
......@@ -1207,19 +1204,6 @@ msgstr ""
#: templates/publisher/add_update_course_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"
msgstr ""
......@@ -1625,6 +1609,21 @@ msgid ""
"3rd or 4th year university student or a masters degree student"
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
msgid "Dashboard"
msgstr ""
......@@ -1690,6 +1689,36 @@ msgid ""
msgstr ""
#: 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"
msgstr ""
......
......@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\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"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
......
......@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\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"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
......
......@@ -152,7 +152,13 @@
}
}
.action-buttons{
@include float(right);
button {
@include margin-left(20px);
}
}
.course-information {
margin-bottom: 30px;
......
......@@ -36,9 +36,6 @@
</p>
</div>
<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="row">
<div class="col col-6 help-text">
......
......@@ -116,6 +116,8 @@
<div class="layout-full publisher-layout layout {% if publisher_hide_features_for_pilot %}hidden{% endif %}">
<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="course-information">
<fieldset class="form-group grid-container grid-manual">
......
......@@ -8,7 +8,7 @@
{% block page_content %}
<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">
{% trans "Add Course" %}
{% trans "Create New Course" %}
</a>
<div class="coursesTable">
<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