summaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
authorLV-426 <lv-426@taproot.org.il>2015-04-06 13:36:12 +0300
committerLV-426 <lv-426@taproot.org.il>2015-04-06 13:40:27 +0300
commiteca68e91c1aab13176742ef3d39dc7bd43fc23f0 (patch)
tree6f7883fd4bd878d5d68e21c7ee09841db7ea4677 /src/client
parente5d8c63309a658c8a0f195cac704f7b545a0f922 (diff)
wip: per-domain type system
Diffstat (limited to 'src/client')
-rw-r--r--src/client/model/types.js83
1 files changed, 0 insertions, 83 deletions
diff --git a/src/client/model/types.js b/src/client/model/types.js
deleted file mode 100644
index 76959a83..00000000
--- a/src/client/model/types.js
+++ /dev/null
@@ -1,83 +0,0 @@
-define(['underscore', 'util'],
-function(_, util)
-{
-
-var nodetypes,
- type_attributes = {
- 'internship': {
- 'title': 'Internship',
- 'attributes':
- ['status', 'startdate', 'enddate', 'description', 'url',
- 'internship-type',
- 'facility',
- 'facility-affiliation',
- 'cnrs-inserm-unit-code',
- 'street-address',
- 'city',
- 'country',
- ],
- },
- 'skill': {
- 'title': 'Skill',
- 'attributes': ['description', 'url'],
- },
- 'interest': {
- 'title': 'Interesst',
- 'attributes': ['description', 'url'],
- },
- 'person': {
- 'title': 'Person',
- 'attributes': ['description', 'url'],
- },
- 'club': {
- 'title': 'Club',
- 'attributes': ['description', 'url'],
- }
- },
- all_attributes,
- attribute_titles = {
- 'name': 'Name',
- 'type': 'Type',
- 'description': 'Description',
- 'url': 'URL',
- 'status': 'Status',
- 'startdate': 'Start Date',
- 'enddate': 'End Date',
- 'internship-type': 'Internship Type',
- 'facility': 'Lab/Company',
- 'facility-affiliation': 'Lab affiliation',
- 'cnrs-inserm-unit-code': 'CNRS / INSERM unit code',
- 'street-address': 'Street address',
- 'city': 'City',
- 'country': 'Country',
- };
-
-nodetypes = _.keys(type_attributes);
-
-type_attributes['_defaults'] = {
- 'title': 'default',
- 'attributes':['description', 'url']
- };
-
-_.pluck(_.values(type_attributes), 'attributes').map(function (attributes) {
- attributes.push('name');
- attributes.push('type');
- attributes.sort();
- });
-
-all_attributes = _.union(_.flatten(_.pluck(_.values(type_attributes), 'attributes'))).sort();
-
-util.assert(_.isEqual(all_attributes, _.keys(attribute_titles).sort()));
-
-return (
- {
- nodetypes: nodetypes,
- type_attributes: function (type) {
- util.assert(!type || type[0] !== '_', 'invalid type name');
- return type_attributes[!type && type_attributes.hasOwnProperty(type) ? type : '_defaults'].attributes;
- },
- all_attributes: all_attributes,
- attribute_titles: attribute_titles,
- });
-}
-)