summaryrefslogtreecommitdiff
path: root/site/index.js
diff options
context:
space:
mode:
authorSean Fridman <fridman@mail.sfsu.edu>2015-04-09 12:46:44 -0400
committerSean Fridman <fridman@mail.sfsu.edu>2015-04-09 12:46:44 -0400
commit96d3b84593362eecc2e8f1d5b4f13b7779efcbcd (patch)
tree71be83b347f0e8c5f26992ae848fe0f93228d6ad /site/index.js
parentca0366247f54bfd719f4a0c990b97174dfa1ef91 (diff)
Update app manifest to use one schema
Diffstat (limited to 'site/index.js')
-rw-r--r--site/index.js71
1 files changed, 44 insertions, 27 deletions
diff --git a/site/index.js b/site/index.js
index d36778f..55752e5 100644
--- a/site/index.js
+++ b/site/index.js
@@ -1,14 +1,5 @@
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',
@@ -20,19 +11,26 @@ var app = okcms.createApp({
body: {type: 'text'},
image: {type: 'string'}
},
- retail: projectSchema,
- advertising: projectSchema,
- experiential: projectSchema,
- content: projectSchema,
+ project: {
+ id: {type: 'string', id: true},
+ title: {type: 'string'},
+ shortname: {type: 'string'},
+ description: {type: 'text'},
+ video: {type: 'video'},
+ images: {type: 'captioned-image-list'},
+ category: {type: 'enum', options: [
+ 'retail',
+ 'advertising',
+ 'experiential',
+ 'content']
+ }
+ }
},
resources: [
{ type: 'page', static: {id: 'about'}},
{ type: 'page', static: {id: 'contact'}},
- { type: 'retail' },
- { type: 'advertising' },
- { type: 'experiential' },
- { type: 'content' },
+ { type: 'project' }
],
services: {
@@ -46,11 +44,7 @@ var app = okcms.createApp({
views: {
'/': {
data: [
- {type: 'retail', query: '*'},
- {type: 'advertising', query: '*'},
- {type: 'experiential', query: '*'},
- {type: 'content', query: '*'},
- {type: 'page', query: '*'}
+ {type: 'project', query: '*'},
]
},
'/about': {
@@ -60,20 +54,43 @@ var app = okcms.createApp({
data: {type: 'page', query: 'contact'}
},
'/retail/:id': {
- data: {type: 'retail', query: ':id'},
+ data: {
+ type: 'project',
+ query: {
+ category: 'retail',
+ id: ':id'
+ }
+ },
template: 'project'
},
'/advertising/:id': {
- data: {type: 'advertising', query: ':id'},
+ data: {
+ type: 'project',
+ query: {
+ category: 'advertising',
+ id: ':id'
+ }
+ },
template: 'project'
},
'/experiential/:id': {
- data: {type: 'experiential', query: ':id'},
+ data: {
+ type: 'project',
+ query: {
+ category: 'experiential',
+ id: ':id'
+ }
+ },
template: 'project'
},
'/content/:id': {
- data: {type: 'content', query: ':id'},
- template: 'project'
+ data: {
+ type: 'project',
+ query: {
+ category: 'content',
+ id: ':id'
+ }
+ }
}
}