From 47215a88acb2b4a612b6916f2f7b7a7660770c36 Mon Sep 17 00:00:00 2001 From: Sean Fridman Date: Wed, 8 Apr 2015 19:52:04 -0400 Subject: Update example --- examples/db.json | 30 ++++++++++++++++++++---------- examples/index.js | 23 ++++++++++------------- examples/public/css/main.css | 19 ++++++++++++++++++- examples/public/images/brown046.jpg | Bin 0 -> 5108 bytes examples/templates/bread.liquid | 14 ++++++++++++++ examples/templates/index.liquid | 28 ++++++++++++++++++++++------ examples/templates/page.liquid | 19 ++++++++++++++----- examples/templates/project.liquid | 2 -- 8 files changed, 98 insertions(+), 37 deletions(-) create mode 100644 examples/public/images/brown046.jpg create mode 100644 examples/templates/bread.liquid delete mode 100644 examples/templates/project.liquid (limited to 'examples') diff --git a/examples/db.json b/examples/db.json index bfce252..1d0cba4 100644 --- a/examples/db.json +++ b/examples/db.json @@ -1,22 +1,32 @@ { - "meta": [ + "meta": [], + "bread": [ { - "project": "great project" - } - ], - "project": [ + "type": "rye", + "description": "really a very tasty bread!", + "id": "rye" + }, { - "id": "cool" + "type": "bagel", + "description": "very good and dense bread", + "id": "bagel" }, { - "id": "lame" + "type": "pumpernickel", + "description": "grandma's recipe", + "id": "pumpernickel" } ], "page": [ { - "id": "about", - "title": "so page", - "body": "we did it" + "title": "About Us", + "body": "Just a small bakery", + "id": "about" + }, + { + "title": "contact", + "body": "2406 Old Rd, San Juan Bautista", + "id": "contact" } ] } \ No newline at end of file diff --git a/examples/index.js b/examples/index.js index c4fd3be..e55b717 100644 --- a/examples/index.js +++ b/examples/index.js @@ -6,29 +6,26 @@ var app = okcms.createApp({ schemas: { page: { - title: {type: 'string', id: true}, + id: {type: 'string'}, + title: {type: 'string'}, body: {type: 'string'} }, - project: { - title: {type: 'string', id: true}, - index: {type: 'integer'}, - category: {type: 'enum'}, - body: {type: 'string'}, - videos: [{type: 'uri'}], - images: [{index: {type: 'string'}, uri: {type: 'uri'}}] + bread: { + type: {type: 'string', id: true}, + description: {type: 'string'} } }, resources: [ - { type: 'page', data: {title: 'about'}}, - { type: 'page', data: {title: 'contact'}}, - { type: 'project' }, + { type: 'page', static: {id: 'about'}}, + { type: 'page', static: {id: 'contact'}}, + { type: 'bread' }, ], views: { '/': { data: [ - {type: 'project', query: '*'}, + {type: 'bread', query: '*'}, {type: 'page', query: '*'} ] }, @@ -39,7 +36,7 @@ var app = okcms.createApp({ data: {type: 'page', query: 'contact'} }, '/:id': { - data: {type: 'project', query: ':id'} + data: {type: 'bread', query: ':id'} } } diff --git a/examples/public/css/main.css b/examples/public/css/main.css index 55f8e3b..92b2ee7 100644 --- a/examples/public/css/main.css +++ b/examples/public/css/main.css @@ -1 +1,18 @@ -/** woo doggy! **/ +html, body { + margin: 0; + passing: 0; + font-family: "Georgia", sans-serif; +} + +body { + background-image: url(../images/brown046.jpg); +} + +h1, h2, h3 { + color: rgb(12, 145, 14); +} + +.container { + padding: 2em; + background-color: rgba(255, 255, 255, 0.5); +} diff --git a/examples/public/images/brown046.jpg b/examples/public/images/brown046.jpg new file mode 100644 index 0000000..4b86003 Binary files /dev/null and b/examples/public/images/brown046.jpg differ diff --git a/examples/templates/bread.liquid b/examples/templates/bread.liquid new file mode 100644 index 0000000..da36cce --- /dev/null +++ b/examples/templates/bread.liquid @@ -0,0 +1,14 @@ + + + + + + +
+

{{bread.type | capitalize}}

+

+ {{bread.description}} +

+
+ + diff --git a/examples/templates/index.liquid b/examples/templates/index.liquid index 21d8764..7c12a86 100644 --- a/examples/templates/index.liquid +++ b/examples/templates/index.liquid @@ -4,11 +4,27 @@ - {{meta.project}} - +
+
+

Cheryl's Deli and Bakery

+
+
+
+
diff --git a/examples/templates/page.liquid b/examples/templates/page.liquid index f7d899f..e90f7ce 100644 --- a/examples/templates/page.liquid +++ b/examples/templates/page.liquid @@ -1,5 +1,14 @@ -woop -

{{page.title}}

-

- {{page.body}} -

+ + + + + + +
+

{{page.title | capitalize}}

+

+ {{page.body}} +

+
+ + diff --git a/examples/templates/project.liquid b/examples/templates/project.liquid deleted file mode 100644 index dac1d8d..0000000 --- a/examples/templates/project.liquid +++ /dev/null @@ -1,2 +0,0 @@ -babaganuj -{{project.id}} -- cgit v1.2.3-70-g09d2