Created
July 7, 2011 14:07
-
-
Save hansv/1069585 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function loadCatalog () { | |
<%- @products.each do |product| -%> | |
storeProduct([0, <%= product.id %>, "", "<%= product.bon_name %>", "<%= product.article_number %>", <%= product.unit_price %>, <%= product.price %>, <%= product.slide? %>,0]); | |
<%- end -%> | |
<% @catalog.each do |catalog| -%> | |
<%- catalog.productgroups.slide.each do |productgroup| -%> | |
<%- unless productgroup.nil? %> | |
<%- productgroup.products.active.each do |product| -%> | |
<%- if product.slide? -%> | |
storeProduct([<%= productgroup.id %>, <%= product.id %>, "<%= product.name %>", "<%= product.bon_name %>", "<%= product.article_number %>", <%= product.unit_price %>, <%= product.price %>, <%= product.slide? %>, <%= 0 %>]); | |
<%- end -%> | |
<%- end -%> | |
storeProductgroup([<%= catalog.id %>, <%= productgroup.id %>, "<%= productgroup.name %>", "<%= productgroup.getSlideImg %>", <%= 0 %>, "productgroup.description_nl"]); | |
<%- end -%> | |
<%- end -%> | |
storeCatalog([<%= catalog.id %>, "<%= catalog.name %>", "<%= catalog.slide_extra_nl %>", "<%= catalog.ancestry %>", <%= catalog.position %>]); | |
<%- end -%> | |
systemDB.transaction( | |
function (tx) { | |
tx.executeSql('select count(*) from clients;', [], function(transaction, results) { | |
if (confirm('syncing done, go to offline version?')) { | |
document.location = '/offline/#/'; | |
} | |
} | |
); | |
} | |
); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment