Commit 5f0d3551 by Victor Shnayder Committed by John Jarvis

show proper course will-start/started/ended text on dashboard

parent ba068455
...@@ -250,6 +250,10 @@ class CourseDescriptor(SequenceDescriptor): ...@@ -250,6 +250,10 @@ class CourseDescriptor(SequenceDescriptor):
displayed_start = self._try_parse_time('advertised_start') or self.start displayed_start = self._try_parse_time('advertised_start') or self.start
return time.strftime("%b %d, %Y", displayed_start) return time.strftime("%b %d, %Y", displayed_start)
@property
def end_date_text(self):
return time.strftime("%b %d, %Y", self.end)
# An extra property is used rather than the wiki_slug/number because # An extra property is used rather than the wiki_slug/number because
# there are courses that change the number for different runs. This allows # there are courses that change the number for different runs. This allows
# courses to share the same css_class across runs even if they have # courses to share the same css_class across runs even if they have
......
...@@ -137,7 +137,15 @@ ...@@ -137,7 +137,15 @@
<h3>${course.number} ${course.title}</h3> <h3>${course.number} ${course.title}</h3>
</hgroup> </hgroup>
<section class="course-status course-status-completed"> <section class="course-status course-status-completed">
<p><!-- Class Starts - <span>${course.start_date_text}</span> --> Course Completed - <span>Nov 6, 2012</span></p> <p>
% if course.has_ended():
Course Completed - <span>${course.end_date_text}</span>
% elif course.has_started():
Course Started - <span>${course.start_date_text}</span>
% else: # hasn't started yet
Course Starts - <span>${course.start_date_text}</span>
% endif
</p>
</section> </section>
% if course.id in show_courseware_links_for: % if course.id in show_courseware_links_for:
<p class="enter-course">View Courseware</p> <p class="enter-course">View Courseware</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