From c95f92fa4c42ef86cd994ca0361cb3c1909e6f2d Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Wed, 4 Jul 2012 13:36:51 +0200 Subject: o Sending 405 on bad method, 406 on bad Accept values. --- views/department.jade | 2 +- views/employeesInDepartment.jade | 22 ++++++++++++++++++++++ views/employees_in_department.jade | 22 ---------------------- views/index.jade | 6 ++++++ 4 files changed, 29 insertions(+), 23 deletions(-) create mode 100644 views/employeesInDepartment.jade delete mode 100644 views/employees_in_department.jade (limited to 'views') diff --git a/views/department.jade b/views/department.jade index 32952a9..a29ef3a 100644 --- a/views/department.jade +++ b/views/department.jade @@ -10,6 +10,6 @@ block content | >> a(href=urlgenerator.department(dept_no)) Department ##{dept_no} - p: a(href=urlgenerator.employees_in_department(dept_no)) Employees in this department + p: a(href=urlgenerator.employeesInDepartment(dept_no)) Employees in this department p TODO: add links to manager and department name. diff --git a/views/employeesInDepartment.jade b/views/employeesInDepartment.jade new file mode 100644 index 0000000..f889c0c --- /dev/null +++ b/views/employeesInDepartment.jade @@ -0,0 +1,22 @@ +extends layout +include lib/pager + +block content + h1= title + + p + a(href=urlgenerator.start()) Employee DB + | >> + a(href=urlgenerator.departments()) Department List + | >> + a(href=urlgenerator.department(dept_no)) Department ##{dept_no} + | >> + a(href=urlgenerator.employeesInDepartment(dept_no)) Employees in Department ##{dept_no} + + table + each employee in employees + tr + td: a(href=urlgenerator.employee(employee.emp_no)) #{employee.first_name} #{employee.last_name} + + - var f = function(offset) { return urlgenerator.employeesInDepartment(dept_no, offset) } + mixin pager(pager, f, query) diff --git a/views/employees_in_department.jade b/views/employees_in_department.jade deleted file mode 100644 index 277c750..0000000 --- a/views/employees_in_department.jade +++ /dev/null @@ -1,22 +0,0 @@ -extends layout -include lib/pager - -block content - h1= title - - p - a(href=urlgenerator.start()) Employee DB - | >> - a(href=urlgenerator.departments()) Department List - | >> - a(href=urlgenerator.department(dept_no)) Department ##{dept_no} - | >> - a(href=urlgenerator.employees_in_department(dept_no)) Employees in Department ##{dept_no} - - table - each employee in employees - tr - td: a(href=urlgenerator.employee(employee.emp_no)) #{employee.first_name} #{employee.last_name} - - - var f = function(offset) { return urlgenerator.employees_in_department(dept_no, offset) } - mixin pager(pager, f, query) diff --git a/views/index.jade b/views/index.jade index 7ff1bb1..363355c 100644 --- a/views/index.jade +++ b/views/index.jade @@ -25,6 +25,12 @@ block content code text/html | you will be served code application/vnd.collection+json + | if you include + code */* + | in your + code Accept + | header. If you request only unsupported types, you'll get a + a(href='http://httpstatus.es/406') 406 | . h4 Exploring with curl -- cgit v1.2.3