|
@@ -254,7 +254,7 @@
|
254
|
254
|
//'title':'${Artesano.Nombre}','esp': '${info}'
|
255
|
255
|
//Tries to pass all the info of each artesano into a new page, the page that display this information is 'artesano.html', not to be confused with 'artesanias.html' or 'artesanos.html'(current page)
|
256
|
256
|
//And puts this into the 'item' variable
|
257
|
|
- var item = ons.createElement(`<ons-list-item onclick="myNavigator.pushPage('artesano.html', { data: { title: '${Artesano.Nombre}', mun: '${Artesano.Municipio}', tel: '${Artesano["Telefono 1"]}', email: '${Artesano["E-mail"]}', esp: '${Artesano.Especificacion}', redes: '${Artesano["E-Commerce 1"]}' } })" tappable>
|
|
257
|
+ var item = ons.createElement(`<ons-list-item onclick="myNavigator.pushPage('artesano.html', { data: { title: '${Artesano.Nombre}', mun: '${Artesano.Municipio}', tel: '${Artesano["Telefono 1"]}', email: '${Artesano["E-mail"]}', esp: '${Artesano.Especificacion}', redes: '${Artesano["E-Commerce 1"]}', tecnicas: '' } })" tappable>
|
258
|
258
|
<div class="title">${Artesano.Nombre}</div>
|
259
|
259
|
</ons-list-item>`);
|
260
|
260
|
|
|
@@ -393,9 +393,10 @@
|
393
|
393
|
tel = lot[1],
|
394
|
394
|
email = lot[2],
|
395
|
395
|
esp = lot[3],
|
396
|
|
- redes = lot[4];
|
|
396
|
+ redes = lot[4],
|
|
397
|
+ tecnicas = '';
|
397
|
398
|
|
398
|
|
- listaArt += `<ons-item tappable onclick="myNavigator.pushPage('artesano.html', {data: {title:'${arts[i]}', mun: '${mun}', tel: '${tel}', email: '${email}', esp: '${esp}', redes: '${redes}'}} )" ><div class="center">`+ arts[i] +`</div></ons-item><br>`;
|
|
399
|
+ listaArt += `<ons-item tappable onclick="myNavigator.pushPage('artesano.html', {data: {title:'${arts[i]}', mun: '${mun}', tel: '${tel}', email: '${email}', esp: '${esp}', redes: '${redes}', tecnicas: '' }} )" ><div class="center">`+ arts[i] +`</div></ons-item><br>`;
|
399
|
400
|
}
|
400
|
401
|
|
401
|
402
|
|
|
@@ -537,7 +538,7 @@
|
537
|
538
|
//It iterates though each artists in the all_artesanos json file from before, it displays their name in the "Buscar" page, and it gets prepared so that when its clicked it redirects to the "artesano.html" page with the other aditional information that we have other than the name.
|
538
|
539
|
for (i = 0; i < all_artesanos.length;i++){
|
539
|
540
|
var artesano = ons.createElement(`<ons-list-item class = "artists"
|
540
|
|
- onclick="SNavigator.pushPage('artesano.html', { data: {title: '${all_artesanos[i].Nombre}', mun: '${all_artesanos[i].Municipio}', tel: '${all_artesanos[i]["Telefono 1"]}', email: '${all_artesanos[i]["E-mail"]}', esp: '${all_artesanos[i].Especificacion}', redes: '${all_artesanos[i]["E-Commerce 1"]}' } })" tappable>
|
|
541
|
+ onclick="SNavigator.pushPage('artesano.html', { data: {title: '${all_artesanos[i].Nombre}', mun: '${all_artesanos[i].Municipio}', tel: '${all_artesanos[i]["Telefono 1"]}', email: '${all_artesanos[i]["E-mail"]}', esp: '${all_artesanos[i].Especificacion}', redes: '${all_artesanos[i]["E-Commerce 1"]}', tecnicas: '${all_artesanos[i]["Tecnica 1"]}' } })" tappable>
|
541
|
542
|
<div>${all_artesanos[i].Nombre}</div>
|
542
|
543
|
</ons-list-item>`);
|
543
|
544
|
document.getElementById('results').appendChild(artesano);
|
|
@@ -571,7 +572,8 @@
|
571
|
572
|
tel = this.data.tel,
|
572
|
573
|
em = this.data.email,
|
573
|
574
|
esp = this.data.esp,
|
574
|
|
- redes = this.data.redes;
|
|
575
|
+ redes = this.data.redes,
|
|
576
|
+ tecnicas = this.data.tecnicas;
|
575
|
577
|
|
576
|
578
|
//here the email is the string made from the start to where the '#' is.
|
577
|
579
|
email = em.slice(0, em.search("#"));
|
|
@@ -638,6 +640,16 @@
|
638
|
640
|
console.log("no tiene nada");
|
639
|
641
|
}
|
640
|
642
|
|
|
643
|
+ if(tecnicas.trim() != ''){
|
|
644
|
+ if(tecnicas.includes(";", 0)){
|
|
645
|
+ tecnicas = tecnicas.replace(/;/g,", ");
|
|
646
|
+ data+='Tecnicas que usan: '+tecnicas+'<br>';
|
|
647
|
+ }
|
|
648
|
+ else {
|
|
649
|
+ data+='Tecnicas que usan: '+tecnicas+'<br>';
|
|
650
|
+ }
|
|
651
|
+ }
|
|
652
|
+
|
641
|
653
|
//This is the part that allows eveything (data) to be displayed
|
642
|
654
|
document.getElementById("all").innerHTML = `${data}`;
|
643
|
655
|
|