diff options
Diffstat (limited to 'site/index.js')
| -rw-r--r-- | site/index.js | 67 |
1 files changed, 37 insertions, 30 deletions
diff --git a/site/index.js b/site/index.js index dace900..8eec697 100644 --- a/site/index.js +++ b/site/index.js @@ -1,5 +1,14 @@ var okcms = require('..'); +var projectSchema = { + id: {type: 'string', id: true}, + title: {type: 'string'}, + shortname: {type: 'string'}, + description: {type: 'text'}, + video: {type: 'video'}, + images: {type: 'captioned-image-list'}, +} + var app = okcms.createApp({ root: 'public', @@ -11,26 +20,19 @@ var app = okcms.createApp({ body: {type: 'text'}, image: {type: 'string'} }, - project: { - id: {type: 'string', id: true}, - title: {type: 'string'}, - shortname: {type: 'string'}, - category: {type: 'enum', options: [ - 'retail', - 'advertising', - 'experiential', - 'content'] - }, - description: {type: 'text'}, - video: {type: 'video'}, - images: {type: 'captioned-image-list'}, - } + retail: projectSchema, + advertising: projectSchema, + experiential: projectSchema, + content: projectSchema, }, resources: [ { type: 'page', static: {id: 'about'}}, { type: 'page', static: {id: 'contact'}}, - { type: 'project' } + { type: 'retail' }, + { type: 'advertising' }, + { type: 'experiential' }, + { type: 'content' } ], services: { @@ -44,8 +46,11 @@ var app = okcms.createApp({ views: { '/': { data: [ - {type: 'project', query: '*'}, - {type: 'page', query: '*'} + {type: 'page', query: '*'}, + {type: 'retail', query: '*'}, + {type: 'advertising', query: '*'}, + {type: 'experiential', query: '*'}, + {type: 'content', query: '*'}, ] }, '/about': { @@ -55,17 +60,19 @@ var app = okcms.createApp({ data: {type: 'page', query: 'contact'} }, '/all': { - data: { - type: 'project', - query: '*' - }, + data: [ + {type: 'retail', query: '*'}, + {type: 'advertising', query: '*'}, + {type: 'experiential', query: '*'}, + {type: 'content', query: '*'}, + ], template: 'all' }, '/retail/:id': { data: { - type: 'project', + type: 'retail', + as: 'project', query: { - category: 'retail', id: ':id' } }, @@ -73,9 +80,8 @@ var app = okcms.createApp({ }, '/advertising/:id': { data: { - type: 'project', + type: 'advertising', query: { - category: 'advertising', id: ':id' } }, @@ -83,9 +89,9 @@ var app = okcms.createApp({ }, '/experiential/:id': { data: { - type: 'project', + type: 'experiential', + as: 'project', query: { - category: 'experiential', id: ':id' } }, @@ -93,12 +99,13 @@ var app = okcms.createApp({ }, '/content/:id': { data: { - type: 'project', + type: 'content', + as: 'project', query: { - category: 'content', id: ':id' } - } + }, + template: 'project' } } |
