diff options
| author | Julie Lala <jules@okfoc.us> | 2014-08-15 09:26:10 -0400 |
|---|---|---|
| committer | Julie Lala <jules@okfoc.us> | 2014-08-15 09:26:10 -0400 |
| commit | aecaf2de2b4ed5277b34e9209a0f31602e8a7999 (patch) | |
| tree | 78e46648032b91ebb0267e38f39f6227da7d8732 /server/lib | |
| parent | 02bde51c24ae1c6e189d031b80226e6a9f7cbc59 (diff) | |
| parent | 1be685f9fe4a7f3a3e947d45f865fe07c03ddbaf (diff) | |
Merge branch 'walls' of github.com:okfocus/vvalls into walls
Diffstat (limited to 'server/lib')
| -rw-r--r-- | server/lib/api/projects.js | 23 | ||||
| -rw-r--r-- | server/lib/middleware.js | 2 | ||||
| -rw-r--r-- | server/lib/views.js | 2 |
3 files changed, 17 insertions, 10 deletions
diff --git a/server/lib/api/projects.js b/server/lib/api/projects.js index fc54a5f..bd3cb81 100644 --- a/server/lib/api/projects.js +++ b/server/lib/api/projects.js @@ -72,15 +72,20 @@ var projects = { data.slug = util.slugify(data.name) data.description = util.sanitize(data.description) - upload.put("projects", req.files.thumbnail, { - unacceptable: function(err){ - res.json({ error: { errors: { thumbnail: { message: "Problem saving thumbnail: " + err } } } }) - }, - success: function(url){ - data.photo = url - done() - } - }) + if (req.files.thumbnail) { + upload.put("projects", req.files.thumbnail, { + unacceptable: function(err){ + res.json({ error: { errors: { thumbnail: { message: "Problem saving thumbnail: " + err } } } }) + }, + success: function(url){ + data.photo = url + done() + } + }) + } + else { + done() + } function done() { Project.findOne({ _id: _id }, function(err, doc){ diff --git a/server/lib/middleware.js b/server/lib/middleware.js index aec54ad..27b9c04 100644 --- a/server/lib/middleware.js +++ b/server/lib/middleware.js @@ -36,7 +36,7 @@ var middleware = { ensureLocals: function (req, res, next) { res.locals.token = req.csrfToken(); res.locals.logged_in = req.isAuthenticated() - res.locals.user = req.user || {} + res.locals.user = req.user || { id: undefined } res.locals.config = config res.locals.profile = null res.locals.opt = {} diff --git a/server/lib/views.js b/server/lib/views.js index 27b7446..b776582 100644 --- a/server/lib/views.js +++ b/server/lib/views.js @@ -36,6 +36,7 @@ views.editor = function (req, res) { date: moment(req.project.updated_at).format("M/DD/YYYY"), author: user.displayName, authorlink: "/profile/" + user.username, + noui: !! (req.query.noui === '1'), }) }) } @@ -60,6 +61,7 @@ views.reader = function (req, res) { date: moment(req.project.updated_at).format("M/DD/YYYY"), author: user.displayName, authorlink: "/profile/" + user.username, + noui: !! (req.query.noui === '1'), }) }) } |
