${title}
- - % if program.get('is_learner_eligible_for_one_click_purchase'): - - ${_('Purchase the Program')} - - % else: - - ${_('Start Learning')} - - % endif --
-
- - - - ${_('Number of Courses')} - - - ${Text(_('{number_of_courses} courses in program')).format( - number_of_courses=len(courses) - )} - - -
-
-
+ + +++++++
${HTML(program['overview'])}
++ % if job_outlook_items: ++${_('Job Outlook')}
++
-
+ % for item in job_outlook_items:
+
- ${item} + % endfor +
+ % if endorsement: ++${_('Real Career Impact')}
++
+
+
+ + %endif +"${endorsement_quote}"
+ ++++ % if expected_learning_items: +++
${_('What You\'ll Learn')}
+-
+ % for item in expected_learning_items:
+
- ${item} + % endfor +
++-
+
-
+ - ${_('Average Length')} - - + ${_('Average Length')} ++${Text(_('{weeks_to_complete} weeks per course')).format( weeks_to_complete=weeks_to_complete )} - +
-
-
-
+
- +
-- ${_('Effort')} - - + ${_('Effort')} ++${Text(_('{min_hours_effort_per_week}-{max_hours_effort_per_week} hours per week, per course')).format( max_hours_effort_per_week=max_hours_effort_per_week, min_hours_effort_per_week=min_hours_effort_per_week )} - +- - - - ${_('Price (USD)')} - - % if program.get('discount_data') and program['discount_data']['is_discounted']: - - - ${Text(_('${oldPrice}')).format( - oldPrice=full_program_price_format.format(program['discount_data']['total_incl_tax_excl_discounts']) - )} - - - ${Text(_('${newPrice}{htmlEnd} for entire program')).format( - newPrice=full_program_price, - htmlEnd=HTML('') - )} - - ${Text(_('You save ${discount_value} {currency}')).format( - discount_value=full_program_price_format.format(program['discount_data']['discount_value']), - currency=program['discount_data']['currency'] - )} - - - % else: - - ${Text(_('${full_program_price} for entire program')).format( - full_program_price=full_program_price - )} - - % endif -
- - +
-- - - ---${_('Overview')}--- % if job_outlook_items: -${HTML(overview)}
+- +
+ + ${_('Number of Courses')}--- % endif -${_('Job Outlook')}----
- % for item in job_outlook_items:
-
- ${item} - % endfor -
--${_("What You'll Learn")}----
- % for item in expected_learning_items:
-
- ${item} - % endfor -
-- - % try: - <%include file="_${program_type_slug}_faq.html" args="program_type=program_type" /> - % except exceptions.TemplateLookupException: - ## pass - % endtry - -${_("Instructors")}---- <% index = 0 %> - % for instructor in instructors: - <% index += 1 %> ---- %endfor ---- --- -
- - % if instructor.get('position'): --${instructor['position'].get('organization_name')}- % endif -- - ---- --------
- ${instructor.get('name')} - % if instructor.get('position'): - - ${Text(_('{position} at {organization}')).format( - position=instructor['position'].get('title'), - organization=instructor['position'].get('organization_name') - )} - - % endif -
-${HTML(instructor['bio'])}---${_("FAQ")}----
- % for item in faq:
-
- - ${item['question']} - - - % endfor -
-
-- % if endorsement: - "${endorsement_quote}" - % if endorser: - % if endorsement_image: --- % endif - - ${endorsement_name}, - ${endorsement_position}, - ${endorsement_organization} - - % endif - % endif -
-- ${Text(_('Courses in the {program_type}')).format( - program_type=program_type - )} -
-- % for course in courses: - % if course.get('course_runs'): -\ No newline at end of file diff --git a/openedx/core/djangoapps/catalog/tests/factories.py b/openedx/core/djangoapps/catalog/tests/factories.py index 82156f157d..945f56b3ec 100644 --- a/openedx/core/djangoapps/catalog/tests/factories.py +++ b/openedx/core/djangoapps/catalog/tests/factories.py @@ -144,7 +144,7 @@ class PersonFactory(DictFactoryBase): class EndorserFactory(DictFactoryBase): - person = PersonFactory() + endorser = PersonFactory() quote = factory.Faker('sentence') @@ -157,16 +157,22 @@ class FAQFactory(DictFactoryBase): question = factory.Faker('sentence') +class CorporateEndorsementFactory(DictFactoryBase): + corporation_name = factory.Faker('company') + image = ImageFactory() + individual_endorsements = factory.LazyFunction(partial(generate_instances, EndorserFactory)) + + class ProgramFactory(DictFactoryBase): authoring_organizations = factory.LazyFunction(partial(generate_instances, OrganizationFactory, count=1)) applicable_seat_types = [] banner_image = factory.LazyFunction(generate_sized_stdimage) card_image_url = factory.Faker('image_url') + corporate_endorsements = factory.LazyFunction(partial(generate_instances, CorporateEndorsementFactory)) courses = factory.LazyFunction(partial(generate_instances, CourseFactory)) expected_learning_items = factory.LazyFunction(partial(generate_instances, CourseFactory)) faq = factory.LazyFunction(partial(generate_instances, FAQFactory)) hidden = False - individual_endorsements = factory.LazyFunction(partial(generate_instances, EndorserFactory)) is_program_eligible_for_one_click_purchase = True job_outlook_items = factory.LazyFunction(partial(generate_instances, JobOutlookItemFactory)) marketing_slug = factory.Faker('slug')-- --+--- ${course['title']} - - - - ${Text(_('Starts {course_start_datetime}')).format( - course_start_datetime=datetime.strptime(course['course_runs'][0]['start'], '%Y-%m-%dT%H:%M:%SZ').strftime('%B %-d, %Y') - )} - - - % if course['course_runs'][0]['pacing_type'] == "instructor_paced": - ${_('Instructor - Paced')} - % else: - ${_('Self - Paced')} - % endif - -
- - -
+++ % endfor++ % for course in courses: + <% + course_run = course['course_runs'][0] + course_img = course_run.get('image') + %> ++++ ${_('Courses in the {}').format( + program_type + )} +
++++ % if course_img: +++ % endif +
+ - % endif - % endfor -- +${course_run['short_description']}+ ++++ ${Text(_('Starts on {}')).format( + datetime.strptime(course_run['start'], '%Y-%m-%dT%H:%M:%SZ').strftime('%B %-d, %Y') + )} ++ % if program.get('is_learner_eligible_for_one_click_purchase') != True: + % if course_run['is_enrollment_open'] and course_run['can_enroll'] and not course_run['is_course_ended']: ++ Enroll Now ++ % else: + + % endif + % endif +- - ++
+++ % for instructor in instructors: ++- -${_('Instructors')}
++ % endfor ++++
${instructor['name']}+${instructor['position']['position']}+${instructor['position']['organization_name']}+
+ % if faqs: +++ % endif +++ % for faq in faqs: +${_('Frequently Asked Questions')}
+++ % endfor + ++ ${faq['question']} +++ ${faq['answer']} ++