From 95f62d72945acbac295f2342fd51cea9337d7cb7 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Wed, 3 Sep 2014 18:46:04 -0400 Subject: lastlog --- public/assets/javascripts/ui/site/ProjectList.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'public/assets/javascripts/ui/site/ProjectList.js') diff --git a/public/assets/javascripts/ui/site/ProjectList.js b/public/assets/javascripts/ui/site/ProjectList.js index d772b20..959aa43 100644 --- a/public/assets/javascripts/ui/site/ProjectList.js +++ b/public/assets/javascripts/ui/site/ProjectList.js @@ -1,7 +1,7 @@ var ProjectList = View.extend({ - el: "#projectList", + el: ".projectList", events: { "mouseenter td.border": 'spinOn', -- cgit v1.2.3-70-g09d2 From 01eaa246c7aebcea616eccf7989c63ac6f54fdf0 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Thu, 4 Sep 2014 15:30:07 -0400 Subject: project view --- public/assets/javascripts/ui/site/ProjectList.js | 1 - public/assets/javascripts/ui/site/StaffView.js | 14 ++++++ public/assets/stylesheets/staff.css | 54 +++++++++++++++++++--- server/lib/views/staff.js | 12 ++--- views/staff/_footer.ejs | 6 ++- views/staff/projects/show.ejs | 57 +++++++++++++++++++++++- 6 files changed, 130 insertions(+), 14 deletions(-) create mode 100644 public/assets/javascripts/ui/site/StaffView.js (limited to 'public/assets/javascripts/ui/site/ProjectList.js') diff --git a/public/assets/javascripts/ui/site/ProjectList.js b/public/assets/javascripts/ui/site/ProjectList.js index 959aa43..ee1b89f 100644 --- a/public/assets/javascripts/ui/site/ProjectList.js +++ b/public/assets/javascripts/ui/site/ProjectList.js @@ -24,4 +24,3 @@ var ProjectList = View.extend({ } }) - diff --git a/public/assets/javascripts/ui/site/StaffView.js b/public/assets/javascripts/ui/site/StaffView.js new file mode 100644 index 0000000..115d417 --- /dev/null +++ b/public/assets/javascripts/ui/site/StaffView.js @@ -0,0 +1,14 @@ +var StaffView = View.extend({ + + initialize: function() { + }, + + load: function() { + $(".json").each(function(){ + $(this).JSONView( this.innerText ) + }) + + this.projectList = new ProjectList () + } + +}) diff --git a/public/assets/stylesheets/staff.css b/public/assets/stylesheets/staff.css index 2d1f802..9b9226f 100644 --- a/public/assets/stylesheets/staff.css +++ b/public/assets/stylesheets/staff.css @@ -13,21 +13,24 @@ td, th { text-align: left; padding: 2px 5px; } -.staff .body { +.page { text-align: left; } -.staff h1 { +.footer { + text-align: center; +} +h1 { text-align: left; display: inline-block; } -.staff nav { +nav { display: inline-block; text-align: left; } -.staff nav a { +nav a { padding-left: 20px; } -.staff hr { +hr { border: 1px solid #bbb; margin: 5px auto 10px; } @@ -35,12 +38,53 @@ td, th { width: 80%; margin: 0 auto; } +.jsonview { + border: 1px solid #ddd; + background: rgba(238,238,238,0.5); + padding: 4px; + margin: 0 auto; + max-width: 100%; + overflow-x: auto; + margin-bottom: 20px; + max-height: 60vh; +} .jsonview * { font-family: monospace !important; + font-size: 12px; +} +.jsonview .collapser { + -webkit-user-select: none; + -moz-user-select: none; + user-select: none; } .staff { font-size: 15px; } .staff .editLinks a { color: #00f; +} +#iframe-embed, #iframe-embed tr, #iframe-embed td { + width: 79vw; +} +#iframe-embed td { + padding: 0; +} +h2 { + margin: 20px auto; +} +.avatar { + height: 40px; + width: 40px; + display: inline-block; + background-size: cover; +} +iframe.embed { + position: static; + width: 100%; + height: 44vw; + border: 1px solid black; +} +.page table.projectList, +.page table.projectList td.border { + border: 0; } \ No newline at end of file diff --git a/server/lib/views/staff.js b/server/lib/views/staff.js index cf43081..ae414d7 100644 --- a/server/lib/views/staff.js +++ b/server/lib/views/staff.js @@ -14,7 +14,7 @@ var User = require('../schemas/User'), var staff = module.exports = { fields: { - user: "_id username displayName created_at updated_at last_seen created_ip last_ip", + user: "_id username displayName photo created_at updated_at last_seen created_ip last_ip", project: "_id name slug user_id privacy created_at updated_at", }, @@ -170,8 +170,8 @@ var staff = module.exports = { ensureProjectUser: function(req, res, next){ if (! res.locals.project) { return next() } - User.findOne({ user_id: res.locals.project.user_id }, staff.fields.user, function(err, user){ - res.locals.project.user = user || staff.defaults.user + User.findOne({ _id: res.locals.project.user_id }, staff.fields.user, function(err, user){ + res.locals.projectUser = staff.helpers.user(user) || staff.defaults.user next() }) }, @@ -247,7 +247,7 @@ var staff = module.exports = { staff.projects.index ); - app.get('/staff/projects/:name', + app.get('/staff/projects/:slug', middleware.ensureAuthenticated, middleware.ensureIsStaff, @@ -304,7 +304,9 @@ var staff = module.exports = { show: function(req, res){ if (res.locals.project) { res.render('staff/projects/show', { - projectJSON: util.escape( JSON.stringify( res.locals.profile ) ) + projectJSON: util.escape( JSON.stringify( res.locals.project ) ), + projectUserJSON: util.escape( JSON.stringify( res.locals.projectUser ) ), + collaboratorsJSON: util.escape( JSON.stringify( res.locals.collaborators ) ) }) } else { diff --git a/views/staff/_footer.ejs b/views/staff/_footer.ejs index c363beb..839db4a 100644 --- a/views/staff/_footer.ejs +++ b/views/staff/_footer.ejs @@ -6,9 +6,11 @@ [[ include ../partials/scripts ]] + diff --git a/views/staff/projects/show.ejs b/views/staff/projects/show.ejs index e821614..23e96b2 100644 --- a/views/staff/projects/show.ejs +++ b/views/staff/projects/show.ejs @@ -1,6 +1,6 @@ [[ include ../_header ]] -

Project

+

[[- project.name ]]