diff options
| author | Sean Fridman <fridman@mail.sfsu.edu> | 2015-04-09 12:46:44 -0400 |
|---|---|---|
| committer | Sean Fridman <fridman@mail.sfsu.edu> | 2015-04-09 12:46:44 -0400 |
| commit | 96d3b84593362eecc2e8f1d5b4f13b7779efcbcd (patch) | |
| tree | 71be83b347f0e8c5f26992ae848fe0f93228d6ad | |
| parent | ca0366247f54bfd719f4a0c990b97174dfa1ef91 (diff) | |
Update app manifest to use one schema
| -rw-r--r-- | site/db.json | 3 | ||||
| -rw-r--r-- | site/index.js | 71 | ||||
| -rw-r--r-- | site/templates/index.liquid | 24 | ||||
| -rw-r--r-- | site/templates/project.liquid | 20 |
4 files changed, 72 insertions, 46 deletions
diff --git a/site/db.json b/site/db.json index 14f8724..8107c6d 100644 --- a/site/db.json +++ b/site/db.json @@ -1,8 +1,9 @@ { "meta": [], - "retail": [ + "project": [ { "id": "diesel-ss15", + "category": "retail", "title": "DIESEL JOGG JEANS SS15 DENIM CAMPAIGN", "shortname": "DIESEL SS15", "description": "Sed posuere consectetur est at lobortis. Donec id elit non mi porta gravida at eget metus. Cras mattis consectetur purus sit amet fermentum. Vestibulum id ligula porta felis euismod semper. Donec sed odio dui. \r\n\r\nVestibulum id ligula porta felis euismod semper. Vestibulum id ligula porta felis euismod semper. Vestibulum id ligula porta felis euismod semper. Aenean lacinia bibendum nulla sed consectetur. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. \r\n\r\nCurabitur blandit tempus porttitor. Integer posuere erat a ante venenatis dapibus posuere velit aliquet. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec ullamcorper nulla non metus auctor fringilla. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur blandit tempus porttitor. Maecenas sed diam eget risus varius blandit sit amet non magna.", 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' + } + } } } diff --git a/site/templates/index.liquid b/site/templates/index.liquid index 8797f25..41de3e2 100644 --- a/site/templates/index.liquid +++ b/site/templates/index.liquid @@ -87,26 +87,34 @@ WEBSITE BY OKFOCUS, http://okfoc.us, Internet Legends. <img src="assets/images/2H_WORDMARK.png" class="toplogo"> <div class="cat">RETAIL</div> <div class="sub"> - {% for project in retail %} - <a href="/retail/{{ project.id }}" data-image="{{ project.images[0].uri }}">{{ project.shortname }}</a> + {% for project in projects %} + {% if project.category == 'retail' %} + <a href="/retail/{{ project.id }}" data-image="{{ project.images[0].uri }}">{{ project.shortname }}</a> + {% endif %} {% endfor %} </div> <div class="cat">advertising</div> <div class="sub"> - {% for project in advertising %} - <a href="/advertising/{{ project.id }}">{{ project.shortname || project.title }}</a> + {% for project in projects %} + {% if project.category == 'advertising' %} + <a href="/advertising/{{ project.id }}">{{ project.shortname || project.title }}</a> + {% endif %}} {% endfor %} </div> <div class="cat">experiential</div> <div class="sub"> - {% for project in experiential %} - <a href="/experiential/{{ project.id }}">{{ project.shortname || project.title }}</a> + {% for project in projects %} + {% if project.category == 'experiential' %} + <a href="/experiential/{{ project.id }}">{{ project.shortname || project.title }}</a> + {% endif %}} {% endfor %} </div> <div class="cat">content</div> <div class="sub"> - {% for project in content %} - <a href="/content/{{ project.id }}">{{ project.shortname || project.title }}</a> + {% for project in projects %} + {% if project.category == 'content' %} + <a href="/content/{{ project.id }}">{{ project.shortname || project.title }}</a> + {% endif %}} {% endfor %} </div> </div> diff --git a/site/templates/project.liquid b/site/templates/project.liquid index 5e6bc84..583cb09 100644 --- a/site/templates/project.liquid +++ b/site/templates/project.liquid @@ -1,22 +1,22 @@ <div class="entry"> <span> - <span class="postname">{{post.title}}</span> - + <span class="projectname">{{project.title}}</span> + <div class="gallery" id="okgallery"> - {% if post.video %} - <div class="cell video" style="background-image:url({{ post.video.thumb }}" data-video="https://player.vimeo.com/video/{{ post.video.token }}" data-caption="{{ post.video.title }}"></div> + {% if project.video %} + <div class="cell video" style="background-image:url({{ project.video.thumb }}" data-video="https://player.vimeo.com/video/{{ project.video.token }}" data-caption="{{ project.video.title }}"></div> {% endif %} - {% for image in post.images %} + {% for image in project.images %} <div class="cell" data-caption="{{ image.caption }}"><img src="{{ image.uri }}"></div> {% endfor %} </div> <div class="caption"></div> <div class="content"> - {{ post.description }} + {{ project.description }} </div> <div class="credit"> - <a href="#"><img src="assets/images/fb2.png"></a> - <a href="#"><img src="assets/images/tw2.png"></a> + <a href="#"><img src="{{static}}/assets/images/fb2.png"></a> + <a href="#"><img src="{{static}}/assets/images/tw2.png"></a> </div> - </span> -</div>
\ No newline at end of file + </span> +</div> |
