From 93db5acc15d89e50dd3069541e7ea028fe0cc73a Mon Sep 17 00:00:00 2001 From: Calen Pennington Date: Fri, 8 Mar 2013 14:58:04 -0500 Subject: [PATCH] Make display_name defaulting explicit --- cms/djangoapps/contentstore/views.py | 10 +++--- cms/templates/base.html | 6 ++-- cms/templates/edit_subsection.html | 8 ++--- cms/templates/new_item.html | 2 +- cms/templates/overview.html | 6 ++-- cms/templates/unit.html | 8 ++--- cms/templates/widgets/header.html | 4 +-- cms/templates/widgets/sequence-edit.html | 2 +- cms/templates/widgets/units.html | 4 +-- common/djangoapps/student/views.py | 2 +- common/djangoapps/terrain/factories.py | 4 +-- common/djangoapps/xmodule_modifiers.py | 2 +- .../lib/xmodule/xmodule/annotatable_module.py | 2 +- common/lib/xmodule/xmodule/capa_module.py | 2 +- .../lib/xmodule/xmodule/modulestore/mongo.py | 2 +- .../xmodule/modulestore/tests/factories.py | 4 +-- common/lib/xmodule/xmodule/modulestore/xml.py | 2 +- common/lib/xmodule/xmodule/seq_module.py | 14 ++------ .../lib/xmodule/xmodule/tests/test_import.py | 6 ++-- common/lib/xmodule/xmodule/video_module.py | 2 +- .../lib/xmodule/xmodule/videoalpha_module.py | 2 +- common/lib/xmodule/xmodule/x_module.py | 36 ++++++++++++++++++- lms/djangoapps/course_wiki/views.py | 2 +- lms/djangoapps/courseware/courses.py | 4 +-- lms/djangoapps/courseware/features/courses.py | 4 +-- lms/djangoapps/courseware/grades.py | 16 ++++----- lms/djangoapps/courseware/module_render.py | 4 +-- lms/djangoapps/courseware/views.py | 2 +- lms/djangoapps/lms_migration/migrate.py | 2 +- lms/templates/conditional_module.html | 2 +- lms/templates/courseware/welcome-back.html | 4 +-- lms/templates/dashboard.html | 2 +- lms/templates/discussion/index.html | 2 +- lms/templates/navigation.html | 2 +- lms/templates/test_center_register.html | 4 +-- lms/xmodule_namespace.py | 5 --- 36 files changed, 102 insertions(+), 83 deletions(-) diff --git a/cms/djangoapps/contentstore/views.py b/cms/djangoapps/contentstore/views.py index 2a616e0b9e..20ec62e70a 100644 --- a/cms/djangoapps/contentstore/views.py +++ b/cms/djangoapps/contentstore/views.py @@ -135,7 +135,7 @@ def index(request): return render_to_response('index.html', { 'new_course_template': Location('i4x', 'edx', 'templates', 'course', 'Empty'), - 'courses': [(course.lms.display_name, + 'courses': [(course.display_name, reverse('course_index', args=[ course.location.org, course.location.course, @@ -319,7 +319,7 @@ def edit_unit(request, location): if category in component_types: #This is a hack to create categories for different xmodules component_templates[category].append(( - template.lms.display_name, + template.display_name_with_default, template.location.url(), hasattr(template, 'markdown') and template.markdown != '', template.cms.empty, @@ -534,7 +534,7 @@ def get_preview_module(request, preview_id, descriptor): preview_id (str): An identifier specifying which preview this module is used for location: A Location """ - + return load_preview_module(request, preview_id, descriptor) @@ -757,7 +757,7 @@ def clone_item(request): # replace the display name with an optional parameter passed in from the caller if display_name is not None: - new_item.lms.display_name = display_name + new_item.display_name = display_name get_modulestore(template).update_metadata(new_item.location.url(), own_metadata(new_item)) @@ -978,7 +978,7 @@ def reorder_static_tabs(request): for tab in course.tabs: if tab['type'] == 'static_tab': reordered_tabs.append({'type': 'static_tab', - 'name': tab_items[static_tab_idx].lms.display_name, + 'name': tab_items[static_tab_idx].display_name, 'url_slug': tab_items[static_tab_idx].location.name}) static_tab_idx += 1 else: diff --git a/cms/templates/base.html b/cms/templates/base.html index 498897bd11..f7b2c46f61 100644 --- a/cms/templates/base.html +++ b/cms/templates/base.html @@ -6,10 +6,10 @@ - <%block name="title"></%block> | + <%block name="title"></%block> | % if context_course: <% ctx_loc = context_course.location %> - ${context_course.display_name} | + ${context_course.display_name_with_default} | % endif edX Studio @@ -22,7 +22,7 @@ - + <%block name="header_extras"> diff --git a/cms/templates/edit_subsection.html b/cms/templates/edit_subsection.html index edeb939d3c..6ad50e5598 100644 --- a/cms/templates/edit_subsection.html +++ b/cms/templates/edit_subsection.html @@ -22,7 +22,7 @@
- +
@@ -59,11 +59,11 @@
% if subsection.lms.start != parent_item.lms.start and subsection.lms.start: % if parent_start_date is None: -

The date above differs from the release date of ${parent_item.lms.display_name}, which is unset. +

The date above differs from the release date of ${parent_item.display_name_with_default}, which is unset. % else: -

The date above differs from the release date of ${parent_item.lms.display_name} – ${parent_start_date.strftime('%m/%d/%Y')} at ${parent_start_date.strftime('%H:%M')}. +

The date above differs from the release date of ${parent_item.display_name_with_default} – ${parent_start_date.strftime('%m/%d/%Y')} at ${parent_start_date.strftime('%H:%M')}. % endif - Sync to ${parent_item.lms.display_name}.

+ Sync to ${parent_item.display_name_with_default}.

% endif diff --git a/cms/templates/new_item.html b/cms/templates/new_item.html index 3c81b81c7e..45cb157845 100644 --- a/cms/templates/new_item.html +++ b/cms/templates/new_item.html @@ -8,7 +8,7 @@
${module_type}
% for template in module_templates: - ${template.lms.display_name} + ${template.display_name_with_default} % endfor
diff --git a/cms/templates/overview.html b/cms/templates/overview.html index 38b3c29a62..904f654717 100644 --- a/cms/templates/overview.html +++ b/cms/templates/overview.html @@ -154,9 +154,9 @@

- ${section.lms.display_name} + ${section.display_name_with_default} @@ -196,7 +196,7 @@ - ${subsection.lms.display_name} + ${subsection.display_name_with_default}

diff --git a/cms/templates/unit.html b/cms/templates/unit.html index d1312dc1e1..6b37bc2cea 100644 --- a/cms/templates/unit.html +++ b/cms/templates/unit.html @@ -44,7 +44,7 @@
Delete Draft @@ -168,12 +168,12 @@
  1. - ${section.lms.display_name} + ${section.display_name_with_default}
    1. - ${subsection.lms.display_name} + ${subsection.display_name_with_default} ${units.enum_units(subsection, actions=False, selected=unit.location)}
    2. diff --git a/cms/templates/widgets/header.html b/cms/templates/widgets/header.html index 3089ea689d..775346c3d4 100644 --- a/cms/templates/widgets/header.html +++ b/cms/templates/widgets/header.html @@ -12,12 +12,12 @@

      Current Course:

      ${ctx_loc.org}${ctx_loc.course} - ${context_course.lms.display_name} + ${context_course.display_name_with_default}