Commit 54b69c55 by Clinton Blackburn Committed by Clinton Blackburn

Updated Publisher page titles and breadcrumbs to include course numbers

Internally, the number has more value than the course title.
parent 6ede0f41
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
{% load i18n %} {% load i18n %}
{% load static %} {% load static %}
{% block title %} {% block title %}
{% trans "Course Detail" %} {{ object.number }}
{% endblock title %} {% endblock title %}
{% block page_content %} {% block page_content %}
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
{% load static %} {% load static %}
{% block title %} {% block title %}
{% trans "Course Run Details" %} {{ object.course.number }} - {{ object.start|date:'M Y' }}
{% endblock title %} {% endblock title %}
{% block page_content %} {% block page_content %}
......
...@@ -878,7 +878,13 @@ class CourseRunDetailTests(SiteMixin, TestCase): ...@@ -878,7 +878,13 @@ class CourseRunDetailTests(SiteMixin, TestCase):
self.assertContains(response, '<li class="breadcrumb-item ">') self.assertContains(response, '<li class="breadcrumb-item ">')
self.assertContains(response, '<a href="/publisher/courses/">Courses</a>') self.assertContains(response, '<a href="/publisher/courses/">Courses</a>')
page_url = reverse('publisher:publisher_course_detail', kwargs={'pk': course_run.course.id}) page_url = reverse('publisher:publisher_course_detail', kwargs={'pk': course_run.course.id})
self.assertContains(response, '<a href="{url}">{slug}</a>'.format(url=page_url, slug=course_run.course.title)) self.assertContains(
response,
'<a href="{url}">{number}: {title}</a>'.format(
url=page_url,
number=course_run.course.number,
title=course_run.course.title)
)
self.assertContains(response, '<li class="breadcrumb-item active">') self.assertContains(response, '<li class="breadcrumb-item active">')
self.assertContains( self.assertContains(
response, '{type}: {start}'.format( response, '{type}: {start}'.format(
...@@ -1982,7 +1988,9 @@ class CourseDetailViewTests(TestCase): ...@@ -1982,7 +1988,9 @@ class CourseDetailViewTests(TestCase):
self.assertContains(response, self.course.faq) self.assertContains(response, self.course.faq)
self.assertContains(response, self.course.video_link) self.assertContains(response, self.course.video_link)
self.assertContains(response, self.course.syllabus) self.assertContains(response, self.course.syllabus)
self.assertEqual(response.context['breadcrumbs'][1]['slug'], self.course.title) assert response.context['breadcrumbs'][1]['slug'] == '{number}: {title}'.format(
number=self.course.number,
title=self.course.course_title)
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. """
...@@ -2278,7 +2286,6 @@ class CourseDetailViewTests(TestCase): ...@@ -2278,7 +2286,6 @@ class CourseDetailViewTests(TestCase):
self.assertContains(response, short_description) self.assertContains(response, short_description)
self.assertContains(response, full_description) self.assertContains(response, full_description)
self.assertContains(response, title) self.assertContains(response, title)
self.assertEqual(response.context['breadcrumbs'][1]['slug'], title)
def _assign_user_permission(self): def _assign_user_permission(self):
""" Assign permissions.""" """ Assign permissions."""
......
...@@ -186,10 +186,10 @@ class CourseRunDetailView(mixins.LoginRequiredMixin, mixins.PublisherPermissionM ...@@ -186,10 +186,10 @@ class CourseRunDetailView(mixins.LoginRequiredMixin, mixins.PublisherPermissionM
start_date = course_run.start.strftime("%B %d, %Y") if course_run.start else None start_date = course_run.start.strftime("%B %d, %Y") if course_run.start else None
context['breadcrumbs'] = make_bread_crumbs( context['breadcrumbs'] = make_bread_crumbs(
[ [
(reverse('publisher:publisher_courses'), 'Courses'), (reverse('publisher:publisher_courses'), _('Courses')),
( (
reverse('publisher:publisher_course_detail', kwargs={'pk': course_run.course.id}), reverse('publisher:publisher_course_detail', kwargs={'pk': course_run.course.id}),
course_run.course.title '{number}: {title}'.format(number=course_run.course.number, title=course_run.course.title)
), ),
(None, '{type}: {start}'.format( (None, '{type}: {start}'.format(
type=course_run.get_pacing_type_display(), start=start_date type=course_run.get_pacing_type_display(), start=start_date
...@@ -451,8 +451,8 @@ class CourseDetailView(mixins.LoginRequiredMixin, mixins.PublisherPermissionMixi ...@@ -451,8 +451,8 @@ class CourseDetailView(mixins.LoginRequiredMixin, mixins.PublisherPermissionMixi
context['breadcrumbs'] = make_bread_crumbs( context['breadcrumbs'] = make_bread_crumbs(
[ [
(reverse('publisher:publisher_courses'), 'Courses'), (reverse('publisher:publisher_courses'), _('Courses')),
(None, course.course_title), (None, '{number}: {title}'.format(number=course.number, title=course.course_title)),
] ]
) )
context['comment_object'] = course context['comment_object'] = course
......
...@@ -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-09-28 00:13-0400\n" "POT-Creation-Date: 2017-09-28 12:02-0400\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
...@@ -1431,7 +1431,6 @@ msgid "" ...@@ -1431,7 +1431,6 @@ msgid ""
msgstr "" msgstr ""
#: apps/publisher/templates/publisher/admin/import_course.html #: apps/publisher/templates/publisher/admin/import_course.html
#: apps/publisher/templates/publisher/course_detail.html
msgid "Course Detail" msgid "Course Detail"
msgstr "" msgstr ""
...@@ -1445,7 +1444,7 @@ msgid "Dashboard" ...@@ -1445,7 +1444,7 @@ msgid "Dashboard"
msgstr "" msgstr ""
#: apps/publisher/templates/publisher/base.html #: apps/publisher/templates/publisher/base.html
#: apps/publisher/templates/publisher/course_list.html #: apps/publisher/templates/publisher/course_list.html apps/publisher/views.py
msgid "Courses" msgid "Courses"
msgstr "" msgstr ""
...@@ -2457,10 +2456,6 @@ msgid "Reason for declining preview" ...@@ -2457,10 +2456,6 @@ msgid "Reason for declining preview"
msgstr "" msgstr ""
#: apps/publisher/templates/publisher/course_run_detail/course_run_detail.html #: apps/publisher/templates/publisher/course_run_detail/course_run_detail.html
msgid "Course Run Details"
msgstr ""
#: apps/publisher/templates/publisher/course_run_detail/course_run_detail.html
#, python-format #, python-format
msgid "" msgid ""
"The About page for this course run was published on %(course_publish_date)s." "The About page for this course run was published on %(course_publish_date)s."
......
...@@ -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-09-28 00:13-0400\n" "POT-Creation-Date: 2017-09-28 12:02-0400\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-09-28 00:13-0400\n" "POT-Creation-Date: 2017-09-28 12:02-0400\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
...@@ -1671,7 +1671,6 @@ msgstr "" ...@@ -1671,7 +1671,6 @@ msgstr ""
"möré üsér öptïöns. Ⱡ'σяєм ιρѕυм ∂σłσя ѕιт αмєт, ¢ση#" "möré üsér öptïöns. Ⱡ'σяєм ιρѕυм ∂σłσя ѕιт αмєт, ¢ση#"
#: apps/publisher/templates/publisher/admin/import_course.html #: apps/publisher/templates/publisher/admin/import_course.html
#: apps/publisher/templates/publisher/course_detail.html
msgid "Course Detail" msgid "Course Detail"
msgstr "Çöürsé Détäïl Ⱡ'σяєм ιρѕυм ∂σłσя ѕι#" msgstr "Çöürsé Détäïl Ⱡ'σяєм ιρѕυм ∂σłσя ѕι#"
...@@ -1685,7 +1684,7 @@ msgid "Dashboard" ...@@ -1685,7 +1684,7 @@ msgid "Dashboard"
msgstr "Däshßöärd Ⱡ'σяєм ιρѕυм ∂σł#" msgstr "Däshßöärd Ⱡ'σяєм ιρѕυм ∂σł#"
#: apps/publisher/templates/publisher/base.html #: apps/publisher/templates/publisher/base.html
#: apps/publisher/templates/publisher/course_list.html #: apps/publisher/templates/publisher/course_list.html apps/publisher/views.py
msgid "Courses" msgid "Courses"
msgstr "Çöürsés Ⱡ'σяєм ιρѕυм #" msgstr "Çöürsés Ⱡ'σяєм ιρѕυм #"
...@@ -2897,10 +2896,6 @@ msgid "Reason for declining preview" ...@@ -2897,10 +2896,6 @@ msgid "Reason for declining preview"
msgstr "Réäsön för déçlïnïng prévïéw Ⱡ'σяєм ιρѕυм ∂σłσя ѕιт αмєт, ¢σηѕє¢#" msgstr "Réäsön för déçlïnïng prévïéw Ⱡ'σяєм ιρѕυм ∂σłσя ѕιт αмєт, ¢σηѕє¢#"
#: apps/publisher/templates/publisher/course_run_detail/course_run_detail.html #: apps/publisher/templates/publisher/course_run_detail/course_run_detail.html
msgid "Course Run Details"
msgstr "Çöürsé Rün Détäïls Ⱡ'σяєм ιρѕυм ∂σłσя ѕιт αмєт#"
#: apps/publisher/templates/publisher/course_run_detail/course_run_detail.html
#, python-format #, python-format
msgid "" msgid ""
"The About page for this course run was published on %(course_publish_date)s." "The About page for this course run was published on %(course_publish_date)s."
......
...@@ -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-09-28 00:13-0400\n" "POT-Creation-Date: 2017-09-28 12:02-0400\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
......
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