git-svn-id: https://msi/svn/firstRepo/WebClient/trunk@13 0f545695-f87b-41b6-9a03-7f16563b5454
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
define(['app', 'jquery', 'underscore', 'backbone', 'model/category/categoryModel'],
|
||||
function (app, $, _, Backbone, Category){
|
||||
|
||||
var Categories=Backbone.Collection.extend({
|
||||
|
||||
// Book is the model of the collection
|
||||
model:Category,
|
||||
|
||||
url: function() {
|
||||
return myManifest.Settings.DefaultURL + "/api/categories";
|
||||
}
|
||||
});
|
||||
|
||||
return Categories;
|
||||
});
|
||||
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
define(['jquery', 'underscore', 'backbone'],
|
||||
function ($, _, Backbone){
|
||||
|
||||
var Category=Backbone.Model.extend({
|
||||
//default attributes
|
||||
defaults:{
|
||||
category_id:"",
|
||||
name:''
|
||||
}
|
||||
});
|
||||
|
||||
return Category;
|
||||
});
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
define(['app', 'jquery', 'underscore', 'backbone', 'model/categoryItem/categoryItemModel'],
|
||||
function (app, $, _, Backbone, Category){
|
||||
|
||||
var CategoryItems=Backbone.Collection.extend({
|
||||
|
||||
categoryId: null,
|
||||
initialize: function (options) {
|
||||
this.categoryId = options.categoryId;
|
||||
},
|
||||
// Book is the model of the collection
|
||||
model:Category,
|
||||
|
||||
url: function() {
|
||||
return myManifest.Settings.DefaultURL + "/api/categoryitems/" + this.categoryId;
|
||||
}
|
||||
});
|
||||
|
||||
return CategoryItems;
|
||||
});
|
||||
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
define(['jquery', 'underscore', 'backbone'],
|
||||
function ($, _, Backbone){
|
||||
|
||||
var CategoryItem = Backbone.Model.extend({
|
||||
//default attributes
|
||||
defaults: {
|
||||
ricetta_id: "",
|
||||
titolo: '',
|
||||
autore: '',
|
||||
valutazione: 0,
|
||||
difficolta: 0,
|
||||
categoria_name: 0
|
||||
}
|
||||
});
|
||||
|
||||
return CategoryItem;
|
||||
});
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
define(['app', 'jquery', 'underscore', 'backbone', 'model/categoryItem/categoryItemModel'],
|
||||
function (app, $, _, Backbone, Category){
|
||||
|
||||
var FoundItems=Backbone.Collection.extend({
|
||||
dataFilter: null,
|
||||
initialize: function (options) {
|
||||
this.dataFilter = {
|
||||
titolo: options.titolo,
|
||||
difficolta: options.difficolta,
|
||||
categoryId: options.categoryId
|
||||
};
|
||||
this.numItems = options.nResult;
|
||||
},
|
||||
|
||||
|
||||
// Book is the model of the collection
|
||||
model:Category,
|
||||
|
||||
url: function() {
|
||||
var u = myManifest.Settings.DefaultURL + "/api/categoryitems/search/" + this.numItems +
|
||||
"/" + this.dataFilter.categoryId +
|
||||
"/" + this.dataFilter.difficolta;
|
||||
if(this.dataFilter.titolo !== null)
|
||||
u += "/" + this.dataFilter.titolo;
|
||||
|
||||
return u;
|
||||
}
|
||||
});
|
||||
|
||||
return FoundItems;
|
||||
});
|
||||
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
define(['app', 'jquery', 'underscore', 'backbone', 'model/item/ingredientiModel'],
|
||||
function (app, $, _, Backbone, Ingrediente){
|
||||
|
||||
var Ingredienti=Backbone.Collection.extend({
|
||||
|
||||
ricettaId: null,
|
||||
initialize: function (options) {
|
||||
this.ricettaId = options.ricettaId;
|
||||
},
|
||||
// Book is the model of the collection
|
||||
model:Ingrediente,
|
||||
|
||||
url: function() {
|
||||
return myManifest.Settings.DefaultURL + "/api/ricetta/ingredienti/" + this.ricettaId;
|
||||
}
|
||||
});
|
||||
|
||||
return Ingredienti;
|
||||
});
|
||||
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
define(['jquery', 'underscore', 'backbone'],
|
||||
function ($, _, Backbone){
|
||||
|
||||
var Ingrediente=Backbone.Model.extend({
|
||||
//default attributes
|
||||
defaults:{
|
||||
id_tipo_ingredienti: -1,
|
||||
nome_ingrediente: "",
|
||||
quantita: -1,
|
||||
id_tipo_quantita: -1,
|
||||
unita: '',
|
||||
note: '',
|
||||
posizione: 0
|
||||
}
|
||||
});
|
||||
|
||||
return Ingrediente;
|
||||
});
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
define(['app', 'jquery', 'underscore', 'backbone', 'model/item/itemModel'],
|
||||
function (app, $, _, Backbone, Item){
|
||||
|
||||
var Items=Backbone.Collection.extend({
|
||||
|
||||
ricettaId: null,
|
||||
initialize: function (options) {
|
||||
this.ricettaId = options.ricettaId;
|
||||
},
|
||||
// Book is the model of the collection
|
||||
model:Item,
|
||||
|
||||
url: function() {
|
||||
return myManifest.Settings.DefaultURL + "/api/ricetta/header/" + this.ricettaId;
|
||||
}
|
||||
});
|
||||
|
||||
return Items;
|
||||
});
|
||||
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
define(['jquery', 'underscore', 'backbone'],
|
||||
function ($, _, Backbone){
|
||||
|
||||
var Item=Backbone.Model.extend({
|
||||
//default attributes
|
||||
defaults:{
|
||||
id_categoria: "",
|
||||
categoria_name: '',
|
||||
ricetta_id: -1,
|
||||
titolo: '',
|
||||
procedimento: '',
|
||||
autore: '',
|
||||
link_fonte: '',
|
||||
link_youtube: '',
|
||||
valutazione: 0,
|
||||
ingredienti: []
|
||||
}
|
||||
});
|
||||
|
||||
return Item;
|
||||
});
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
define(['app', 'jquery', 'underscore', 'backbone', 'model/note/noteModel', 'classes/profile'],
|
||||
function (app, $, _, Backbone, Note, Profile){
|
||||
|
||||
var Notes=Backbone.Collection.extend({
|
||||
|
||||
// Book is the model of the collection
|
||||
model:Note,
|
||||
|
||||
url: function() {
|
||||
return myManifest.Settings.DefaultURL + "/api/profile/" + Profile.getKeySave() + "/ricette";
|
||||
}
|
||||
});
|
||||
|
||||
return Notes;
|
||||
});
|
||||
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
define(['jquery', 'underscore', 'backbone'],
|
||||
function ($, _, Backbone){
|
||||
|
||||
var Note=Backbone.Model.extend({
|
||||
//default attributes
|
||||
idAttribute: "ricetta_id",
|
||||
defaults:{
|
||||
ricetta_id: "",
|
||||
titolo: '',
|
||||
autore: '',
|
||||
valutazione: 0,
|
||||
difficolta: 0
|
||||
}
|
||||
});
|
||||
|
||||
return Note;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user