From 890d528d8032824ba325a655648153bdc4095baa Mon Sep 17 00:00:00 2001 From: Scott Erickson Date: Tue, 17 Nov 2015 16:53:57 -0800 Subject: [PATCH] Fix level session stats in CourseDetailsView --- app/templates/courses/course-details.jade | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/app/templates/courses/course-details.jade b/app/templates/courses/course-details.jade index 5038ada6f..bf7b20852 100644 --- a/app/templates/courses/course-details.jade +++ b/app/templates/courses/course-details.jade @@ -208,10 +208,10 @@ mixin progress-members-levels-expanded(memberID) if userLevelStateMap[memberID][levelID] === 'complete' span.progress-level-cell.progress-level-cell-complete(data-level-id=levelID, data-level-slug=level.slug, data-user-id=memberID) #{i + 1} span.spl= level.name.replace('Course: ', '') - +progress-members-popup-completed(i, level) + +progress-members-popup-completed(i, level, (view.userLevelSessionMap[memberID] || {})[levelID]) else if userLevelStateMap[memberID][levelID] === 'started' span.progress-level-cell.progress-level-cell-started(data-level-id=levelID, data-level-slug=level.slug, data-user-id=memberID) #{i + 1} #{level.name.replace('Course: ', '')} - +progress-members-popup-started(i, level) + +progress-members-popup-started(i, level, (view.userLevelSessionMap[memberID] || {})[levelID]) else span.progress-level-cell #{i + 1} #{level.name.replace('Course: ', '')} - i++ @@ -226,35 +226,35 @@ mixin progress-members-levels-condensed(memberID) each level, levelID in campaign.get('levels') if userLevelStateMap[memberID][levelID] === 'complete' span.progress-level-cell.progress-level-cell-complete(style="width:#{levelCellWidth}%;", data-level-id=levelID, data-level-slug=level.slug, data-user-id=memberID) #{i + 1} - +progress-members-popup-completed(i, level) + +progress-members-popup-completed(i, level, (view.userLevelSessionMap[memberID] || {})[levelID]) else if userLevelStateMap[memberID][levelID] === 'started' span.progress-level-cell.progress-level-cell-started(style="width:#{levelCellWidth}%;", data-level-id=levelID, data-level-slug=level.slug, data-user-id=memberID) #{i + 1} - +progress-members-popup-started(i, level) + +progress-members-popup-started(i, level, (view.userLevelSessionMap[memberID] || {})[levelID]) else break - i++ -mixin progress-members-popup-completed(i, level) +mixin progress-members-popup-completed(i, level, session) .progress-popup-container h3 #{i + 1}. #{level.name.replace('Course: ', '')} p span.spr(data-i18n="courses.play_time") - span #{moment.duration(level.playtime, "seconds").humanize()} + span #{moment.duration(session.get('playtime'), "seconds").humanize()} p span.spr(data-i18n="courses.completed") - span #{moment(level.changed).format('MMMM Do YYYY, h:mm:ss a')} + span #{moment(session.get('changed')).format('MMMM Do YYYY, h:mm:ss a')} if adminMode strong(data-i18n="clans.view_solution") -mixin progress-members-popup-started(i, level) +mixin progress-members-popup-started(i, level, session) .progress-popup-container h3 #{i + 1}. #{level.name.replace('Course: ', '')} p span.spr(data-i18n="courses.play_time") - span #{moment.duration(level.playtime, "seconds").humanize()} + span #{moment.duration(session.get('playtime'), "seconds").humanize()} p span.spr(data-i18n="clans.last_played") - span #{moment(level.changed).format('MMMM Do YYYY, h:mm:ss a')} + span #{moment(session.get('changed')).format('MMMM Do YYYY, h:mm:ss a')} if adminMode strong(data-i18n="clans.view_solution")