2014-07-06 15:10:28 -04:00
|
|
|
extends /templates/kinds/user
|
2014-07-07 09:03:28 -04:00
|
|
|
|
|
|
|
block append content
|
2014-07-30 16:23:43 -04:00
|
|
|
.btn-group.pull-right
|
|
|
|
button#grid-layout-button.btn.btn-default(data-layout='grid', class=activeLayout==='grid' ? 'active' : '') Grid
|
|
|
|
button#table-layout-button.btn.btn-default(data-layout='table', class=activeLayout==='table' ? 'active' : '') Table
|
|
|
|
if achievementsByCategory
|
|
|
|
if activeLayout === 'grid'
|
|
|
|
.grid-layout
|
|
|
|
each achievements, category in achievementsByCategory
|
|
|
|
.row
|
2014-08-07 16:03:00 -04:00
|
|
|
h2.achievement-category-title=category.charAt(0).toUpperCase() + category.slice(1)
|
2014-07-30 16:23:43 -04:00
|
|
|
each achievement, index in achievements
|
|
|
|
- var title = achievement.get('name');
|
|
|
|
- var description = achievement.get('description');
|
|
|
|
- var locked = ! achievement.get('unlocked');
|
|
|
|
- var notifyClass = achievement.getNotifyStyle()
|
2014-08-04 09:26:21 -04:00
|
|
|
- var imgURL = achievement.getImageURL();
|
|
|
|
if locked
|
|
|
|
- var imgURL = achievement.getLockedImageURL();
|
|
|
|
else
|
|
|
|
- var imgURL = achievement.getImageURL();
|
|
|
|
- console.log(locked);
|
2014-07-30 16:23:43 -04:00
|
|
|
.col-lg-4.col-xs-12
|
|
|
|
include ../achievement_notify
|
|
|
|
else if activeLayout === 'table'
|
|
|
|
.table-layout
|
|
|
|
if earnedAchievements.length
|
|
|
|
table.table
|
|
|
|
tr
|
|
|
|
th Name
|
|
|
|
th Description
|
|
|
|
th Date
|
|
|
|
th Amount
|
|
|
|
th XP
|
2014-08-07 16:03:00 -04:00
|
|
|
each earnedAchievement in earnedAchievements.models
|
2014-07-30 16:23:43 -04:00
|
|
|
- var achievement = earnedAchievement.get('achievement');
|
|
|
|
tr
|
|
|
|
td= achievement.get('name')
|
|
|
|
td= achievement.get('description')
|
|
|
|
td= moment().format("MMMM Do YY", earnedAchievement.get('changed'))
|
|
|
|
if achievement.isRepeatable()
|
|
|
|
td= earnedAchievement.get('achievedAmount')
|
|
|
|
else
|
|
|
|
td
|
|
|
|
td= earnedAchievement.get('earnedPoints')
|
|
|
|
else
|
|
|
|
.panel#no-achievements
|
|
|
|
.panel-body No achievements earned yet.
|
|
|
|
else
|
|
|
|
div How did you even do that?
|