diff options
| author | Alon Levy <alon@pobox.com> | 2015-03-07 08:39:18 +0200 |
|---|---|---|
| committer | Alon Levy <alon@pobox.com> | 2015-03-07 15:02:42 +0200 |
| commit | 2746c5d10ca67fdfd31ead979d0ccd3ee03ebed6 (patch) | |
| tree | 4044b1091d95b6d294ee5741ec6ecaf10993f4bc /src/client/model/types.js | |
| parent | 0e51a475db95fe410ca43c03710b75ab389bd6d5 (diff) | |
client: move nodetypes from consts to model/types
Diffstat (limited to 'src/client/model/types.js')
| -rw-r--r-- | src/client/model/types.js | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/client/model/types.js b/src/client/model/types.js index fac37cbe..990c3b02 100644 --- a/src/client/model/types.js +++ b/src/client/model/types.js @@ -2,14 +2,19 @@ define(['underscore', 'util'], function(_, util) { -var type_attributes = { - 'third-internship-proposal': ['status', 'startdate', 'enddate', 'description', 'url'], +var nodetypes, + type_attributes = { + 'internship': ['status', 'startdate', 'enddate', 'description', 'url'], 'skill': ['description', 'url'], 'interest': ['description', 'url'], - '_defaults': ['description', 'url'], + 'person': ['description', 'url'], }, all_attributes; +nodetypes = _.keys(type_attributes); + +type_attributes['_defaults'] = ['description', 'url']; + _.values(type_attributes).map(function (attributes) { attributes.push('name'); attributes.push('type'); @@ -20,6 +25,7 @@ all_attributes = _.union(_.flatten(_.map(type_attributes, _.values))).sort(); return ( { + nodetypes: nodetypes, type_attributes: function (type) { util.assert(type[0] !== '_', 'invalid type name'); return type_attributes[type_attributes.hasOwnProperty(type) ? type : '_defaults']; |
