From 93df9c4c303c10591db046b4ecb0036677a9deea Mon Sep 17 00:00:00 2001 From: Chris Dodge Date: Fri, 2 Aug 2013 09:41:02 -0400 Subject: [PATCH] resolve merge conflicts --- cms/templates/widgets/header.html | 2 +- common/lib/xmodule/xmodule/course_module.py | 25 +++++++++++++++++++ lms/djangoapps/course_wiki/views.py | 2 +- lms/djangoapps/courseware/courses.py | 4 +-- lms/templates/course.html | 4 +-- lms/templates/courseware/course_about.html | 19 +++++++++++++- lms/templates/courseware/courseware.html | 2 +- lms/templates/courseware/info.html | 2 +- .../courseware/mktg_course_about.html | 4 +-- lms/templates/courseware/progress.html | 2 +- lms/templates/courseware/static_tab.html | 2 +- lms/templates/courseware/syllabus.html | 2 +- lms/templates/dashboard.html | 16 ++++++++++-- lms/templates/discussion/index.html | 2 +- lms/templates/discussion/single_thread.html | 2 +- lms/templates/discussion/user_profile.html | 2 +- lms/templates/instructor/staff_grading.html | 2 +- lms/templates/navigation.html | 2 +- .../combined_notifications.html | 2 +- .../open_ended_flagged_problems.html | 2 +- .../open_ended_problems.html | 2 +- lms/templates/static_htmlbook.html | 3 ++- lms/templates/static_pdfbook.html | 3 ++- lms/templates/staticbook.html | 2 +- lms/templates/test_center_register.html | 4 +-- 25 files changed, 85 insertions(+), 29 deletions(-) diff --git a/cms/templates/widgets/header.html b/cms/templates/widgets/header.html index 6178058689..9e39bae749 100644 --- a/cms/templates/widgets/header.html +++ b/cms/templates/widgets/header.html @@ -13,7 +13,7 @@

${_("Current Course:")} - ${ctx_loc.org}${ctx_loc.course} + ${context_course.display_org_with_default}${context_course.display_number_with_default} ${context_course.display_name_with_default}

diff --git a/common/lib/xmodule/xmodule/course_module.py b/common/lib/xmodule/xmodule/course_module.py index 3c9f5c0683..b6ac48b7f5 100644 --- a/common/lib/xmodule/xmodule/course_module.py +++ b/common/lib/xmodule/xmodule/course_module.py @@ -362,6 +362,11 @@ class CourseFields(object): # Explicit comparison to True because we always want to return a bool. hide_progress_tab = Boolean(help="DO NOT USE THIS", scope=Scope.settings) + display_organization = String(help="An optional display string for the course organization that will get rendered in the LMS", + scope=Scope.settings) + + display_coursenumber = String(help="An optional display string for the course number that will get rendered in the LMS", + scope=Scope.settings) class CourseDescriptor(CourseFields, SequenceDescriptor): module_class = SequenceModule @@ -933,6 +938,26 @@ class CourseDescriptor(CourseFields, SequenceDescriptor): def number(self): return self.location.course + @property + def display_number_with_default(self): + """ + Return a display course number if it has been specified, otherwise return the 'course' that is in the location + """ + if self.display_coursenumber: + return self.display_coursenumber + + return self.location.course + @property def org(self): return self.location.org + + @property + def display_org_with_default(self): + """ + Return a display organization if it has been specified, otherwise return the 'org' that is in the location + """ + if self.display_organization: + return self.display_organization + + return self.location.org diff --git a/lms/djangoapps/course_wiki/views.py b/lms/djangoapps/course_wiki/views.py index 74ef7d4a74..e92598a9a5 100644 --- a/lms/djangoapps/course_wiki/views.py +++ b/lms/djangoapps/course_wiki/views.py @@ -95,7 +95,7 @@ def course_wiki_redirect(request, course_id): root, course_slug, title=course_slug, - content="This is the wiki for **{0}**'s _{1}_.".format(course.org, course.display_name_with_default), + content="This is the wiki for **{0}**'s _{1}_.".format(course.display_org_with_default, course.display_name_with_default), user_message="Course page automatically created.", user=None, ip_address=None, diff --git a/lms/djangoapps/courseware/courses.py b/lms/djangoapps/courseware/courses.py index 91ec14011e..086f92a123 100644 --- a/lms/djangoapps/courseware/courses.py +++ b/lms/djangoapps/courseware/courses.py @@ -174,9 +174,9 @@ def get_course_about_section(course, section_key): elif section_key == "title": return course.display_name_with_default elif section_key == "university": - return course.location.org + return course.display_org_with_default elif section_key == "number": - return course.number + return course.display_number_with_default raise KeyError("Invalid about key " + str(section_key)) diff --git a/lms/templates/course.html b/lms/templates/course.html index ddbae2c715..01581ed764 100644 --- a/lms/templates/course.html +++ b/lms/templates/course.html @@ -14,13 +14,13 @@ from courseware.courses import course_image_url, get_course_about_section
-

