From f0d2ff7ba4eb1fac00627e72411fb3c3594caead Mon Sep 17 00:00:00 2001 From: cahrens Date: Mon, 8 Apr 2013 09:11:10 -0400 Subject: [PATCH] Change display_timezone to show_timezone. --- common/lib/xmodule/xmodule/course_module.py | 2 +- common/lib/xmodule/xmodule/util/date_utils.py | 10 +++++----- lms/djangoapps/courseware/views.py | 2 +- lms/templates/courseware/accordion.html | 2 +- lms/templates/courseware/progress.html | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/common/lib/xmodule/xmodule/course_module.py b/common/lib/xmodule/xmodule/course_module.py index 8692a9628f..7f73be601a 100644 --- a/common/lib/xmodule/xmodule/course_module.py +++ b/common/lib/xmodule/xmodule/course_module.py @@ -180,7 +180,7 @@ class CourseFields(object): has_children = True checklists = List(scope=Scope.settings) info_sidebar_name = String(scope=Scope.settings, default='Course Handouts') - display_timezone = Boolean(help="True if timezones should be displayed on dates in the courseware", scope=Scope.settings, default=True) + show_timezone = Boolean(help="True if timezones should be shown on dates in the courseware", scope=Scope.settings, default=True) # An extra property is used rather than the wiki_slug/number because # there are courses that change the number for different runs. This allows diff --git a/common/lib/xmodule/xmodule/util/date_utils.py b/common/lib/xmodule/xmodule/util/date_utils.py index e682936c51..1e64856e8f 100644 --- a/common/lib/xmodule/xmodule/util/date_utils.py +++ b/common/lib/xmodule/xmodule/util/date_utils.py @@ -2,17 +2,17 @@ import time import datetime -def get_default_time_display(time_struct, display_timezone=True): +def get_default_time_display(time_struct, show_timezone=True): """ Converts a time struct to a string representation. This is the default representation used in Studio and LMS. - It is of the form "Apr 09, 2013 at 16:00" or "Apr 09, 2013 at 16:00 UTC" - depending on the value of display_timezone. + It is of the form "Apr 09, 2013 at 16:00" or "Apr 09, 2013 at 16:00 UTC", + depending on the value of show_timezone. If None is passed in for time_struct, an empty string will be returned. - The default value of display_timezone is True. + The default value of show_timezone is True. """ - timezone = "" if time_struct is None or not display_timezone else " UTC" + timezone = "" if time_struct is None or not show_timezone else " UTC" return get_time_struct_display(time_struct, "%b %d, %Y at %H:%M") + timezone diff --git a/lms/djangoapps/courseware/views.py b/lms/djangoapps/courseware/views.py index a6aaa0c7e7..714e45842f 100644 --- a/lms/djangoapps/courseware/views.py +++ b/lms/djangoapps/courseware/views.py @@ -94,7 +94,7 @@ def render_accordion(request, course, chapter, section, model_data_cache): context = dict([('toc', toc), ('course_id', course.id), ('csrf', csrf(request)['csrf_token']), - ('display_timezone', course.display_timezone)] + template_imports.items()) + ('show_timezone', course.show_timezone)] + template_imports.items()) return render_to_string('courseware/accordion.html', context) diff --git a/lms/templates/courseware/accordion.html b/lms/templates/courseware/accordion.html index 759ae617e9..157e6e1bec 100644 --- a/lms/templates/courseware/accordion.html +++ b/lms/templates/courseware/accordion.html @@ -11,7 +11,7 @@
  • ${section['display_name']}

    -

    ${section['format']} ${"due " + get_default_time_display(section['due'], display_timezone) if section.get('due') is not None else ''}

    +

    ${section['format']} ${"due " + get_default_time_display(section['due'], show_timezone) if section.get('due') is not None else ''}

  • % endfor diff --git a/lms/templates/courseware/progress.html b/lms/templates/courseware/progress.html index 52d4203c7e..fcd4348f96 100644 --- a/lms/templates/courseware/progress.html +++ b/lms/templates/courseware/progress.html @@ -64,7 +64,7 @@ ${progress_graph.body(grade_summary, course.grade_cutoffs, "grade-detail-graph", %if section.get('due') is not None: - due ${get_default_time_display(section['due'], course.display_timezone)} + due ${get_default_time_display(section['due'], course.show_timezone)} %endif