codecombat/app/templates/editor/thang/table.jade

39 lines
1.1 KiB
Text
Raw Normal View History

extends /templates/common/table
2014-08-28 13:50:20 -04:00
block tableResultsHeader
2014-03-12 11:03:36 -04:00
tr
2014-08-28 13:50:20 -04:00
th(colspan=4)
2014-03-12 11:03:36 -04:00
span(data-i18n="general.results")
| Results
span
|: #{documents.length}
2014-08-28 13:50:20 -04:00
block tableHeader
2014-03-12 11:03:36 -04:00
tr
th#portrait-col
th(data-i18n="general.name") Name
th(data-i18n="general.description") Description
th(data-i18n="general.version") Version
th(data-i18n="editor.tasks") Tasks
2014-03-12 11:03:36 -04:00
2014-08-28 13:50:20 -04:00
block tableBody
for thang in documents
2014-03-12 11:03:36 -04:00
tr
td
- var name = thang.get('name');
img(title="Add #{name}", src=thang.getPortraitURL(), alt="").portrait
td(title=name).small-name-row
a(href="/editor/thang/#{thang.get('slug') || thang.id}")
| #{name}
- var description = thang.get('description');
td(title=description).body-row
| #{description}
- var version = thang.get('version')
td #{version.major}.#{version.minor}
- var tasks = thang.get('tasks');
if tasks && tasks.length
- var completed = tasks.filter(function(t) { return t.complete; });
td #{completed.length}/#{tasks.length}
else
td