${course.number} ${get_course_about_section(course, 'title')}

+

${course.display_number_with_default} ${get_course_about_section(course, 'title')}

- ${course.number} ${get_course_about_section(course, 'title')} Cover Image + ${course.display_number_with_default} ${get_course_about_section(course, 'title')} Cover Image

${get_course_about_section(course, 'short_description')}

diff --git a/lms/templates/courseware/course_about.html b/lms/templates/courseware/course_about.html index b1bc715e9a..36cb7054d0 100644 --- a/lms/templates/courseware/course_about.html +++ b/lms/templates/courseware/course_about.html @@ -66,7 +66,11 @@ +<<<<<<< HEAD <%block name="title">${_("About {course.number}").format(course=course)} +======= +<%block name="title">About ${course.display_number_with_default} +>>>>>>> add display_coursenumber and display_organization fields on the CourseModule, with some property accessors. Update LMS/CMS pages to use those display strings as appropraite.
@@ -75,7 +79,7 @@

- ${course.number}: ${get_course_about_section(course, "title")} + ${course.display_number_with_default}: ${get_course_about_section(course, "title")} % if not self.theme_enabled(): ${get_course_about_section(course, "university")} % endif @@ -87,13 +91,21 @@ %if show_courseware_link: %endif +<<<<<<< HEAD ${_("You are registered for this course {course.number}").format(course=course)} +======= + You are registered for this course (${course.display_number_with_default}) +>>>>>>> add display_coursenumber and display_organization fields on the CourseModule, with some property accessors. Update LMS/CMS pages to use those display strings as appropraite. %if show_courseware_link: ${_("View Courseware")} %endif %else: +<<<<<<< HEAD ${_("Register for {course.number}").format(course=course)} +======= + Register for ${course.display_number_with_default} +>>>>>>> add display_coursenumber and display_organization fields on the CourseModule, with some property accessors. Update LMS/CMS pages to use those display strings as appropraite.
%endif

