Merge pull request #3321 from taptapdan/fix-issue-2732

Looks good. Thanks!
This commit is contained in:
Scott Erickson 2016-01-18 15:08:52 -08:00
commit a28b53eb5c
3 changed files with 46 additions and 0 deletions

View file

@ -18,9 +18,20 @@
.name-row
@extend .body-row
max-width: 300px
.description-row
@extend .body-row
max-width: 520px
.small-name-row
@extend .body-row
max-width: 200px
.watch-row
@extend .body-row
max-width: 80px
text-align: center
&.watching
opacity: 1.0
&.not-watching
opacity: 0.5
tr.mine
background-color: #f8ecaa

View file

@ -1 +1,35 @@
extends /templates/common/table
block tableResultsHeader
tr
th(colspan=4)
span(data-i18n="general.results")
| Results
span
|: #{documents.length}
block tableHeader
tr
th(data-i18n="general.name") Name
th(data-i18n="general.description") Description
th(data-i18n="general.version") Version
th(data-i18n="common.watch") Watch
block tableBody
for document in documents
- var data = document.attributes;
tr(class=document.get('creator') == me.id ? 'mine' : '')
td(title=data.name).name-row
a(href="/editor/#{page}/#{data.slug || data._id}")
| #{data.name}
td(title=data.description).description-row
| #{data.description}
td #{data.version.major}.#{data.version.minor}
if document.watching()
td.watch-row.watching
span(aria-hidden="true").glyphicon.glyphicon-eye-open
span(data-i18n="common.watch").sr-only Watch
else
td.watch-row.not-watching
span(aria-hidden="true").glyphicon.glyphicon-eye-close
span(data-i18n="common.unwatch").sr-only Unwatch

View file

@ -6,6 +6,7 @@ module.exports = class LevelSearchView extends SearchView
model: require 'models/Level'
modelURL: '/db/level'
tableTemplate: require 'templates/editor/level/table'
projection: ['slug', 'name', 'description', 'version', 'watchers', 'creator']
page: 'level'
getRenderData: ->