From 7e40774959e67f48035da8653b666dd05f35c497 Mon Sep 17 00:00:00 2001 From: Sean Fridman Date: Tue, 26 May 2015 17:11:45 -0400 Subject: Add tag-list input type --- app/node_modules/okschema/index.js | 4 ++++ themes/okadmin/templates/partials/inputs.liquid | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/app/node_modules/okschema/index.js b/app/node_modules/okschema/index.js index c5a56c4..0079f51 100644 --- a/app/node_modules/okschema/index.js +++ b/app/node_modules/okschema/index.js @@ -61,6 +61,10 @@ var types = { 'meta': { parent: 'string', assertValid: function(spec, value) {} + }, + 'tag-list': { + parent: 'string', + assertValid: function(spec, value) {} } } diff --git a/themes/okadmin/templates/partials/inputs.liquid b/themes/okadmin/templates/partials/inputs.liquid index 6eb1e43..25ad197 100644 --- a/themes/okadmin/templates/partials/inputs.liquid +++ b/themes/okadmin/templates/partials/inputs.liquid @@ -49,6 +49,11 @@ + {% elsif type == 'tag-list' %} +
+ +
{% elsif type == 'media-list' %}
-- cgit v1.2.3-70-g09d2 From 448c3c9f0e51d2b42bf5ba9a0e96500e4e8f3dae Mon Sep 17 00:00:00 2001 From: Sean Fridman Date: Wed, 27 May 2015 12:27:29 -0400 Subject: Add query config to sort queries by field --- app/index.js | 2 ++ app/node_modules/okquery/index.js | 15 ++++++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/app/index.js b/app/index.js index 963bfd0..8cca3ee 100644 --- a/app/index.js +++ b/app/index.js @@ -238,6 +238,8 @@ OKCMS.prototype._createQueries = function(queryConfig, resourceCache) { resource: resource, query: query, as: config.as, + sortBy: config.sortBy, + descending: config.descending }); }); }; diff --git a/app/node_modules/okquery/index.js b/app/node_modules/okquery/index.js index 519bc08..4051f95 100644 --- a/app/node_modules/okquery/index.js +++ b/app/node_modules/okquery/index.js @@ -21,6 +21,10 @@ function OKQuery(options) { if (isobject(query)) query = cloneDeep(query); + // Queries are ordered by index by default + var sortField = options.sortBy || '__index'; + var descending = options.descending || false; + Object.defineProperty(this, 'resource', { value: resource, writable: false, @@ -40,7 +44,9 @@ function OKQuery(options) { }); this.get = createQuery(resource, query, { - default: options.default + default: options.default, + sortField: sortField, + descending : descending }); } @@ -53,7 +59,7 @@ function createQuery(resource, query, options) { } else if (isDynamic(query)) { query = queryDynamic(resource); } else if (isSet(query)) { - query = queryAll(resource); + query = queryAll(resource, options.sortField, options.descending); } else { query = querySingle(resource, query); } @@ -100,10 +106,9 @@ function queryDynamic(resource) { }; } -function queryAll(resource) { +function queryAll(resource, sortField, descending) { return function() { - // Always return sorted results - return resource.sortBy('__index'); + return resource.sortBy(sortField, descending); }; } -- cgit v1.2.3-70-g09d2 From fb5c451361916593edf39ed5f3614984dc29a36d Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Wed, 27 May 2015 13:22:13 -0400 Subject: box --- site/db.json | 3 ++- site/index.js | 1 + site/public/assets/style.css | 4 ++-- site/templates/about.liquid | 1 + 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/site/db.json b/site/db.json index 010ad37..16a689a 100644 --- a/site/db.json +++ b/site/db.json @@ -1139,7 +1139,8 @@ "image": "http://www.lansdowneresort.com/meetings/assets/images/masthead/meetings-team-building.jpg", "__index": "1", "contact": "FOR BRANDS WHO WANT TO PLAY WITH US, SAY HELLO!\r\n\r\nFOR ANYONE WHO WANTS TO JOIN OUR FAMILY, SHOW US WHAT YOU ARE MADE OF!\r\n\r\nWEBSITE BY OKFOCUS", - "dateCreated": "" + "dateCreated": "", + "collabs": "\"NONE OF US IS AS SMART AS ALL OF US\"\r\n\r\nWE MAKE THINGS WITH OUR FRIENDS:\r\n\r\nMERI MEDIA\r\nOKFOCUS\r\nMARK FOSTER GAGE ARCHITECTS\r\nMOVING IMAGE & CONTENT\r\nNR2154\r\nTABLE OF CONTENTS\r\nTAKE OUT MEDIA\r\nSHADES OF GREY" }, { "id": "contact", diff --git a/site/index.js b/site/index.js index 8952c46..aa1f58c 100644 --- a/site/index.js +++ b/site/index.js @@ -25,6 +25,7 @@ var app = okcms.createApp({ id: {type: 'string', hidden: true}, title: {type: 'string'}, body: {type: 'text'}, + collabs: {type: 'text'}, contact: {type: 'text'}, image: {type: 'string'} }, diff --git a/site/public/assets/style.css b/site/public/assets/style.css index 3443642..6fbf74f 100644 --- a/site/public/assets/style.css +++ b/site/public/assets/style.css @@ -842,11 +842,11 @@ nav .sub.active a { float: left; } .brady div { - width: 17vw; + width: 17.1vw; position: relative; display: block; float: left; - padding: 1vw; + padding: 1vw 0.5vw 1vw 0.5vw; font-size: 0.8vw; line-height: 1.4vw; border: 1px solid black; diff --git a/site/templates/about.liquid b/site/templates/about.liquid index c693b61..14c046e 100644 --- a/site/templates/about.liquid +++ b/site/templates/about.liquid @@ -3,6 +3,7 @@
{{page.body | newline_to_br}}
{% for image in shape.images %}{{ image.label }}{% endfor %} +
{{page.collabs | newline_to_br}}
{{page.contact | newline_to_br}}
-- cgit v1.2.3-70-g09d2