@@ -162,8 +174,13 @@
    +<<<<<<< HEAD
  1. ${_("Course Number")}

    ${course.number}
  2. ${_("Classes Start")}

    ${course.start_date_text}
  3. +======= +
  4. Course Number

    ${course.display_number_with_default}
  5. +
  6. Classes Start

    ${course.start_date_text}
  7. +>>>>>>> add display_coursenumber and display_organization fields on the CourseModule, with some property accessors. Update LMS/CMS pages to use those display strings as appropraite. ## We plan to ditch end_date (which is not stored in course metadata), ## but for backwards compatibility, show about/end_date blob if it exists. diff --git a/lms/templates/courseware/courseware.html b/lms/templates/courseware/courseware.html index 8d033434f0..cb7a2f96fc 100644 --- a/lms/templates/courseware/courseware.html +++ b/lms/templates/courseware/courseware.html @@ -2,7 +2,7 @@ <%inherit file="/main.html" /> <%namespace name='static' file='/static_content.html'/> <%block name="bodyclass">courseware ${course.css_class} -<%block name="title">${_("{course_number} Courseware").format(course_number=course.number)} +<%block name="title">${_("{course_number} Courseware").format(course_number=course.display_number_with_default)} <%block name="headextra"> <%static:css group='course'/> diff --git a/lms/templates/courseware/info.html b/lms/templates/courseware/info.html index 4bb961428e..4d889b35f7 100644 --- a/lms/templates/courseware/info.html +++ b/lms/templates/courseware/info.html @@ -7,7 +7,7 @@ <%static:css group='course'/> -<%block name="title">${_("{course.number} Course Info").format(course=course)} +<%block name="title">${_("{course.number} Course Info").format(course=course.display_number_with_default)} <%include file="/courseware/course_navigation.html" args="active_page='info'" /> <%! diff --git a/lms/templates/courseware/mktg_course_about.html b/lms/templates/courseware/mktg_course_about.html index a2c1bd7d0a..46f2060bbc 100644 --- a/lms/templates/courseware/mktg_course_about.html +++ b/lms/templates/courseware/mktg_course_about.html @@ -8,7 +8,7 @@ <%inherit file="../mktg_iframe.html" /> -<%block name="title">${_("About {course_number}").format(course_number=course.number)} +<%block name="title">${_("About {course_number}").format(course_number=course.display_number_with_default)} <%block name="bodyclass">view-partial-mktgregister @@ -52,7 +52,7 @@
    ${_("You Are Registered")}
    %endif %elif allow_registration: - ${_("Register for")} ${course.number} + ${_("Register for")} ${course.display_number_with_default} %else:
    ${_("Registration Is Closed")}
    %endif diff --git a/lms/templates/courseware/progress.html b/lms/templates/courseware/progress.html index 51feed23ab..105ccebe86 100644 --- a/lms/templates/courseware/progress.html +++ b/lms/templates/courseware/progress.html @@ -8,7 +8,7 @@ <%namespace name="progress_graph" file="/courseware/progress_graph.js"/> -<%block name="title">${_("{course_number} Progress").format(course_number=course.number)} +<%block name="title">${_("{course_number} Progress").format(course_number=course.display_number_with_default)} <%! from django.core.urlresolvers import reverse diff --git a/lms/templates/courseware/static_tab.html b/lms/templates/courseware/static_tab.html index 5b6e1480dd..884c161496 100644 --- a/lms/templates/courseware/static_tab.html +++ b/lms/templates/courseware/static_tab.html @@ -6,7 +6,7 @@ <%static:css group='course'/> -<%block name="title">${course.number} ${tab['name']} +<%block name="title">${course.display_number_with_default} ${tab['name']} <%include file="/courseware/course_navigation.html" args="active_page='static_tab_{0}'.format(tab['url_slug'])" /> diff --git a/lms/templates/courseware/syllabus.html b/lms/templates/courseware/syllabus.html index f9b5455273..3499193377 100644 --- a/lms/templates/courseware/syllabus.html +++ b/lms/templates/courseware/syllabus.html @@ -6,7 +6,7 @@ <%static:css group='course'/> -<%block name="title">${_("{course.number} Course Info").format(course=course)} +<%block name="title">${_("{course.display_number_with_default} Course Info").format(course=course)} <%include file="/courseware/course_navigation.html" args="active_page='syllabus'" /> <%! diff --git a/lms/templates/dashboard.html b/lms/templates/dashboard.html index 6356b64209..2c565cfd9c 100644 --- a/lms/templates/dashboard.html +++ b/lms/templates/dashboard.html @@ -140,11 +140,19 @@ % if course.id in show_courseware_links_for: +<<<<<<< HEAD ${_('{course_number} {course_name} Cover Image').format(course_number='${course.number}', course_name='${course.display_name_with_default}')} % else:
    ${_('{course_number} {course_name} Cover Image').format(course_number='${course.number}', course_name='${course.display_name_with_default}')} +======= + ${course.display_number_with_default} ${course.display_name_with_default} Cover Image + + % else: +
    + ${course.display_number_with_default} ${course.display_name_with_default} Cover Image +>>>>>>> add display_coursenumber and display_organization fields on the CourseModule, with some property accessors. Update LMS/CMS pages to use those display strings as appropraite.
    % endif @@ -162,9 +170,9 @@

    ${get_course_about_section(course, 'university')}

    % if course.id in show_courseware_links_for: - ${course.number} ${course.display_name_with_default} + ${course.display_number_with_default} ${course.display_name_with_default} % else: - ${course.number} ${course.display_name_with_default} + ${course.display_number_with_default} ${course.display_name_with_default} % endif

    @@ -197,6 +205,7 @@ % endif % if registration.is_rejected:
    +<<<<<<< HEAD

    ${_("Your registration for the Pearson exam has been rejected. Please {link_start}see your registration status details{link_end}.").format( link_start=''.format(url=testcenter_register_target), @@ -206,6 +215,9 @@ link_end='', email="exam-help@edx.org", )} +======= +

    Your registration for the Pearson exam has been rejected. Please see your registration status details. Otherwise contact edX at exam-help@edx.org for further help.

    +>>>>>>> add display_coursenumber and display_organization fields on the CourseModule, with some property accessors. Update LMS/CMS pages to use those display strings as appropraite.
    % endif % if not registration.is_accepted and not registration.is_rejected: diff --git a/lms/templates/discussion/index.html b/lms/templates/discussion/index.html index 3b6937b7d5..de53433790 100644 --- a/lms/templates/discussion/index.html +++ b/lms/templates/discussion/index.html @@ -6,7 +6,7 @@ <%inherit file="../main.html" /> <%namespace name='static' file='../static_content.html'/> <%block name="bodyclass">discussion -<%block name="title">${_("Discussion - {course_number}").format(course_number=course.number) | h} +<%block name="title">${_("Discussion - {course_number}").format(course_number=course.display_number_with_default) | h} <%block name="headextra"> <%static:css group='course'/> diff --git a/lms/templates/discussion/single_thread.html b/lms/templates/discussion/single_thread.html index 6aae08a7a7..5bd6c6ca03 100644 --- a/lms/templates/discussion/single_thread.html +++ b/lms/templates/discussion/single_thread.html @@ -7,7 +7,7 @@ <%inherit file="../main.html" /> <%namespace name='static' file='../static_content.html'/> <%block name="bodyclass">discussion -<%block name="title">${_("Discussion - {course_number}").format(course_number=course.number) | h} +<%block name="title">${_("Discussion - {course_number}").format(course_number=course.display_number_with_default) | h} <%block name="headextra"> <%static:css group='course'/> diff --git a/lms/templates/discussion/user_profile.html b/lms/templates/discussion/user_profile.html index 1c1901c10b..dbfa79d4e7 100644 --- a/lms/templates/discussion/user_profile.html +++ b/lms/templates/discussion/user_profile.html @@ -4,7 +4,7 @@ <%inherit file="../main.html" /> <%namespace name='static' file='../static_content.html'/> <%block name="bodyclass">discussion -<%block name="title">${_("Discussion - {course_number}").format(course_number=course.number) | h} +<%block name="title">${_("Discussion - {course_number}").format(course_number=course.display_number_with_default) | h} <%block name="headextra"> <%static:css group='course'/> diff --git a/lms/templates/instructor/staff_grading.html b/lms/templates/instructor/staff_grading.html index fb6766fe15..fee2275927 100644 --- a/lms/templates/instructor/staff_grading.html +++ b/lms/templates/instructor/staff_grading.html @@ -7,7 +7,7 @@ <%static:css group='course'/> -<%block name="title">${_("{course_number} Staff Grading").format(course_number=course.number)} +<%block name="title">${_("{course_number} Staff Grading").format(course_number=course.display_number_with_default)} <%include file="/courseware/course_navigation.html" args="active_page='staff_grading'" /> diff --git a/lms/templates/navigation.html b/lms/templates/navigation.html index 589d12666d..3ca3ae2d1d 100644 --- a/lms/templates/navigation.html +++ b/lms/templates/navigation.html @@ -50,7 +50,7 @@ site_status_msg = get_site_status_msg(course_id) % if course: -

    ${course.org}: ${course.number} ${course.display_name_with_default}

    +

    ${course.display_org_with_default}: ${course.display_number_with_default} ${course.display_name_with_default}

    % endif % if user.is_authenticated(): diff --git a/lms/templates/open_ended_problems/combined_notifications.html b/lms/templates/open_ended_problems/combined_notifications.html index 86eb4083dd..b1149194d9 100644 --- a/lms/templates/open_ended_problems/combined_notifications.html +++ b/lms/templates/open_ended_problems/combined_notifications.html @@ -7,7 +7,7 @@ <%static:css group='course'/> -<%block name="title">${_("{course_number} Combined Notifications").format(course_number=course.number)} +<%block name="title">${_("{course_number} Combined Notifications").format(course_number=course.display_number_with_default)} <%include file="/courseware/course_navigation.html" args="active_page='open_ended'" /> diff --git a/lms/templates/open_ended_problems/open_ended_flagged_problems.html b/lms/templates/open_ended_problems/open_ended_flagged_problems.html index ab60e54300..61ec49584c 100644 --- a/lms/templates/open_ended_problems/open_ended_flagged_problems.html +++ b/lms/templates/open_ended_problems/open_ended_flagged_problems.html @@ -7,7 +7,7 @@ <%static:css group='course'/> -<%block name="title">${_("{course_number} Flagged Open Ended Problems").format(course_number=course.number)} +<%block name="title">${_("{course_number} Flagged Open Ended Problems").format(course_number=course.display_number_with_default)} <%include file="/courseware/course_navigation.html" args="active_page='open_ended_flagged_problems'" /> diff --git a/lms/templates/open_ended_problems/open_ended_problems.html b/lms/templates/open_ended_problems/open_ended_problems.html index 56b269d8b7..e8496b6647 100644 --- a/lms/templates/open_ended_problems/open_ended_problems.html +++ b/lms/templates/open_ended_problems/open_ended_problems.html @@ -7,7 +7,7 @@ <%static:css group='course'/> -<%block name="title">${_("{course_number} Open Ended Problems").format(course_number=course.number)} +<%block name="title">${_("{course_number} Open Ended Problems").format(course_number=course.display_number_with_default)} <%include file="/courseware/course_navigation.html" args="active_page='open_ended_problems'" /> diff --git a/lms/templates/static_htmlbook.html b/lms/templates/static_htmlbook.html index 67274e30c9..9f8f4bb3d5 100644 --- a/lms/templates/static_htmlbook.html +++ b/lms/templates/static_htmlbook.html @@ -2,7 +2,8 @@ <%inherit file="main.html" /> <%namespace name='static' file='static_content.html'/> -<%block name="title">${_('{course_number} Textbook').format(course_number=course.number)} +<%block name="title">${_('{course_number} Textbook').format(course_number=course.display_number_with_default)} + <%block name="headextra"> diff --git a/lms/templates/static_pdfbook.html b/lms/templates/static_pdfbook.html index dfa7a47157..a38e9ff541 100644 --- a/lms/templates/static_pdfbook.html +++ b/lms/templates/static_pdfbook.html @@ -5,7 +5,8 @@ <%block name="title"> -${_('{course_number} Textbook').format(course_number=course.number)} +${_('{course_number} Textbook').format(course_number=course.display_number_with_default)} + <%block name="headextra"> diff --git a/lms/templates/staticbook.html b/lms/templates/staticbook.html index 980448b482..157af3a061 100644 --- a/lms/templates/staticbook.html +++ b/lms/templates/staticbook.html @@ -2,7 +2,7 @@ <%inherit file="main.html" /> <%namespace name='static' file='static_content.html'/> -<%block name="title">${_("{course_number} Textbook").format(course_number=course.number)} +<%block name="title">${_("{course_number} Textbook").format(course_number=course.display_number_with_default)} <%block name="headextra"> <%static:css group='course'/> diff --git a/lms/templates/test_center_register.html b/lms/templates/test_center_register.html index df6845e577..ba88cfd6dd 100644 --- a/lms/templates/test_center_register.html +++ b/lms/templates/test_center_register.html @@ -95,7 +95,7 @@
    -

    ${get_course_about_section(course, 'university')} ${course.number} ${course.display_name_with_default}

    +

    ${get_course_about_section(course, 'university')} ${course.display_number_with_default} ${course.display_name_with_default}

    % if registration:

    ${_('Your Pearson VUE Proctored Exam Registration')}

    @@ -442,7 +442,7 @@ % endif
    -

    ${_("About {university} {course_number}").format(university=get_course_about_section(course, 'university'), course_number=course.number)}

    +

    ${_("About {university} {course_number}").format(university=get_course_about_section(course, 'university'), course_number=course.display_number_with_default)}

    % if course.has_ended(): ${_('Course Completed:')} ${course.end_date_text}