summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortwo hustlers proj <jules+okfprojz@okfoc.us>2015-05-27 13:26:30 -0400
committertwo hustlers proj <jules+okfprojz@okfoc.us>2015-05-27 13:26:30 -0400
commitfca99b7846b78393a87c2aa7b91571cbf02530e3 (patch)
treeb041b2c284b2b3233fdeae28e2fbebdae9c2aef6
parent1dfbf71af1776bbb913a65d6d9a0c5e6b0fadd46 (diff)
parentfb5c451361916593edf39ed5f3614984dc29a36d (diff)
Merge branch 'twohustlers' of github.com:okfocus/okcms into twohustlers
-rw-r--r--app/index.js2
-rw-r--r--app/node_modules/okquery/index.js15
-rw-r--r--app/node_modules/okschema/index.js4
-rw-r--r--site/db.json3
-rw-r--r--site/index.js1
-rw-r--r--site/public/assets/style.css4
-rw-r--r--site/templates/about.liquid1
-rw-r--r--themes/okadmin/templates/partials/inputs.liquid5
8 files changed, 27 insertions, 8 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);
};
}
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/site/db.json b/site/db.json
index 0443362..60ff824 100644
--- a/site/db.json
+++ b/site/db.json
@@ -1118,7 +1118,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, <a href=\"mailto:collaborate@twohustlers.com?subject=SAY HELLO!\">SAY HELLO!</a>\r\n\r\nFOR ANYONE WHO WANTS TO JOIN OUR FAMILY, <a href=\"mailto:jobs@twohustlers.com?subject=JOIN THE FAMILY!\"> SHOW US WHAT YOU ARE MADE OF!</a>\r\n\r\nWEBSITE BY <a href=\"http://okfoc.us/\">OKFOCUS</a>",
- "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 @@
<span class="brady">
<div class="aboutcontent">{{page.body | newline_to_br}}</div>
{% for image in shape.images %}<a href="mailto:{{image.caption}}?subject=SAY HELLO!" style="background-image:url({{ image.uri }})"><span>{{ image.label }}</span></a>{% endfor %}
+ <div class="collabscontent">{{page.collabs | newline_to_br}}</div>
<div class="contactcontent">{{page.contact | newline_to_br}}</div>
</span>
</span>
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 @@
<button class="remove">x</button>
</div>
</div>
+ {% elsif type == 'tag-list' %}
+ <div class="tag-list">
+ <input id="{{name}}-input" name="{{name}}" value="{{spec.value}}"
+ placeholder="Enter a comma separated list of tags.">
+ </div>
{% elsif type == 'media-list' %}
<div class="media-list group loaded">
<div class="fields">