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">
......
......@@ -13,7 +13,7 @@
{% if edit_mode %}
{% trans "Edit Course" %}
{% else %}
{% trans "Add Course" %}
{% trans "Create New Course" %}
{% endif %}
</h1>
......@@ -26,10 +26,10 @@
{% endfor %}
{% endif %}
<p>
{% trans "The information in the Studio Instance section is required before edX can create a Studio instance for the course run." %}
</p>
<p class="{% if publisher_hide_features_for_pilot %}hidden{% endif %}">
{% trans "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." %}
{% blocktrans with strong_start='<strong>' strong_end='</strong>' trimmed %}
To create a parent course, enter the following information about the course and select {{ strong_start }}Create New Course{{ strong_end }}.
{% endblocktrans %}
<strong class="required">{% trans "All of the following information is required." %}</strong>
</p>
<form class="form" method="post" action="" enctype="multipart/form-data">
{% csrf_token %}
......@@ -38,26 +38,8 @@
<h2 class="layout-title">{% trans "Studio Instance" %}</h2>
<div class="card course-form">
<p class="required">
{% trans "This information is required before edX can create a Studio instance for a course run." %}
</p>
<div class="course-information">
<fieldset class="form-group grid-container grid-manual">
<div class="field-title">{% trans "PARTNER MANAGER" %}</div>
<div class="row">
<div class="col col-6 help-text">
{% trans "EdX recommends that you contact a partner manager before you begin to plan a new course. " %}
</div>
<div class="col col-6">
<label class="field-label">
{{ run_form.contacted_partner_manager.label_tag }}
</label>
<div class="checkbox-inline">{{ run_form.contacted_partner_manager}}</div>
</div>
</div>
<div class="field-title">{% trans "COURSE TITLE" %}</div>
<div class="row">
<div class="col col-6 help-text">
......@@ -113,14 +95,16 @@
{% endif %}
{% endif %}
<label class="field-label">
{{ course_form.team_admin.label_tag }}
{{ course_form.team_admin.label_tag }} <span class="required">*</span>
</label>
<div class="field-value">
{% if edit_mode %}{{ team_admin_name }}{% endif %}</div>
{{ course_form.team_admin }}
<label class="field-label ">{{ course_form.title.label }}</label>
<label class="field-label ">
{{ course_form.title.label }} <span class="required">*</span>
</label>
{% if edit_mode %}<div class="field-value">{{ course_form.title.value }}</div>{% endif %}
{{ course_form.title }}
</div>
......@@ -143,7 +127,7 @@
</ul>
</div>
<div class="col col-6">
<label class="field-label ">{{ run_form.start.label_tag }}</label>
<label class="field-label ">{{ run_form.start.label_tag }} <span class="required">*</span></label>
{{ run_form.start }}
</div>
</div>
......@@ -155,7 +139,7 @@
{% trans "Specify a month, day, and year. If you are unsure of the exact date, specify a day that is close to the estimated end date. For example, if your course will end near the end of March, specify March 31." %}
</div>
<div class="col col-6">
<label class="field-label ">{{ run_form.end.label_tag }}</label>
<label class="field-label ">{{ run_form.end.label_tag }} <span class="required">*</span></label>
{{ run_form.end }}
</div>
</div>
......@@ -167,7 +151,7 @@
<p>{% trans "Self-paced courses do not have individual assignments that have specific due dates before the course end date. All assignments are due on the course end date." %}</p>
</div>
<div class="col col-6">
<label class="field-label">{{ run_form.pacing_type.label_tag }}</label>
<label class="field-label">{{ run_form.pacing_type.label_tag }} <span class="required">*</span></label>
<div class="checkbox-inline">{{ run_form.pacing_type }}</div>
</div>
</div>
......@@ -179,7 +163,7 @@
<p>{% trans "If a course consists of several modules, the course number can have an ending such as .1x or .2x." %}</p>
</div>
<div class="col col-6">
<label class="field-label ">{{ course_form.number.label_tag }}</label>
<label class="field-label ">{{ course_form.number.label_tag }} <span class="required">*</span></label>
{% if edit_mode %}{{ course_form.number.value }}{% endif %}
{{ course_form.number }}
</div>
......@@ -192,7 +176,7 @@
<p>{% trans "This is the course studio URL." %}</p>
</div>
<div class="col col-6">
<label class="field-label ">{{ run_form.lms_course_id.label_tag }}</label>
<label class="field-label ">{{ run_form.lms_course_id.label_tag }} <span class="required">*</span></label>
{% if is_internal_user %}
{{ run_form.lms_course_id }}
{% else %}
......@@ -213,8 +197,8 @@
</div>
</div>
<div class="layout-full publisher-layout layout {% if publisher_hide_features_for_pilot %}hidden{% endif %}">
{% if edit_mode %}
<div id="about-page" class="layout-full publisher-layout layout {% if publisher_hide_features_for_pilot %}hidden{% endif %}">
<h2 class="layout-title">{% trans "About page information" %}</h2>
<div class="card course-form">
<div class="course-information">
......@@ -540,16 +524,23 @@
</fieldset>
</div>
</div>
</div>
</div>
{% endif %}
<div class="layout-full layout">
<div class="course-form">
<div class="course-information">
<fieldset class="form-group grid-container grid-manual">
<button class="btn-brand btn-base" type="submit">{% trans "Save Draft" %}</button>
</fieldset>
</div>
<p>{% trans "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." %}</p>
<p>{% trans "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." %}</p>
</div>
<div class="course-form">
<div class="course-information action-buttons">
<a href="{% url 'publisher:publisher_courses' %}">{% trans "Cancel" %}</a>
<button class="btn-brand btn-base" type="submit">
{% if edit_mode %}
{% trans "Edit Course" %}
{% else %}
{% trans "Create New Course" %}
{% endif %}
</button>
</div>
</div>
......
......@@ -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