git-svn-id: https://msi/svn/firstRepo/WebClient/branches/NewRelease@58 0f545695-f87b-41b6-9a03-7f16563b5454
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
define(['jquery', 'underscore', 'backbone', 'router', 'classes/profile', 'classes/cache', 'libs/fastclick'], function
|
define(['jquery', 'underscore', 'backbone', 'router', 'classes/profile', 'classes/cache', 'libs/fastclick', 'classes/debug'], function
|
||||||
($, _, Backbone, Router, Profile, Cache, FastClick) {
|
($, _, Backbone, Router, Profile, Cache, FastClick, Debug) {
|
||||||
'use strict';
|
'use strict';
|
||||||
var init = function () {
|
var init = function () {
|
||||||
//create backbone router
|
//create backbone router
|
||||||
@@ -34,7 +34,7 @@ define(['jquery', 'underscore', 'backbone', 'router', 'classes/profile', 'classe
|
|||||||
var id = "";
|
var id = "";
|
||||||
var displayName = "";
|
var displayName = "";
|
||||||
var email = "";
|
var email = "";
|
||||||
var gender = "";
|
var gender = "unknown";
|
||||||
|
|
||||||
if (auth.network === "google")
|
if (auth.network === "google")
|
||||||
{
|
{
|
||||||
@@ -50,9 +50,16 @@ define(['jquery', 'underscore', 'backbone', 'router', 'classes/profile', 'classe
|
|||||||
email = json.email;
|
email = json.email;
|
||||||
gender = json.gender;
|
gender = json.gender;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(gender !== "")
|
||||||
|
gender = "unknown";
|
||||||
|
|
||||||
|
Debug.writeMessage('Your name is ' + json.name + ' in the social ' + auth.network + ", ID=" + id + ", DisplayName: "+ displayName + ", email:"+ email);
|
||||||
|
|
||||||
Profile._loadProfile(id, function (retVal) {
|
Profile._loadProfile(id, function (retVal) {
|
||||||
if (retVal === false)
|
if (retVal === false)
|
||||||
{
|
{
|
||||||
|
Debug.writeMessage("Profilo non trovato, ne creo uno nuovo");
|
||||||
Profile.createProfile(
|
Profile.createProfile(
|
||||||
id,
|
id,
|
||||||
auth.network,
|
auth.network,
|
||||||
@@ -60,6 +67,7 @@ define(['jquery', 'underscore', 'backbone', 'router', 'classes/profile', 'classe
|
|||||||
email,
|
email,
|
||||||
gender,
|
gender,
|
||||||
function () {
|
function () {
|
||||||
|
Debug.writeMessage("Profilo nuovo creato");
|
||||||
window.location.href = "";
|
window.location.href = "";
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@@ -67,6 +75,9 @@ define(['jquery', 'underscore', 'backbone', 'router', 'classes/profile', 'classe
|
|||||||
else
|
else
|
||||||
window.location.href = "";
|
window.location.href = "";
|
||||||
});
|
});
|
||||||
|
},
|
||||||
|
function(e){
|
||||||
|
Debug.writeMessage('Whoops! ' + e.error.message);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
+10
-6
@@ -29,6 +29,7 @@ define(['jquery', 'backbone'],
|
|||||||
"provincia": null,
|
"provincia": null,
|
||||||
"comune": null,
|
"comune": null,
|
||||||
"cap": null,
|
"cap": null,
|
||||||
|
"note": null,
|
||||||
"tipopm": null,
|
"tipopm": null,
|
||||||
"privacy": 0,
|
"privacy": 0,
|
||||||
"long": null,
|
"long": null,
|
||||||
@@ -68,7 +69,7 @@ define(['jquery', 'backbone'],
|
|||||||
if (response.length > 0)
|
if (response.length > 0)
|
||||||
{
|
{
|
||||||
self.dataloaded = true;
|
self.dataloaded = true;
|
||||||
self.data.name = response[0].Name;
|
self.data.name = unescape(response[0].Name);
|
||||||
self.data.email = response[0].Email;
|
self.data.email = response[0].Email;
|
||||||
self.data.gender = response[0].Gender;
|
self.data.gender = response[0].Gender;
|
||||||
self.data.tema = response[0].TemaUI;
|
self.data.tema = response[0].TemaUI;
|
||||||
@@ -79,11 +80,12 @@ define(['jquery', 'backbone'],
|
|||||||
self.setGender(self.data.gender);
|
self.setGender(self.data.gender);
|
||||||
self.data.isSpacc = response[0].bSpacciatore;
|
self.data.isSpacc = response[0].bSpacciatore;
|
||||||
self.data.dataSpacc.stato = response[0].Stato;
|
self.data.dataSpacc.stato = response[0].Stato;
|
||||||
self.data.dataSpacc.provincia = response[0].Provincia;
|
self.data.dataSpacc.provincia = unescape(response[0].Provincia);
|
||||||
self.data.dataSpacc.comune = response[0].Comune;
|
self.data.dataSpacc.comune = unescape(response[0].Comune);
|
||||||
self.data.dataSpacc.cap = response[0].Cap;
|
self.data.dataSpacc.cap = response[0].Cap;
|
||||||
self.data.dataSpacc.privacy = response[0].bPrivacy;
|
self.data.dataSpacc.privacy = response[0].bPrivacy;
|
||||||
self.data.dataSpacc.tipopm = response[0].TipoPM;
|
self.data.dataSpacc.tipopm = response[0].TipoPM;
|
||||||
|
self.data.dataSpacc.note = unescape(response[0].Note);
|
||||||
self.data.dataSpacc.lat = response[0].Latitudine;
|
self.data.dataSpacc.lat = response[0].Latitudine;
|
||||||
self.data.dataSpacc.long = response[0].Longitudine;
|
self.data.dataSpacc.long = response[0].Longitudine;
|
||||||
retBool = true;
|
retBool = true;
|
||||||
@@ -126,6 +128,7 @@ define(['jquery', 'backbone'],
|
|||||||
this.data.dataSpacc.comune = null;
|
this.data.dataSpacc.comune = null;
|
||||||
this.data.dataSpacc.cap = null;
|
this.data.dataSpacc.cap = null;
|
||||||
this.data.dataSpacc.tipopm = null;
|
this.data.dataSpacc.tipopm = null;
|
||||||
|
this.data.dataSpacc.note = null;
|
||||||
this.data.dataSpacc.privacy = 0;
|
this.data.dataSpacc.privacy = 0;
|
||||||
this.data.dataSpacc.long = null;
|
this.data.dataSpacc.long = null;
|
||||||
this.data.dataSpacc.lat = null;
|
this.data.dataSpacc.lat = null;
|
||||||
@@ -219,7 +222,7 @@ define(['jquery', 'backbone'],
|
|||||||
|
|
||||||
var sendobj = {
|
var sendobj = {
|
||||||
"keyStore": this.getKeySave(),
|
"keyStore": this.getKeySave(),
|
||||||
"name": this.data.name,
|
"name": escape(this.data.name),
|
||||||
"email": this.data.email,
|
"email": this.data.email,
|
||||||
"gender": this.data.gender,
|
"gender": this.data.gender,
|
||||||
"tema": this.data.tema,
|
"tema": this.data.tema,
|
||||||
@@ -248,10 +251,11 @@ define(['jquery', 'backbone'],
|
|||||||
"email": this.data.email,
|
"email": this.data.email,
|
||||||
"isSpacc": this.data.isSpacc,
|
"isSpacc": this.data.isSpacc,
|
||||||
"stato": this.data.dataSpacc.stato,
|
"stato": this.data.dataSpacc.stato,
|
||||||
"prov": this.data.dataSpacc.provincia,
|
"prov": escape(this.data.dataSpacc.provincia),
|
||||||
"comune": this.data.dataSpacc.comune,
|
"comune": escape(this.data.dataSpacc.comune),
|
||||||
"cap": this.data.dataSpacc.cap,
|
"cap": this.data.dataSpacc.cap,
|
||||||
"tipopm": this.data.dataSpacc.tipopm,
|
"tipopm": this.data.dataSpacc.tipopm,
|
||||||
|
"note": escape(this.data.dataSpacc.note),
|
||||||
"privacy": this.data.dataSpacc.privacy,
|
"privacy": this.data.dataSpacc.privacy,
|
||||||
"lng": this.data.dataSpacc.long,
|
"lng": this.data.dataSpacc.long,
|
||||||
"lat": this.data.dataSpacc.lat
|
"lat": this.data.dataSpacc.lat
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
var myManifest = {
|
var myManifest = {
|
||||||
Debug: (window.location.port !== ""),
|
Debug: (window.location.port !== ""),
|
||||||
Name: "Il Lievitario",
|
Name: "Il Lievitario",
|
||||||
Version: "2.9.5.3",
|
Version: "3.0.1.3",
|
||||||
Author: "Denis Ironi",
|
Author: "Denis Ironi",
|
||||||
Settings: {
|
Settings: {
|
||||||
DefaultURL: (window.location.port === "" ? "http://" + window.location.host + "/Service": "http://" + window.location.hostname + ":" + window.location.port + "/Service_Manut"),
|
DefaultURL: (window.location.port === "" ? "http://" + window.location.host + "/Service": "http://" + window.location.hostname + ":" + window.location.port + "/Service_Manut"),
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
define(['app', 'jquery', 'underscore', 'backbone', 'model/authors/authorModel'],
|
||||||
|
function (app, $, _, Backbone, Author) {
|
||||||
|
|
||||||
|
var Authors = Backbone.Collection.extend({
|
||||||
|
// Book is the model of the collection
|
||||||
|
model: Author,
|
||||||
|
url: function () {
|
||||||
|
return myManifest.Settings.DefaultURL + "/api/ricette/authors";
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return Authors;
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
define(['jquery', 'underscore', 'backbone'],
|
||||||
|
function ($, _, Backbone){
|
||||||
|
|
||||||
|
var Author=Backbone.Model.extend({
|
||||||
|
//default attributes
|
||||||
|
defaults:{
|
||||||
|
name:''
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return Author;
|
||||||
|
});
|
||||||
|
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
<br>
|
<br>
|
||||||
<center>
|
<center>
|
||||||
<h1 style='font-size: xx-large;'><%= app.Name %><sup style='font-size: medium;'>©</sup></h1>
|
<h1 style='font-size: xx-large;'><%= app.Name %><sup style='font-size: medium;'>©</sup></h1>
|
||||||
<p>Copyright 2015<br>Lievitario è un marchio registrato</p>
|
<p>Copyright 2015-2016<br>Lievitario è un marchio registrato</p>
|
||||||
<br>Applicazione Ricettario del <br><br>'<i><b>Gruppo La Pasta Madre</b></i>'<br><br>
|
<br>Applicazione Ricettario del <br><br>'<i><b>Gruppo La Pasta Madre</b></i>'<br><br>
|
||||||
<b>Versione:</b> <%= app.Version %><br><br>
|
<b>Versione:</b> <%= app.Version %><br><br>
|
||||||
<b>Sviluppatore:</b> <%= app.Author %><br><br>
|
<b>Sviluppatore:</b> <%= app.Author %><br><br>
|
||||||
|
|||||||
@@ -4,9 +4,9 @@
|
|||||||
<% var item = data[i]; %>
|
<% var item = data[i]; %>
|
||||||
<li><a href="#ricetta/<%= item.ricetta_id%>" class="ui-btn ui-btn-icon-right ui-icon-carat-r">
|
<li><a href="#ricetta/<%= item.ricetta_id%>" class="ui-btn ui-btn-icon-right ui-icon-carat-r">
|
||||||
<% if(item.firstImage === ""){ %>
|
<% if(item.firstImage === ""){ %>
|
||||||
<img class="thmbImg emptyItemList">
|
<!--<img class="thmbImg emptyItemList">-->
|
||||||
<%}else{%>
|
<%}else{%>
|
||||||
<img class="thmbImg" src='<%=myManifest.Settings.DefaultURL%>/api/photo/thumbnail/<%=item.firstImage%>'>
|
<!--<img class="thmbImg" src='<%=myManifest.Settings.DefaultURL%>/api/photo/thumbnail/<%=item.firstImage%>'>-->
|
||||||
<%}%>
|
<%}%>
|
||||||
<div class='ricettaTitolo'><%= unescape(item.titolo) %></div>
|
<div class='ricettaTitolo'><%= unescape(item.titolo) %></div>
|
||||||
<div class='ricettaAutore'><%= unescape(item.autore) %></div>
|
<div class='ricettaAutore'><%= unescape(item.autore) %></div>
|
||||||
|
|||||||
@@ -138,7 +138,7 @@ define(['jquery', 'underscore', 'backbone', 'text!modules/home/homeViewTemplate.
|
|||||||
this.changePicture(Profile.data.picture);
|
this.changePicture(Profile.data.picture);
|
||||||
}
|
}
|
||||||
|
|
||||||
Debug.writeMessage(myManifest.Agent.ua);
|
//Debug.writeMessage(myManifest.Agent.ua);
|
||||||
},
|
},
|
||||||
onClosing: function () {
|
onClosing: function () {
|
||||||
if (this.freeWall !== null)
|
if (this.freeWall !== null)
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ define(['jquery', 'underscore', 'backbone', 'text!modules/item/itemViewTemplate.
|
|||||||
onShowed: function(){
|
onShowed: function(){
|
||||||
var self = this;
|
var self = this;
|
||||||
$('body').scrollTop(0);
|
$('body').scrollTop(0);
|
||||||
|
/*
|
||||||
this.galleryWall = new Freewall("#Gallery");
|
this.galleryWall = new Freewall("#Gallery");
|
||||||
this.galleryWall.reset({
|
this.galleryWall.reset({
|
||||||
selector: '.brick',
|
selector: '.brick',
|
||||||
@@ -73,6 +73,7 @@ define(['jquery', 'underscore', 'backbone', 'text!modules/item/itemViewTemplate.
|
|||||||
images.find('img').load(function() {
|
images.find('img').load(function() {
|
||||||
self.galleryWall.fitWidth();
|
self.galleryWall.fitWidth();
|
||||||
});
|
});
|
||||||
|
*/
|
||||||
|
|
||||||
$.mobile.loading('hide');
|
$.mobile.loading('hide');
|
||||||
},
|
},
|
||||||
@@ -95,7 +96,7 @@ define(['jquery', 'underscore', 'backbone', 'text!modules/item/itemViewTemplate.
|
|||||||
self.scrollPositions = [];
|
self.scrollPositions = [];
|
||||||
self.$arrayContent = self.$el.find('div[data-role="content"]');
|
self.$arrayContent = self.$el.find('div[data-role="content"]');
|
||||||
self.$arrayNavBar = self.$el.find('div[data-role="navbar"] a');
|
self.$arrayNavBar = self.$el.find('div[data-role="navbar"] a');
|
||||||
|
/*
|
||||||
self.$photos = self.$el.find('#contentFoto a');
|
self.$photos = self.$el.find('#contentFoto a');
|
||||||
self.$photos.on("click", function(e){
|
self.$photos.on("click", function(e){
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
@@ -115,7 +116,7 @@ define(['jquery', 'underscore', 'backbone', 'text!modules/item/itemViewTemplate.
|
|||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
*/
|
||||||
for (var i = self.$arrayContent.length - 1; i >= 0; i--) {
|
for (var i = self.$arrayContent.length - 1; i >= 0; i--) {
|
||||||
self.scrollPositions.push(0);
|
self.scrollPositions.push(0);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
var widthImg = 320;
|
var widthImg = 320;
|
||||||
if( myManifest.Agent.device.type != "" )
|
if( myManifest.Agent.device.type != "" )
|
||||||
{
|
{
|
||||||
//prendo la larghezza del viewport e sottraggo il 10%, poi divito per le due colonne
|
/*prendo la larghezza del viewport e sottraggo il 10perc, poi divito per le due colonne*/
|
||||||
widthImg = (myManifest.Settings.Device.Width - (myManifest.Settings.Device.Width / 10)) / 2;
|
widthImg = (myManifest.Settings.Device.Width - (myManifest.Settings.Device.Width / 10)) / 2;
|
||||||
if(widthImg>320)
|
if(widthImg>320)
|
||||||
widthImg = 320;
|
widthImg = 320;
|
||||||
@@ -34,14 +34,14 @@
|
|||||||
<p id='procedimento'><%= ricetta.procedimento%></p>
|
<p id='procedimento'><%= ricetta.procedimento%></p>
|
||||||
<p style="font-size: xx-small;font-weight: lighter;">La proprietà del materiale pubblicato nel Lievitario , salvo diversa indicazione, è dei rispettivi autori. E’ vietata la ripubblicazione, anche parziale, di tutto il materiale pubblicato nel sito Lievitario senza preventiva autorizzazione scritta.</p>
|
<p style="font-size: xx-small;font-weight: lighter;">La proprietà del materiale pubblicato nel Lievitario , salvo diversa indicazione, è dei rispettivi autori. E’ vietata la ripubblicazione, anche parziale, di tutto il materiale pubblicato nel sito Lievitario senza preventiva autorizzazione scritta.</p>
|
||||||
</div>
|
</div>
|
||||||
<div id="contentFoto" data-role="content" style="display: none;">
|
<!--<div id="contentFoto" data-role="content" style="display: none;">
|
||||||
<h1>Foto</h1>
|
<h1>Foto</h1>
|
||||||
<div id="Gallery" class="freewallGallery">
|
<div id="Gallery" class="freewallGallery">
|
||||||
<% _.each(ricetta.foto, function(fotoID) {%>
|
<% _.each(ricetta.foto, function(fotoID) {%>
|
||||||
<div class='brick' style='width:<%=widthImg%>px;'><a id="photo_<%=fotoID.ID%>" data-role="none" data-photoid="<%=fotoID.ID%>" href=""><img src='<%=myManifest.Settings.DefaultURL%>/api/photo/medium/<%=fotoID.ID%>' class="imageborder"></a></div>
|
<div class='brick' style='width:<%=widthImg%>px;'><a id="photo_<%=fotoID.ID%>" data-role="none" data-photoid="<%=fotoID.ID%>" href=""><img src='<%=myManifest.Settings.DefaultURL%>/api/photo/medium/<%=fotoID.ID%>' class="imageborder"></a></div>
|
||||||
<%});%>
|
<%});%>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>-->
|
||||||
<!--<div id="contentVideo" data-role="content" data-theme="d" style="display: none;" data-iscroll>
|
<!--<div id="contentVideo" data-role="content" data-theme="d" style="display: none;" data-iscroll>
|
||||||
<h1>Video</h1>
|
<h1>Video</h1>
|
||||||
<p id='video'></p>
|
<p id='video'></p>
|
||||||
@@ -51,8 +51,8 @@
|
|||||||
<ul>
|
<ul>
|
||||||
<li><a href="" class="ui-btn-active ui-state-persist">Ingredienti</a></li>
|
<li><a href="" class="ui-btn-active ui-state-persist">Ingredienti</a></li>
|
||||||
<li><a href="">Procedimento</a></li>
|
<li><a href="">Procedimento</a></li>
|
||||||
<li><a href="">Foto</a></li>
|
<!--<li><a href="">Foto</a></li>
|
||||||
<!--<li><a href="">Video</a></li>-->
|
<li><a href="">Video</a></li>-->
|
||||||
</ul>
|
</ul>
|
||||||
</div><!-- /navbar -->
|
</div><!-- /navbar -->
|
||||||
<% if(ricetta.autore.length > 0){ %>
|
<% if(ricetta.autore.length > 0){ %>
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
<div id="content">
|
<div id="content">
|
||||||
<div id="siteNotice">
|
<div id="siteNotice">
|
||||||
</div>
|
</div>
|
||||||
<h3 id="firstHeading" class="firstHeading"><%= item.Name%></h3>
|
<h3 id="firstHeading" class="firstHeading"><%= unescape(item.Name)%></h3>
|
||||||
<div id="bodyContent">
|
<div id="bodyContent">
|
||||||
<p><i>Località:</i> <%= item.Indirizzo%><br>
|
<p><i>Località:</i> <%= unescape(item.Comune) + ", " + item.Cap + ", " + unescape(item.Provincia)%><br>
|
||||||
<i>Tipo di Lievito:</i> <% if(item.TipoPM==1){%>Pasta Madre Solida<%} else if(item.TipoPM==2){%>Li.Co.Li.<%}else{%>Entrambi<%}%><br>
|
<i>Tipo di Lievito:</i> <% if(item.TipoPM==1){%>Pasta Madre Solida<%} else if(item.TipoPM==2){%>Li.Co.Li.<%} else if(item.TipoPM==4){%>Gluten Free<%}else{%>Entrambi<%}%><br>
|
||||||
<i>Contatta:</i> <a href="mailto:<%= item.Email%>"><%= item.Email%></a>
|
<i>Contatta:</i> <a href="mailto:<%= item.Email%>"><%= item.Email%></a>
|
||||||
|
<% if(item.Note!=""){%><br><i>Note:</i> <%= unescape(item.Note)%><%}%>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -13,6 +13,10 @@ define(['jquery', 'underscore', 'backbone', 'text!modules/maps/mapsViewTemplate.
|
|||||||
url: "http://app.gruppolapastamadre.it/icon.png",
|
url: "http://app.gruppolapastamadre.it/icon.png",
|
||||||
scaledSize: new google.maps.Size(24, 24)
|
scaledSize: new google.maps.Size(24, 24)
|
||||||
},
|
},
|
||||||
|
iconPMGF: {
|
||||||
|
url: "http://app.gruppolapastamadre.it/iconGreen.png",
|
||||||
|
scaledSize: new google.maps.Size(24, 24)
|
||||||
|
},
|
||||||
initialize: function () {
|
initialize: function () {
|
||||||
this.id = "MapsView";
|
this.id = "MapsView";
|
||||||
this.markers = [];
|
this.markers = [];
|
||||||
@@ -167,7 +171,7 @@ define(['jquery', 'underscore', 'backbone', 'text!modules/maps/mapsViewTemplate.
|
|||||||
var self = this;
|
var self = this;
|
||||||
var marker = new google.maps.Marker({
|
var marker = new google.maps.Marker({
|
||||||
position: new google.maps.LatLng(ele.Latitudine, ele.Longitudine),
|
position: new google.maps.LatLng(ele.Latitudine, ele.Longitudine),
|
||||||
icon: self.iconPM,
|
icon: ele.TipoPM == "4"?self.iconPMGF:self.iconPM,
|
||||||
//label: ele.Name,
|
//label: ele.Name,
|
||||||
title: ele.Name,
|
title: ele.Name,
|
||||||
map: self.map
|
map: self.map
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<li data-role="list-divider">Altre opzioni</li>
|
<li data-role="list-divider">Altre opzioni</li>
|
||||||
<li><a id="converterLnk" href="#" class="ui-li-icon ui-corner-none">Convertitore</a></li>
|
<li><a id="converterLnk" href="#" class="ui-li-icon ui-corner-none">Convertitore</a></li>
|
||||||
|
|
||||||
<li><a id="settingLnk" href="#settingsView">Impostazioni</a></li>
|
<!--<li><a id="settingLnk" href="#settingsView">Impostazioni</a></li>-->
|
||||||
<li><a id="aboutLnk" href="#aboutView">Informazioni su...</a></li>
|
<li><a id="aboutLnk" href="#aboutView">Informazioni su...</a></li>
|
||||||
<li><a id="donationLnk" href="#donationView">Donazione</a></li>
|
<li><a id="donationLnk" href="#donationView">Donazione</a></li>
|
||||||
<li><a id="debugMsgLnk" href="#debugView">Messaggi di debug</a></li>
|
<li><a id="debugMsgLnk" href="#debugView">Messaggi di debug</a></li>
|
||||||
|
|||||||
@@ -56,12 +56,12 @@ define(['jquery', 'underscore', 'backbone','text!modules/search/searchViewTempla
|
|||||||
//render the content into div of view
|
//render the content into div of view
|
||||||
render: function () {
|
render: function () {
|
||||||
if (this.created === true)
|
if (this.created === true)
|
||||||
{
|
{
|
||||||
SearchView.__super__.render.call(this);
|
SearchView.__super__.render.call(this);
|
||||||
this.$el.append(this.header.$el);
|
this.$el.append(this.header.$el);
|
||||||
this.$el.append(this.template({data:this.collection.toJSON()}));
|
this.$el.append(this.template({data:this.collection.toJSON()}));
|
||||||
this.$el.append(this.footer.$el);
|
this.$el.append(this.footer.$el);
|
||||||
}
|
}
|
||||||
this.$el.find('#nResult').val(Profile.data.risRic);
|
this.$el.find('#nResult').val(Profile.data.risRic);
|
||||||
this.trigger("renderCompleted:Search", this);
|
this.trigger("renderCompleted:Search", this);
|
||||||
this.$el.find("#searchBtn").addClass("ui-btn-active");
|
this.$el.find("#searchBtn").addClass("ui-btn-active");
|
||||||
|
|||||||
@@ -5,10 +5,16 @@
|
|||||||
<label for="categoria">Categoria:</label>
|
<label for="categoria">Categoria:</label>
|
||||||
<select name="categoria" id="categoria" data-native-menu="true" >
|
<select name="categoria" id="categoria" data-native-menu="true" >
|
||||||
<option value="0" selected="true">Selezionare Categoria...</option>
|
<option value="0" selected="true">Selezionare Categoria...</option>
|
||||||
<% for (var i = 0; i < data.length; i++) { %>
|
<option value="3">Dolci</option>
|
||||||
<% var item = data[i]; %>
|
<option value="6">Esuberi</option>
|
||||||
<option value="<%=item.category_id%>"><%=item.name%></option>
|
<option value="4">Focacce</option>
|
||||||
<% } %>
|
<option value="10">Grandi Lievitati</option>
|
||||||
|
<option value="1">Pane</option>
|
||||||
|
<option value="5">Panificati Vari</option>
|
||||||
|
<option value="9">Pasquali</option>
|
||||||
|
<option value="2">Pizza</option>
|
||||||
|
<option value="8">Senza Glutine</option>
|
||||||
|
<option value="7">Vegane</option>
|
||||||
</select><br>
|
</select><br>
|
||||||
<label for="difficoltaFrm">Livello Difficoltà:</label>
|
<label for="difficoltaFrm">Livello Difficoltà:</label>
|
||||||
<form id="difficoltaFrm" data-role="none">
|
<form id="difficoltaFrm" data-role="none">
|
||||||
@@ -21,11 +27,18 @@
|
|||||||
<label for="nResult">Numero Risultati:</label>
|
<label for="nResult">Numero Risultati:</label>
|
||||||
<select name="nResult" id="nResult" >
|
<select name="nResult" id="nResult" >
|
||||||
<option value="10" selected="true">10</option>
|
<option value="10" selected="true">10</option>
|
||||||
<option value="15">15</option>
|
|
||||||
<option value="20">20</option>
|
|
||||||
<option value="25">25</option>
|
<option value="25">25</option>
|
||||||
<option value="30">30</option>
|
<option value="50">50</option>
|
||||||
|
<option value="100">100</option>
|
||||||
</select>
|
</select>
|
||||||
|
<!--
|
||||||
|
<label for="author">Autore:</label>
|
||||||
|
<select name="author" id="author" >
|
||||||
|
<% for (var i = 0; i < data.length; i++) { %>
|
||||||
|
<% var item = unescape(data[i].autore); %>
|
||||||
|
<option value="<%=item%>"><%=item%></option>
|
||||||
|
<%}%>
|
||||||
|
</select>-->
|
||||||
<br><br>
|
<br><br>
|
||||||
<center><a href="" id="search" button="true" class="ui-btn ui-corner-all">Cerca</a></center>
|
<center><a href="" id="search" button="true" class="ui-btn ui-corner-all">Cerca</a></center>
|
||||||
</div>
|
</div>
|
||||||
@@ -59,6 +59,7 @@ define(['jquery', 'underscore', 'backbone','text!modules/settings/settingsViewTe
|
|||||||
Profile.data.dataSpacc.comune = this.$el.find('#comune').val();
|
Profile.data.dataSpacc.comune = this.$el.find('#comune').val();
|
||||||
Profile.data.dataSpacc.cap = this.$el.find('#CAP').val();
|
Profile.data.dataSpacc.cap = this.$el.find('#CAP').val();
|
||||||
Profile.data.dataSpacc.tipopm = this.$el.find('#tPM').val();
|
Profile.data.dataSpacc.tipopm = this.$el.find('#tPM').val();
|
||||||
|
Profile.data.dataSpacc.note = this.$el.find('#note').val();
|
||||||
Profile.data.dataSpacc.privacy = this.$el.find('#privacyChk').prop('checked')?"1":"0";
|
Profile.data.dataSpacc.privacy = this.$el.find('#privacyChk').prop('checked')?"1":"0";
|
||||||
|
|
||||||
if(Profile.data.email === "" ||
|
if(Profile.data.email === "" ||
|
||||||
@@ -87,21 +88,28 @@ define(['jquery', 'underscore', 'backbone','text!modules/settings/settingsViewTe
|
|||||||
$.ajax({
|
$.ajax({
|
||||||
url: "http://maps.google.com/maps/api/geocode/json?address=" +
|
url: "http://maps.google.com/maps/api/geocode/json?address=" +
|
||||||
Profile.data.dataSpacc.comune + "+" +
|
Profile.data.dataSpacc.comune + "+" +
|
||||||
Profile.data.dataSpacc.comune + "+" +
|
Profile.data.dataSpacc.cap + "+" +
|
||||||
Profile.data.dataSpacc.provincia + "+" + Profile.data.dataSpacc.stato + "&sensor=false",
|
Profile.data.dataSpacc.provincia + "+" + Profile.data.dataSpacc.stato + "&sensor=false",
|
||||||
Type: "GET"
|
Type: "GET"
|
||||||
}).then(function ( response ) {
|
}).then(function ( response ) {
|
||||||
if(response.results.length == 1)
|
if(response.results.length == 1)
|
||||||
{
|
{
|
||||||
Profile.data.dataSpacc.lat = response.results[0].geometry.location.lat;
|
Profile.data.dataSpacc.lat = response.results[0].geometry.location.lat;
|
||||||
Profile.data.dataSpacc.long = response.results[0].geometry.location.lng;
|
Profile.data.dataSpacc.long = response.results[0].geometry.location.lng;
|
||||||
Profile.updateProfile(function(){
|
|
||||||
self._flagSave = false;
|
|
||||||
self.$el.find('#titlePopup').html("Salvataggio");
|
|
||||||
self.$el.find('#messaggio').html("Impostazioni salvate con successo");
|
|
||||||
self.$el.find('#popupDialog').popup("open");
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(Profile.data.dataSpacc.lat === "" &&
|
||||||
|
Profile.data.dataSpacc.long === ""){
|
||||||
|
self._flagSave = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Profile.updateProfile(function(){
|
||||||
|
self._flagSave = false;
|
||||||
|
self.$el.find('#titlePopup').html("Salvataggio");
|
||||||
|
self.$el.find('#messaggio').html("Impostazioni salvate con successo");
|
||||||
|
self.$el.find('#popupDialog').popup("open");
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -162,7 +170,7 @@ define(['jquery', 'underscore', 'backbone','text!modules/settings/settingsViewTe
|
|||||||
})
|
})
|
||||||
.then( function ( response ) {
|
.then( function ( response ) {
|
||||||
$.each( response, function ( i, val ) {
|
$.each( response, function ( i, val ) {
|
||||||
html += "<li>" + val.Comune + "<input id='hdnCAP" + i + "'' type='hidden' value='" + val.CAP + "'></li>";
|
html += "<li>" + unescape(val.Comune) + "<input id='hdnCAP" + i + "'' type='hidden' value='" + val.CAP + "'></li>";
|
||||||
});
|
});
|
||||||
$ul.html( html );
|
$ul.html( html );
|
||||||
$ul.listview( "refresh" );
|
$ul.listview( "refresh" );
|
||||||
@@ -221,6 +229,7 @@ define(['jquery', 'underscore', 'backbone','text!modules/settings/settingsViewTe
|
|||||||
|
|
||||||
this.$el.find('#comune').val(Profile.data.dataSpacc.comune);
|
this.$el.find('#comune').val(Profile.data.dataSpacc.comune);
|
||||||
this.$el.find('#CAP').val(Profile.data.dataSpacc.cap);
|
this.$el.find('#CAP').val(Profile.data.dataSpacc.cap);
|
||||||
|
this.$el.find('#note').val(Profile.data.dataSpacc.note);
|
||||||
this.$el.find('#tPM').val(Profile.data.dataSpacc.tipopm);
|
this.$el.find('#tPM').val(Profile.data.dataSpacc.tipopm);
|
||||||
this.$el.find('#privacyChk').prop('checked', Profile.data.dataSpacc.privacy==="0"?false:true);
|
this.$el.find('#privacyChk').prop('checked', Profile.data.dataSpacc.privacy==="0"?false:true);
|
||||||
|
|
||||||
|
|||||||
@@ -32,8 +32,11 @@
|
|||||||
<label for="stato">Stato:</label>
|
<label for="stato">Stato:</label>
|
||||||
<select name="stato" id="stato">
|
<select name="stato" id="stato">
|
||||||
<option value='AUSTRIA'>Austria</option>
|
<option value='AUSTRIA'>Austria</option>
|
||||||
|
<option value='AUSTRIALIA'>Austrialia</option>
|
||||||
|
<option value='ABUDHABI'>Abu Dhabi</option>
|
||||||
<option value='BELGIO'>Belgio</option>
|
<option value='BELGIO'>Belgio</option>
|
||||||
<option value='BULGARIA'>Bulgaria</option>
|
<option value='BULGARIA'>Bulgaria</option>
|
||||||
|
<option value='CANADA'>Canada</option>
|
||||||
<option value='CIPRO'>Cipro</option>
|
<option value='CIPRO'>Cipro</option>
|
||||||
<option value='CROAZIA'>Croazia</option>
|
<option value='CROAZIA'>Croazia</option>
|
||||||
<option value='DANIMARCA'>Danimarca</option>
|
<option value='DANIMARCA'>Danimarca</option>
|
||||||
@@ -54,11 +57,13 @@
|
|||||||
<option value='PORTOGALLO'>Portogallo</option>
|
<option value='PORTOGALLO'>Portogallo</option>
|
||||||
<option value='REGNOUNITO'>RegnoUnito</option>
|
<option value='REGNOUNITO'>RegnoUnito</option>
|
||||||
<option value='REP.CECA'>Rep.Ceca</option>
|
<option value='REP.CECA'>Rep.Ceca</option>
|
||||||
|
<option value='ROMANIA'>Romania</option>
|
||||||
<option value='SLOVACCHIA'>Slovacchia</option>
|
<option value='SLOVACCHIA'>Slovacchia</option>
|
||||||
<option value='SLOVENIA'>Slovenia</option>
|
<option value='SLOVENIA'>Slovenia</option>
|
||||||
<option value='ROMANIA'>Romania</option>
|
|
||||||
<option value='SPAGNA'>Spagna</option>
|
<option value='SPAGNA'>Spagna</option>
|
||||||
|
<option value='USA'>Stati Uniti D'America</option>
|
||||||
<option value='SVEZIA'>Svezia</option>
|
<option value='SVEZIA'>Svezia</option>
|
||||||
|
<option value='SVIZZERA'>Svizzera</option>
|
||||||
<option value='UNGHERIA'>Ungheria</option>
|
<option value='UNGHERIA'>Ungheria</option>
|
||||||
</select>
|
</select>
|
||||||
<label for="prov">Provincia:</label>
|
<label for="prov">Provincia:</label>
|
||||||
@@ -185,7 +190,10 @@
|
|||||||
<option value="1" selected="true">Solida</option>
|
<option value="1" selected="true">Solida</option>
|
||||||
<option value="2">Liquida/Licoli</option>
|
<option value="2">Liquida/Licoli</option>
|
||||||
<option value="3">Entrambe</option>
|
<option value="3">Entrambe</option>
|
||||||
|
<option value="4">GlutenFree</option>
|
||||||
</select>
|
</select>
|
||||||
|
<label for="note">Note:</label>
|
||||||
|
<input type="text" name="note" id="note" placeholder="Note...">
|
||||||
<label>Infomativa privacy, AUTORIZZAZIONE DATI PERSONALI
|
<label>Infomativa privacy, AUTORIZZAZIONE DATI PERSONALI
|
||||||
ai sensi e per gli effetti degli artt. 13 e 23 del D.Lgs. n. 196/2003, acconsento al trattamento e alla pubblicazione dei dati personali forniti a seguito della
|
ai sensi e per gli effetti degli artt. 13 e 23 del D.Lgs. n. 196/2003, acconsento al trattamento e alla pubblicazione dei dati personali forniti a seguito della
|
||||||
segnalazione inoltrata.</label>
|
segnalazione inoltrata.</label>
|
||||||
|
|||||||
+4
-4
@@ -4,7 +4,7 @@ define(['jquery', 'underscore', 'backbone',
|
|||||||
'modules/sync/sync', 'modules/donation/donation','modules/settings/settings',
|
'modules/sync/sync', 'modules/donation/donation','modules/settings/settings',
|
||||||
'modules/debug/debug','modules/maps/maps',
|
'modules/debug/debug','modules/maps/maps',
|
||||||
'model/note/noteCollection', 'model/category/categoryCollection', 'model/categoryItem/categoryItemCollection',
|
'model/note/noteCollection', 'model/category/categoryCollection', 'model/categoryItem/categoryItemCollection',
|
||||||
'model/item/itemCollection', 'model/item/ingredientiCollection', 'model/categoryItem/foundItemCollection',
|
'model/item/itemCollection', 'model/item/ingredientiCollection', 'model/categoryItem/foundItemCollection','model/authors/authorCollection',
|
||||||
'classes/cache', 'libs/fastclick',
|
'classes/cache', 'libs/fastclick',
|
||||||
'jqm', 'jQueryPlugins'],
|
'jqm', 'jQueryPlugins'],
|
||||||
function ($, _, Backbone,
|
function ($, _, Backbone,
|
||||||
@@ -13,7 +13,7 @@ define(['jquery', 'underscore', 'backbone',
|
|||||||
SyncView, DonationView, SettingsView,
|
SyncView, DonationView, SettingsView,
|
||||||
DebugView, MapsView,
|
DebugView, MapsView,
|
||||||
NoteCollection, CategoryCollection, CategoryItemCollection,
|
NoteCollection, CategoryCollection, CategoryItemCollection,
|
||||||
ItemCollection, IngredientiCollection, FoundItemCollection,
|
ItemCollection, IngredientiCollection, FoundItemCollection, AuthorCollection,
|
||||||
Cache, FastClick) {
|
Cache, FastClick) {
|
||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
@@ -172,9 +172,9 @@ define(['jquery', 'underscore', 'backbone',
|
|||||||
this.changePage(mapsView);
|
this.changePage(mapsView);
|
||||||
},
|
},
|
||||||
showSearch: function () {
|
showSearch: function () {
|
||||||
var categories = new CategoryCollection();
|
var authors = new AuthorCollection();
|
||||||
// will render home view and navigate to homeView
|
// will render home view and navigate to homeView
|
||||||
var searchView = new SearchView({collection: categories});
|
var searchView = new SearchView({collection: authors});
|
||||||
//indexView.render();
|
//indexView.render();
|
||||||
searchView.bind('renderCompleted:Search', this.changePage, this);
|
searchView.bind('renderCompleted:Search', this.changePage, this);
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user