Commit f0d2ff7b by cahrens

Change display_timezone to show_timezone.

parent 2631452b
......@@ -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
......
......@@ -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
......
......@@ -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)
......
......@@ -11,7 +11,7 @@
<li class="${'active' if 'active' in section and section['active'] else ''} ${'graded' if 'graded' in section and section['graded'] else ''}">
<a href="${reverse('courseware_section', args=[course_id, chapter['url_name'], section['url_name']])}">
<p>${section['display_name']}</p>
<p class="subtitle">${section['format']} ${"due " + get_default_time_display(section['due'], display_timezone) if section.get('due') is not None else ''}</p>
<p class="subtitle">${section['format']} ${"due " + get_default_time_display(section['due'], show_timezone) if section.get('due') is not None else ''}</p>
</a>
</li>
% endfor
......
......@@ -64,7 +64,7 @@ ${progress_graph.body(grade_summary, course.grade_cutoffs, "grade-detail-graph",
%if section.get('due') is not None:
<em>
due ${get_default_time_display(section['due'], course.display_timezone)}
due ${get_default_time_display(section['due'], course.show_timezone)}
</em>
%endif
</p>
......
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