git-svn-id: https://msi/svn/firstRepo/WebClient/branches/Manut_3.0.1@71 0f545695-f87b-41b6-9a03-7f16563b5454

This commit is contained in:
2016-03-01 14:20:31 +00:00
parent edb59bed85
commit 2affad28f1
8 changed files with 46 additions and 55 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
var myManifest = { var myManifest = {
Debug: (window.location.port !== ""), Debug: (window.location.port !== ""),
Name: "Il Lievitario", Name: "Il Lievitario",
Version: "3.0.2.0", Version: "3.0.3.0",
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"),
-15
View File
@@ -1,15 +0,0 @@
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;
});
-13
View File
@@ -1,13 +0,0 @@
define(['jquery', 'underscore', 'backbone'],
function ($, _, Backbone){
var Author=Backbone.Model.extend({
//default attributes
defaults:{
name:''
}
});
return Author;
});
+3 -2
View File
@@ -10,7 +10,8 @@ define(['app', 'jquery', 'underscore', 'backbone', 'model/categoryItem/searchIte
this.dataFilter = { this.dataFilter = {
titolo: options.titolo, titolo: options.titolo,
difficolta: options.difficolta, difficolta: options.difficolta,
categoryId: options.categoryId categoryId: options.categoryId,
autore: options.autore
}; };
this.numItems = options.nResult; this.numItems = options.nResult;
this.indexItems = options.indexItems; this.indexItems = options.indexItems;
@@ -32,7 +33,7 @@ define(['app', 'jquery', 'underscore', 'backbone', 'model/categoryItem/searchIte
this.numItems + this.numItems +
"/" + this.indexItems + "/" + this.indexItems +
"/" + this.dataFilter.categoryId + "/" + this.dataFilter.categoryId +
"/" + this.dataFilter.difficolta; "/" + this.dataFilter.difficolta+ "/" + this.dataFilter.autore;
if(this.dataFilter.titolo !== null) if(this.dataFilter.titolo !== null)
u += "/" + this.dataFilter.titolo; u += "/" + this.dataFilter.titolo;
+27 -3
View File
@@ -2,7 +2,31 @@
<h1>Nessuna ricetta trovata</h1> <h1>Nessuna ricetta trovata</h1>
<%} else { for (var i = 0; i < data.length; i++) { %> <%} else { for (var i = 0; i < data.length; i++) { %>
<% 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 ui-li-has-thumb">
<div class='ricettaTitolo'><%= unescape(item.titolo) %> - <%= unescape(item.categoria_name) %></div><div class='ricettaAutore'><%= unescape(item.autore) %></div> <% if(item.firstImage === ""){ %>
</a></li> <!--<img class="thmbImg emptyItemList">-->
<%}else{%>
<!--<img class="thmbImg" src='<%=data.images.getThumb(item.firstImage)%>'>-->
<%}%>
<div class='ricettaTitolo'><%= unescape(item.titolo) %></div>
<div class='ricettaAutore'><%= unescape(item.autore) %></div>
<br><div class='ricettaAutore'>Diff.:&nbsp;&nbsp;</div>
<div id="valutazione">
<div role="text" data-role="none" aria-label="Molto Semplice" class="star-rating rater-0 star star-rating-applied star-rating-live <% if(parseInt(item.difficolta)>=1){%>star-rating-on<%}%>">
<div data-role="none" title="Molto Semplice">1</div>
</div>
<div data-role="none" role="text" aria-label="Semplice" class="star-rating rater-0 star star-rating-applied star-rating-live <% if(parseInt(item.difficolta)>=2){%>star-rating-on<%}%>">
<div data-role="none" title="Semplice">2</div>
</div>
<div data-role="none" role="text" aria-label="Normale" class="star-rating rater-0 star star-rating-applied star-rating-live <% if(parseInt(item.difficolta)>=3){%>star-rating-on<%}%>">
<div data-role="none" title="Normale">3</div>
</div>
<div data-role="none" role="text" aria-label="Difficile" class="star-rating rater-0 star star-rating-applied star-rating-live <% if(parseInt(item.difficolta)>=4){%>star-rating-on<%}%>">
<div data-role="none" title="Difficile">4</div>
</div>
<div data-role="none" role="text" aria-label="Molto Difficile" class="star-rating rater-0 star star-rating-applied star-rating-live <% if(parseInt(item.difficolta)>=5){%>star-rating-on<%}%>">
<div data-role="none" title="Molto Difficile">5</div>
</div>
</div>
</a></li>
<% }} %> <% }} %>
+5 -4
View File
@@ -9,9 +9,6 @@ define(['jquery', 'underscore', 'backbone','text!modules/search/searchViewTempla
this.id = "SearchView"; this.id = "SearchView";
var self = this; var self = this;
SearchView.__super__.initialize.call(this); SearchView.__super__.initialize.call(this);
this.collection = options.collection;
this.collection.fetch({ success: function () { self.render(); } });
//this.header.title = "pippo";
}, },
events: { events: {
@@ -21,6 +18,7 @@ define(['jquery', 'underscore', 'backbone','text!modules/search/searchViewTempla
performSearch: function (e) { performSearch: function (e) {
e.preventDefault(); e.preventDefault();
var titolo = $('#titolo').val(); var titolo = $('#titolo').val();
var autore = $('#autore').val();
var categoria = $('#categoria').val(); var categoria = $('#categoria').val();
var nResult = $('#nResult').val(); var nResult = $('#nResult').val();
var diffi = $('#difficoltaFrm').serialize(); var diffi = $('#difficoltaFrm').serialize();
@@ -28,7 +26,10 @@ define(['jquery', 'underscore', 'backbone','text!modules/search/searchViewTempla
if (diffi === "") { if (diffi === "") {
diffi = "0"; diffi = "0";
} }
Backbone.history.navigate('search/' + nResult + "/"+ categoria + "/" + diffi + "/" + titolo, { trigger: true }); if (autore === "" || autore == undefined) {
autore = "_";
}
Backbone.history.navigate('search/' + nResult + "/"+ categoria + "/" + diffi + "/" + autore + "/"+titolo, { trigger: true });
}, },
onShowed: function(){ onShowed: function(){
+3 -9
View File
@@ -30,15 +30,9 @@
<option value="25">25</option> <option value="25">25</option>
<option value="50">50</option> <option value="50">50</option>
<option value="100">100</option> <option value="100">100</option>
</select> </select>
<!-- <label for="autore">Autore:</label>
<label for="author">Autore:</label> <input type="text" name="autore" id="autore" placeholder="Autore..." value="" data-clear-btn="true" ><br>
<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>
+7 -8
View File
@@ -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/authors/authorCollection', 'model/item/itemCollection', 'model/item/ingredientiCollection', 'model/categoryItem/foundItemCollection',
'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, AuthorCollection, ItemCollection, IngredientiCollection, FoundItemCollection,
Cache, FastClick) { Cache, FastClick) {
'use strict'; 'use strict';
@@ -57,7 +57,7 @@ define(['jquery', 'underscore', 'backbone',
'debugView': 'showDebug', 'debugView': 'showDebug',
'settingsView': 'showSettings', 'settingsView': 'showSettings',
'donationView': 'showDonation', 'donationView': 'showDonation',
'search/:nresult/:categoria/:difficolta/*titolo': 'searchFn', 'search/:nresult/:categoria/:difficolta/:autore/*titolo': 'searchFn',
'converterView': 'showConverter', 'converterView': 'showConverter',
'moreView': 'showMore', 'moreView': 'showMore',
'*actions': 'defaultAction' //default action '*actions': 'defaultAction' //default action
@@ -172,14 +172,13 @@ define(['jquery', 'underscore', 'backbone',
this.changePage(mapsView); this.changePage(mapsView);
}, },
showSearch: function () { showSearch: function () {
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: authors}); var searchView = new SearchView();
//indexView.render(); indexView.render();
searchView.bind('renderCompleted:Search', this.changePage, this); searchView.bind('renderCompleted:Search', this.changePage, this);
}, },
searchFn: function (nresult, categoria, difficolta, titolo) { searchFn: function (nresult, categoria, difficolta, autore, titolo) {
var foundedItems = new FoundItemCollection({categoryId: categoria, difficolta: difficolta, titolo: titolo, nResult: nresult, indexItems: 0}); var foundedItems = new FoundItemCollection({categoryId: categoria, difficolta: difficolta, titolo: titolo, autore: autore, nResult: nresult, indexItems: 0});
var foundView = new FoundView({collection: foundedItems}); var foundView = new FoundView({collection: foundedItems});
foundView.render(); foundView.render();