diff options
| author | Jules Laplace <jules@okfoc.us> | 2014-09-04 18:03:07 -0400 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2014-09-04 18:03:07 -0400 |
| commit | cccacd39a49f48a9aefe39e0e0bb33529ca80410 (patch) | |
| tree | 599ac816fb525a0afbb5a900420633e7267c7082 /server/lib/views/staff.js | |
| parent | 415dad29407362a76fde6d07d8b100285a84518d (diff) | |
media list
Diffstat (limited to 'server/lib/views/staff.js')
| -rw-r--r-- | server/lib/views/staff.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/server/lib/views/staff.js b/server/lib/views/staff.js index b9fe78a..a9d85ba 100644 --- a/server/lib/views/staff.js +++ b/server/lib/views/staff.js @@ -164,7 +164,7 @@ var staff = module.exports = { ensureSingleMedia: function(req, res, next){ var id = req.params.id if (id) { - Media.findOne({ _id: id }, function (err, id) { + Media.findOne({ _id: id }, function (err, media) { if (media) { res.locals.media = req.method == "GET" ? staff.helpers.media(media) : media } @@ -270,6 +270,7 @@ var staff = module.exports = { media = media.toObject() media.date = moment( media.updated_at || media.created_at ).format("M/DD/YYYY H:MM") media.user = {} + media.shortUrl = media.url.replace(/^http.:\/\//,"") return media } }, @@ -422,7 +423,7 @@ var staff = module.exports = { res.render('staff/media/index') }, show: function(req, res){ - if (res.locals.project) { + if (res.locals.media) { res.render('staff/media/show', { mediaJSON: util.escape( JSON.stringify( res.locals.media ) ), mediaUserJSON: util.escape( JSON.stringify( res.locals.mediaUser ) ), |
