Commit ca9cb86a by Victor Shnayder Committed by Carlos Andrés Rocha

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

parent 1b2371d6
......@@ -250,6 +250,10 @@ class CourseDescriptor(SequenceDescriptor):
displayed_start = self._try_parse_time('advertised_start') or self.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
# 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
......
......@@ -137,7 +137,15 @@
<h3>${course.number} ${course.title}</h3>
</hgroup>
<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>
% if course.id in show_courseware_links_for:
<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