Commit b94af0b1 by Waheed Ahmed

Added FAQ, Video link and learner testimonial fields on detail pages.

ECOM-7619
parent c7cdd3bf
...@@ -131,6 +131,7 @@ class CourseRevisionSerializer(serializers.ModelSerializer): ...@@ -131,6 +131,7 @@ class CourseRevisionSerializer(serializers.ModelSerializer):
fields = ( fields = (
'history_id', 'title', 'number', 'short_description', 'full_description', 'expected_learnings', 'history_id', 'title', 'number', 'short_description', 'full_description', 'expected_learnings',
'prerequisites', 'primary_subject', 'secondary_subject', 'tertiary_subject', 'level_type', 'prerequisites', 'primary_subject', 'secondary_subject', 'tertiary_subject', 'level_type',
'learner_testimonial', 'faq', 'video_link',
) )
def get_primary_subject(self, obj): def get_primary_subject(self, obj):
......
...@@ -207,7 +207,10 @@ class CourseRevisionSerializerTests(TestCase): ...@@ -207,7 +207,10 @@ class CourseRevisionSerializerTests(TestCase):
'primary_subject': revision.primary_subject.name, 'primary_subject': revision.primary_subject.name,
'secondary_subject': revision.secondary_subject.name, 'secondary_subject': revision.secondary_subject.name,
'tertiary_subject': revision.tertiary_subject.name, 'tertiary_subject': revision.tertiary_subject.name,
'level_type': revision.level_type.name 'level_type': revision.level_type.name,
'learner_testimonial': revision.learner_testimonial,
'faq': revision.faq,
'video_link': revision.video_link
} }
self.assertDictEqual(serializer.data, expected) self.assertDictEqual(serializer.data, expected)
...@@ -234,7 +237,10 @@ class CourseRevisionSerializerTests(TestCase): ...@@ -234,7 +237,10 @@ class CourseRevisionSerializerTests(TestCase):
'primary_subject': None, 'primary_subject': None,
'secondary_subject': None, 'secondary_subject': None,
'tertiary_subject': None, 'tertiary_subject': None,
'level_type': None 'level_type': None,
'learner_testimonial': revision.learner_testimonial,
'faq': revision.faq,
'video_link': revision.video_link
} }
self.assertDictEqual(serializer.data, expected) self.assertDictEqual(serializer.data, expected)
......
...@@ -392,7 +392,10 @@ class CourseRevisionDetailViewTests(TestCase): ...@@ -392,7 +392,10 @@ class CourseRevisionDetailViewTests(TestCase):
'primary_subject': revision.primary_subject.name, 'primary_subject': revision.primary_subject.name,
'secondary_subject': revision.secondary_subject.name, 'secondary_subject': revision.secondary_subject.name,
'tertiary_subject': revision.tertiary_subject.name, 'tertiary_subject': revision.tertiary_subject.name,
'level_type': revision.level_type.name 'level_type': revision.level_type.name,
'learner_testimonial': revision.learner_testimonial,
'faq': revision.faq,
'video_link': revision.video_link
} }
response = self._get_response(revision.history_id) response = self._get_response(revision.history_id)
......
...@@ -32,6 +32,8 @@ class CourseFactory(factory.DjangoModelFactory): ...@@ -32,6 +32,8 @@ class CourseFactory(factory.DjangoModelFactory):
primary_subject = factory.SubFactory(factories.SubjectFactory) primary_subject = factory.SubFactory(factories.SubjectFactory)
secondary_subject = factory.SubFactory(factories.SubjectFactory) secondary_subject = factory.SubFactory(factories.SubjectFactory)
tertiary_subject = factory.SubFactory(factories.SubjectFactory) tertiary_subject = factory.SubFactory(factories.SubjectFactory)
faq = FuzzyText(prefix='Frequently asked questions')
video_link = FuzzyText(prefix='http://video.com/çօմɾʂҽ/')
class Meta: class Meta:
model = Course model = Course
......
...@@ -637,7 +637,7 @@ class CourseRunDetailTests(TestCase): ...@@ -637,7 +637,7 @@ class CourseRunDetailTests(TestCase):
'Title', 'Number', 'Course ID', 'Price', 'Sub Title', 'School', 'Subject', 'XSeries', 'Title', 'Number', 'Course ID', 'Price', 'Sub Title', 'School', 'Subject', 'XSeries',
'Start Date', 'End Date', 'Self Paced', 'Staff', 'Estimated Effort', 'Languages', 'Start Date', 'End Date', 'Self Paced', 'Staff', 'Estimated Effort', 'Languages',
'Video Translations', 'Level', 'About this Course', "What you'll learn", 'Video Translations', 'Level', 'About this Course', "What you'll learn",
'Keywords', 'Sponsors', 'Enrollments' 'Keywords', 'Sponsors', 'Enrollments', 'Learner Testimonials', 'FAQ', 'Video Link'
] ]
for field in fields: for field in fields:
self.assertContains(response, field) self.assertContains(response, field)
...@@ -649,7 +649,8 @@ class CourseRunDetailTests(TestCase): ...@@ -649,7 +649,8 @@ class CourseRunDetailTests(TestCase):
self.wrapped_course_run.pacing_type, self.wrapped_course_run.persons, self.wrapped_course_run.pacing_type, self.wrapped_course_run.persons,
self.wrapped_course_run.max_effort, self.wrapped_course_run.language.name, self.wrapped_course_run.max_effort, self.wrapped_course_run.language.name,
self.wrapped_course_run.transcript_languages, self.wrapped_course_run.level_type, self.wrapped_course_run.transcript_languages, self.wrapped_course_run.level_type,
self.wrapped_course_run.expected_learnings self.wrapped_course_run.expected_learnings, self.wrapped_course_run.course.learner_testimonial,
self.wrapped_course_run.course.faq, self.wrapped_course_run.course.video_link
] ]
for value in values: for value in values:
self.assertContains(response, value) self.assertContains(response, value)
...@@ -1598,6 +1599,9 @@ class CourseDetailViewTests(TestCase): ...@@ -1598,6 +1599,9 @@ class CourseDetailViewTests(TestCase):
self.assertContains(response, self.course.short_description) self.assertContains(response, self.course.short_description)
self.assertContains(response, self.course.full_description) self.assertContains(response, self.course.full_description)
self.assertContains(response, self.course.expected_learnings) self.assertContains(response, self.course.expected_learnings)
self.assertContains(response, self.course.learner_testimonial)
self.assertContains(response, self.course.faq)
self.assertContains(response, self.course.video_link)
def test_details_page_with_course_runs_lms_id(self): def test_details_page_with_course_runs_lms_id(self):
""" Test that user can see course runs with lms-id on course detail page. """ """ Test that user can see course runs with lms-id on course detail page. """
......
...@@ -7,14 +7,14 @@ msgid "" ...@@ -7,14 +7,14 @@ 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-04-03 15:32+0500\n" "POT-Creation-Date: 2017-04-03 16:28+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"
"Language: \n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Language: \n"
#: apps/api/filters.py #: apps/api/filters.py
#, python-brace-format #, python-brace-format
...@@ -364,6 +364,9 @@ msgid "Credit" ...@@ -364,6 +364,9 @@ msgid "Credit"
msgstr "" msgstr ""
#: apps/course_metadata/models.py apps/publisher/models.py #: apps/course_metadata/models.py apps/publisher/models.py
#: templates/publisher/course_detail.html
#: templates/publisher/course_revision_history.html
#: templates/publisher/course_run_detail/_drupal.html
msgid "FAQ" msgid "FAQ"
msgstr "" msgstr ""
...@@ -682,7 +685,9 @@ msgstr "" ...@@ -682,7 +685,9 @@ msgstr ""
msgid "Expected Learnings" msgid "Expected Learnings"
msgstr "" msgstr ""
#: apps/publisher/models.py #: apps/publisher/models.py templates/publisher/course_detail.html
#: templates/publisher/course_revision_history.html
#: templates/publisher/course_run_detail/_drupal.html
msgid "Learner Testimonials" msgid "Learner Testimonials"
msgstr "" msgstr ""
...@@ -695,7 +700,9 @@ msgid "" ...@@ -695,7 +700,9 @@ msgid ""
"Last date/time on which verification for this product can be submitted." "Last date/time on which verification for this product can be submitted."
msgstr "" msgstr ""
#: apps/publisher/models.py #: apps/publisher/models.py templates/publisher/course_detail.html
#: templates/publisher/course_revision_history.html
#: templates/publisher/course_run_detail/_drupal.html
msgid "Video Link" msgid "Video Link"
msgstr "" msgstr ""
...@@ -1104,6 +1111,7 @@ msgid "Open Selected Version" ...@@ -1104,6 +1111,7 @@ msgid "Open Selected Version"
msgstr "" msgstr ""
#: templates/publisher/_render_optional_field.html #: templates/publisher/_render_optional_field.html
#: templates/publisher/course_detail.html
#: templates/publisher/course_run_detail/_all.html #: templates/publisher/course_run_detail/_all.html
#: templates/publisher/course_run_detail/_credit_seat.html #: templates/publisher/course_run_detail/_credit_seat.html
#: templates/publisher/course_run_detail/_drupal.html #: templates/publisher/course_run_detail/_drupal.html
......
...@@ -7,14 +7,14 @@ msgid "" ...@@ -7,14 +7,14 @@ 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-04-03 15:32+0500\n" "POT-Creation-Date: 2017-04-03 16:28+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"
"Language: \n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Language: \n"
#: static/js/catalogs-change-form.js #: static/js/catalogs-change-form.js
msgid "Preview" msgid "Preview"
......
...@@ -7,14 +7,14 @@ msgid "" ...@@ -7,14 +7,14 @@ 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-04-03 15:32+0500\n" "POT-Creation-Date: 2017-04-03 16:28+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"
"Language: \n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Language: \n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: apps/api/filters.py #: apps/api/filters.py
...@@ -449,6 +449,9 @@ msgid "Credit" ...@@ -449,6 +449,9 @@ msgid "Credit"
msgstr "Çrédït Ⱡ'σяєм ιρѕυ#" msgstr "Çrédït Ⱡ'σяєм ιρѕυ#"
#: apps/course_metadata/models.py apps/publisher/models.py #: apps/course_metadata/models.py apps/publisher/models.py
#: templates/publisher/course_detail.html
#: templates/publisher/course_revision_history.html
#: templates/publisher/course_run_detail/_drupal.html
msgid "FAQ" msgid "FAQ"
msgstr "FÀQ Ⱡ'σяєм#" msgstr "FÀQ Ⱡ'σяєм#"
...@@ -812,7 +815,9 @@ msgstr "Lévél Týpé Ⱡ'σяєм ιρѕυм ∂σłσ#" ...@@ -812,7 +815,9 @@ msgstr "Lévél Týpé Ⱡ'σяєм ιρѕυм ∂σłσ#"
msgid "Expected Learnings" msgid "Expected Learnings"
msgstr "Éxpéçtéd Léärnïngs Ⱡ'σяєм ιρѕυм ∂σłσя ѕιт αмєт#" msgstr "Éxpéçtéd Léärnïngs Ⱡ'σяєм ιρѕυм ∂σłσя ѕιт αмєт#"
#: apps/publisher/models.py #: apps/publisher/models.py templates/publisher/course_detail.html
#: templates/publisher/course_revision_history.html
#: templates/publisher/course_run_detail/_drupal.html
msgid "Learner Testimonials" msgid "Learner Testimonials"
msgstr "Léärnér Téstïmönïäls Ⱡ'σяєм ιρѕυм ∂σłσя ѕιт αмєт, #" msgstr "Léärnér Téstïmönïäls Ⱡ'σяєм ιρѕυм ∂σłσя ѕιт αмєт, #"
...@@ -827,7 +832,9 @@ msgstr "" ...@@ -827,7 +832,9 @@ msgstr ""
"Läst däté/tïmé ön whïçh vérïfïçätïön för thïs prödüçt çän ßé süßmïttéd. " "Läst däté/tïmé ön whïçh vérïfïçätïön för thïs prödüçt çän ßé süßmïttéd. "
"Ⱡ'σяєм ιρѕυм ∂σłσя ѕιт αмєт, ¢σηѕє¢тєтυя#" "Ⱡ'σяєм ιρѕυм ∂σłσя ѕιт αмєт, ¢σηѕє¢тєтυя#"
#: apps/publisher/models.py #: apps/publisher/models.py templates/publisher/course_detail.html
#: templates/publisher/course_revision_history.html
#: templates/publisher/course_run_detail/_drupal.html
msgid "Video Link" msgid "Video Link"
msgstr "Vïdéö Lïnk Ⱡ'σяєм ιρѕυм ∂σłσ#" msgstr "Vïdéö Lïnk Ⱡ'σяєм ιρѕυм ∂σłσ#"
...@@ -1277,6 +1284,7 @@ msgid "Open Selected Version" ...@@ -1277,6 +1284,7 @@ msgid "Open Selected Version"
msgstr "Öpén Séléçtéd Vérsïön Ⱡ'σяєм ιρѕυм ∂σłσя ѕιт αмєт, #" msgstr "Öpén Séléçtéd Vérsïön Ⱡ'σяєм ιρѕυм ∂σłσя ѕιт αмєт, #"
#: templates/publisher/_render_optional_field.html #: templates/publisher/_render_optional_field.html
#: templates/publisher/course_detail.html
#: templates/publisher/course_run_detail/_all.html #: templates/publisher/course_run_detail/_all.html
#: templates/publisher/course_run_detail/_credit_seat.html #: templates/publisher/course_run_detail/_credit_seat.html
#: templates/publisher/course_run_detail/_drupal.html #: templates/publisher/course_run_detail/_drupal.html
......
...@@ -7,14 +7,14 @@ msgid "" ...@@ -7,14 +7,14 @@ 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-04-03 15:32+0500\n" "POT-Creation-Date: 2017-04-03 16:28+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"
"Language: \n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Language: \n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: static/js/catalogs-change-form.js #: static/js/catalogs-change-form.js
......
...@@ -18,7 +18,7 @@ function loadRevisionHistory(revisionUrl) { ...@@ -18,7 +18,7 @@ function loadRevisionHistory(revisionUrl) {
success: function (data) { success: function (data) {
$.each(data, function(key, value) { $.each(data, function(key, value) {
var currentObject = $('.history-field-container').find('.' + key); var currentObject = $('.history-field-container').find('.' + key);
if (currentObject.length) { if (currentObject.length && value != null) {
showDiffCourseDetails(value, currentObject.text(), currentObject.siblings('.show-diff')); showDiffCourseDetails(value, currentObject.text(), currentObject.siblings('.show-diff'));
currentObject.hide(); currentObject.hide();
} }
......
...@@ -150,6 +150,38 @@ ...@@ -150,6 +150,38 @@
</div> </div>
<div class="show-diff"></div> <div class="show-diff"></div>
</div> </div>
<div class="info-item history-field-container">
<div class="heading">{% trans "Learner Testimonials" %}
</div>
<div class="current learner_testimonial">
{% with object.learner_testimonial as field %}
{% include "publisher/_render_optional_field.html" %}
{% endwith %}
</div>
<div class="show-diff"></div>
</div>
<div class="info-item history-field-container">
<div class="heading">{% trans "FAQ" %}
</div>
<div class="current faq">
{% with object.faq as field %}
{% include "publisher/_render_optional_field.html" %}
{% endwith %}
</div>
<div class="show-diff"></div>
</div>
<div class="info-item history-field-container">
<div class="heading">{% trans "Video Link" %}
</div>
{% with object.video_link as value %}
{% if value %}
<a class="current video_link" href="{{ value }}" target="_blank">{{ value }}</a>
{% else %}
{% trans "(Optional) Not yet added" %}
{% endif %}
{% endwith %}
<div class="show-diff"></div>
</div>
</div> </div>
</main> </main>
......
...@@ -99,6 +99,27 @@ ...@@ -99,6 +99,27 @@
<span class="history-object">{{ history_object.level_type }}</span> <span class="history-object">{{ history_object.level_type }}</span>
<span class="show-diff"></span> <span class="show-diff"></span>
</div> </div>
<div class="field-container">
<div class="field-title">{% trans "Learner Testimonials" %}</div>
<span class="object">{{ object.learner_testimonial }}</span>
<span class="history-object">{{ history_object.learner_testimonial }}</span>
<span class="show-diff"></span>
</div>
<div class="field-container">
<div class="field-title">{% trans "FAQ" %}</div>
<span class="object">{{ object.faq }}</span>
<span class="history-object">{{ history_object.faq }}</span>
<span class="show-diff"></span>
</div>
<div class="field-container">
<div class="field-title">{% trans "Video Link" %}</div>
<span class="object">{{ object.video_link }}</span>
<span class="history-object">{{ history_object.video_link }}</span>
<span class="show-diff"></span>
</div>
</div> </div>
{% endblock %} {% endblock %}
......
...@@ -280,6 +280,42 @@ ...@@ -280,6 +280,42 @@
</div> </div>
</div> </div>
<div class="info-item">
<div class="heading">
{% trans "Learner Testimonials" %}
{% include "publisher/course_run_detail/_clipboard.html" %}
</div>
<div class="copy">
{% with object.course.learner_testimonial as field %}
{% include "publisher/_render_optional_field.html" %}
{% endwith %}
</div>
</div>
<div class="info-item">
<div class="heading">
{% trans "FAQ" %}
{% include "publisher/course_run_detail/_clipboard.html" %}
</div>
<div class="copy">
{% with object.course.faq as field %}
{% include "publisher/_render_optional_field.html" %}
{% endwith %}
</div>
</div>
<div class="info-item">
<div class="heading">
{% trans "Video Link" %}
{% include "publisher/course_run_detail/_clipboard.html" %}
</div>
{% with object.course.video_link as value %}
{% if value %}
<a class="copy" href="{{ value }}" target="_blank">{{ value }}</a>
{% else %}
{% trans "(Optional) Not yet added" %}
{% endif %}
{% endwith %}
</div>
<h3 class="hd-3 de-emphasized">{% trans "Enrollments" %}</h3> <h3 class="hd-3 de-emphasized">{% trans "Enrollments" %}</h3>
<div class="info-item"> <div class="info-item">
<div class="heading"> <div class="heading">
......
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