36 lines
846 B
JavaScript
36 lines
846 B
JavaScript
/* Backbone models for the API */
|
|
"use strict";
|
|
var GE_API = new Object();
|
|
|
|
GE_API.rootUrl = "/api/";
|
|
|
|
GE_API.Event = Backbone.Model.extend({
|
|
rootUrl: GE_API.rootUrl + "event/",
|
|
});
|
|
|
|
GE_API.Events = Backbone.Collection.extend({
|
|
model: GE_API.Event,
|
|
url: GE_API.rootUrl + "event/"
|
|
});
|
|
|
|
GE_API.Place = Backbone.Model.extend({
|
|
rootUrl: function() {
|
|
if (this.get("event")) {
|
|
return GE_API.rootUrl + "event/" + this.get("event").id + "/place/";
|
|
} else {
|
|
return GE_API.rootUrl + "place/";
|
|
}
|
|
}
|
|
});
|
|
|
|
GE_API.Places = Backbone.Collection.extend({
|
|
url: function() {
|
|
if (this.event) {
|
|
return GE_API.rootUrl + "event/" + this.event + "/place/";
|
|
} else {
|
|
return GE_API.rootUrl + "place/";
|
|
}
|
|
}
|
|
});
|
|
|
|
GE_API.Places = Backbone.Collection.
|