From b694dea16861af46f6ac3799ff8ea38bf675bfbf Mon Sep 17 00:00:00 2001 From: Izaak Schroeder Date: Fri, 28 Feb 2014 10:08:16 -0800 Subject: [PATCH] More styling changes, starting evaluation details. --- assets/styles/assignments.css | 15 +++++++++++---- assets/styles/evaluation.css | 6 ++++++ lib/app.js | 14 ++++++++++++++ views/assignment.jade | 4 +++- views/evaluation.jade | 15 +++++++++++++++ views/run.jade | 2 +- 6 files changed, 50 insertions(+), 6 deletions(-) create mode 100644 assets/styles/evaluation.css create mode 100644 views/evaluation.jade diff --git a/assets/styles/assignments.css b/assets/styles/assignments.css index 3e2f77e..16112b5 100644 --- a/assets/styles/assignments.css +++ b/assets/styles/assignments.css @@ -2,7 +2,8 @@ @import url("global.css"); .assignments { - background: #fff; + background: #f0f0f0; + padding: 20px 0; } .assignments .items { @@ -13,18 +14,24 @@ } .assignments li { - display: block; + display: flex; + flex-direction: column; + align-items: center; width: 300px; height: 300px; background: #fff; position: relative; + border: solid 1px #eee; + border-radius: 12px; + margin: 12px 0; + background: #fff; + box-shadow: 0 1px 5px rgba(0,0,0,0.2); } .assignments li a { - position: absolute; display: block; - top: 0; left: 0; right: 0; bottom: 0; padding: 18px; + flex: initial; } .assignments li a img { diff --git a/assets/styles/evaluation.css b/assets/styles/evaluation.css new file mode 100644 index 0000000..37a6868 --- /dev/null +++ b/assets/styles/evaluation.css @@ -0,0 +1,6 @@ + +@import url('global.css'); + +.evaluation { + background: #fff; +} \ No newline at end of file diff --git a/lib/app.js b/lib/app.js index dfc0142..6ab27c2 100644 --- a/lib/app.js +++ b/lib/app.js @@ -201,6 +201,20 @@ app.get('/login/cas', require('./authentication/cas')(), session.authenticate(), //app.get('/login/facebook', require('./authentication/facebook')(appId, appSecret, ['email']), session.authenticate()); +app.param('evaluation', get('Evaluation')); + +app.get('/evaluation/:evaluation', accepts('application/json', 'text/html', 'application/xhtml+xml')); + +app.get( + '/evaluation/:evaluation', + accepts.on('text/html', 'application/xhtml+xml'), + function (req, res) { + return res.render('evaluation', { + evaluation: req.evaluation + }) + } +); + app.post('/submission/:submission/evaluate', accepts('application/json', 'text/html', 'application/xhtml+xml')); diff --git a/views/assignment.jade b/views/assignment.jade index 7c62c4d..7a5f842 100644 --- a/views/assignment.jade +++ b/views/assignment.jade @@ -75,6 +75,7 @@ mixin evaluation(context) thead tr th Submission + th Evaluator th Given th Result th @@ -82,12 +83,13 @@ mixin evaluation(context) each evaluation in context.evaluations tr td #{evaluation.submission} + td #{evaluation.source} td time(datetime=evaluation.at) evaluation.at td span.result(data-score=evaluation.result) #{evaluation.result} td - a.button(href="/evaluations/"+evaluation.id) Details + a.button(href="/evaluation/"+evaluation.id) Details else p You have no evaluations yet! diff --git a/views/evaluation.jade b/views/evaluation.jade new file mode 100644 index 0000000..041e192 --- /dev/null +++ b/views/evaluation.jade @@ -0,0 +1,15 @@ +extends /layouts/default + +block styles + link(rel="stylesheet", type="text/css", href="/styles/evaluation.css") + +block content + .evaluation + .container + h1 Evaluation #{evaluation.id} + + p Run: + a(href="/run/"+evaluation.run) #{evaluation.run} + + + diff --git a/views/run.jade b/views/run.jade index 194f438..4fa8b4f 100644 --- a/views/run.jade +++ b/views/run.jade @@ -27,7 +27,7 @@ mixin evaluation() block content .container - h1 Job #{job.id} + h1 Run #{job.id} each entry in job.logs div #{entry.data.toString('utf8')} \ No newline at end of file