var keystone = require('keystone');
var Types = keystone.Field.Types;
/**
* Work Item Model
* ===============
*/
var WorkItem = new keystone.List('WorkItem', { sortable: true });
WorkItem.add({
title: { type: Types.Text, required: true, index: true, initial: true },
description: { type: Types.Markdown, initial: true }
}, 'Assets', {
image: { type: Types.CloudinaryImage, note: 'Must be > 2048px on the long edge'},
thumbnail: { type: Types.CloudinaryImage, note: 'Must be > 800px square'},
mediaUrl: { type: Types.Url, label: 'Media URL' },
mediaInfo: { type: Types.Embedly, from: 'mediaUrl' }
}, 'Categorization', {
category: { type: Types.Relationship, ref: 'WorkCategory', many: true },
client: { type: Types.Relationship, ref: 'Client' }
});
/**
* Registration
*/
WorkItem.defaultColumns = 'title, mediaUrl, client';
WorkItem.register();
var keystone = require('keystone');
var Types = keystone.Field.Types;
/**
* Work Category Model
* ===================
*/
var WorkCategory = new keystone.List('WorkCategory', { sortable: true });
WorkCategory.add({
name: { type: Types.Text, required: true, index: true, initial: true },
description: { type: Types.Markdown, initial: true }
});
WorkCategory.relationship({ path: 'items', ref: 'WorkItem', refPath: 'category' });
/**
* Registration
*/
WorkCategory.defaultColumns = 'title';
WorkCategory.register();
var keystone = require('keystone');
var Types = keystone.Field.Types;
/**
* Client Model
* ============
*/
var Client = new keystone.List('Client', { sortable: true });
Client.add({
name: { type: Types.Text, required: true, index: true, initial: true },
description: { type: Types.Markdown, initial: true }
}, 'Identity', {
logo: { type: Types.CloudinaryImage, note: 'Must be > 400px on the long edge'},
thumbnail: { type: Types.CloudinaryImage, note: 'Must be > 800px square'},
url: { type: Types.Url, index: true }
});
Client.relationship({ path: 'work', ref: 'WorkItem', refPath: 'client' });
/**
* Registration
*/
Client.defaultColumns = 'name, url';
Client.register();