2015-11-03 19:41:06 -05:00
|
|
|
extends /templates/base
|
|
|
|
|
|
|
|
block content
|
|
|
|
|
2015-11-30 17:39:46 -05:00
|
|
|
.text-center
|
|
|
|
if me.isAnonymous() || !me.get('name')
|
|
|
|
.welcome Welcome!
|
|
|
|
else
|
|
|
|
.welcome Welcome, #{me.get('name')}!
|
|
|
|
|
|
|
|
|
|
|
|
.section-header Your Classes
|
|
|
|
|
|
|
|
if view.classrooms.models.length > 0
|
|
|
|
.container-fluid
|
|
|
|
each classroom in view.classrooms.models
|
|
|
|
+classroom(classroom)
|
|
|
|
else
|
|
|
|
.no-students No classes yet!
|
|
|
|
|
|
|
|
.text-center
|
2015-11-30 19:20:24 -05:00
|
|
|
button.btn.btn-lg.btn-success.uppercase.create-new-class create new class
|
2015-11-30 17:39:46 -05:00
|
|
|
|
2015-11-30 19:40:14 -05:00
|
|
|
br
|
|
|
|
.section-header Available Courses
|
|
|
|
.container-fluid
|
|
|
|
- var courses = view.courses.models;
|
|
|
|
- var i = 0;
|
|
|
|
while i < courses.length
|
|
|
|
- var course = courses[i];
|
|
|
|
- i++;
|
|
|
|
.row
|
|
|
|
.col-md-6
|
|
|
|
+course-info(course)
|
|
|
|
if i < courses.length
|
|
|
|
- course = courses[i];
|
|
|
|
- i++;
|
|
|
|
.col-md-6
|
|
|
|
+course-info(course)
|
2015-11-09 20:58:40 -05:00
|
|
|
|
2015-11-30 17:39:46 -05:00
|
|
|
block footer
|
2015-11-04 19:54:13 -05:00
|
|
|
|
2015-11-30 17:39:46 -05:00
|
|
|
mixin classroom(classroom)
|
|
|
|
.row
|
2015-11-30 19:20:24 -05:00
|
|
|
- var classMemberCount = classroom.get('members') ? classroom.get('members').length : 0;
|
2015-11-30 17:39:46 -05:00
|
|
|
if classMemberCount > 0
|
|
|
|
.col-md-8
|
|
|
|
p
|
|
|
|
span.spr.class-name= classroom.get('name')
|
2015-11-30 19:20:24 -05:00
|
|
|
if classroom.get('aceConfig') && classroom.get('aceConfig').language === 'javascript'
|
|
|
|
span.spr.class-name (JavaScript)
|
2015-11-30 17:39:46 -05:00
|
|
|
else
|
|
|
|
span.spr.class-name (Python)
|
2015-11-30 19:20:24 -05:00
|
|
|
a.edit-classroom-small(data-i18n="courses.edit_settings", data-classroom-id="#{classroom.id}")
|
2015-11-30 17:39:46 -05:00
|
|
|
.active-courses active courses
|
2015-11-30 19:20:24 -05:00
|
|
|
- var courseInstances = view.courseInstances.where({classroomID: classroom.id});
|
2015-11-30 17:39:46 -05:00
|
|
|
each courseInstance in courseInstances
|
|
|
|
+course(courseInstance, classMemberCount)
|
|
|
|
else
|
|
|
|
.col-md-12
|
|
|
|
p
|
|
|
|
span.spr.class-name= classroom.get('name')
|
2015-11-30 19:20:24 -05:00
|
|
|
if classroom.get('aceConfig') && classroom.get('aceConfig').language === 'javascript'
|
|
|
|
span.spr.class-name (JavaScript)
|
2015-11-30 17:39:46 -05:00
|
|
|
else
|
|
|
|
span.spr.class-name (Python)
|
2015-11-30 19:20:24 -05:00
|
|
|
a.edit-classroom-small(data-i18n="courses.edit_settings", data-classroom-id="#{classroom.id}")
|
2015-11-30 17:39:46 -05:00
|
|
|
.no-students No students yet!
|
|
|
|
.text-center
|
|
|
|
a.btn.btn-info.uppercase(href='/courses/#{classroom.id}') add students
|
|
|
|
br
|
|
|
|
if classMemberCount > 0
|
|
|
|
.col-md-4.text-center
|
|
|
|
.class-count= classMemberCount
|
|
|
|
.active-courses(style='margin:6px;') students
|
|
|
|
a.btn.btn-info.uppercase(href='/courses/#{classroom.id}') view/edit
|
|
|
|
.row
|
|
|
|
.col-md-12
|
|
|
|
.divider
|
|
|
|
|
|
|
|
mixin course(courseInstance, classMemberCount)
|
2015-11-30 19:20:24 -05:00
|
|
|
- var courseMemberCount = courseInstance.get('members') ? courseInstance.get('members').length : 0;
|
2015-11-30 17:39:46 -05:00
|
|
|
if courseMemberCount > 0
|
2015-11-30 19:20:24 -05:00
|
|
|
- var course = view.courses.get(courseInstance.get('courseID'));
|
2015-11-30 17:39:46 -05:00
|
|
|
p
|
|
|
|
.course-name= course.get('name')
|
|
|
|
.course-enrolled #{courseMemberCount} / #{classMemberCount} students enrolled
|
|
|
|
each concept in course.get('concepts')
|
|
|
|
span.spr.course-concept(data-i18n="concepts." + concept)
|
2015-11-30 19:40:14 -05:00
|
|
|
|
|
|
|
mixin course-info(course)
|
|
|
|
.media
|
2015-12-01 09:13:52 -05:00
|
|
|
.corner-ribbon-container
|
|
|
|
if course.get('free')
|
|
|
|
.corner-ribbon.top-left.sticky.shadow.uppercase free
|
|
|
|
img.media-object(src=course.get('screenshot'))
|
2015-12-01 10:01:17 -05:00
|
|
|
.star-container
|
|
|
|
if course.get('duration') === 1
|
|
|
|
.star-text #{course.get('duration') || 0} hr
|
|
|
|
.round-star-label
|
|
|
|
else
|
|
|
|
.star-text-big #{course.get('duration') || 0} hrs
|
|
|
|
.round-star-label-big
|
2015-11-30 19:40:14 -05:00
|
|
|
.media-body
|
|
|
|
span.spr.course-name= course.get('name')
|
|
|
|
p= course.get('description')
|
|
|
|
p
|
|
|
|
strong.spr Concepts:
|
|
|
|
each concept in course.get('concepts')
|
|
|
|
span(data-i18n="concepts." + concept)
|
|
|
|
if course.get('concepts').indexOf(concept) !== course.get('concepts').length - 1
|
|
|
|
span.spr ,
|
|
|
|
p
|
|
|
|
strong.spr Length:
|
|
|
|
span #{course.get('duration') || 0} hours
|