@@ -36,18 +36,54 @@ require([
36
36
resultsBoxEl . innerHTML = "" ;
37
37
38
38
res . features . forEach ( ( el ) => {
39
- const listEl = document . createElement ( "li" ) ;
39
+ const searchPanel = document . getElementById ( "search-panel" ) ;
40
+ searchPanel . classList . remove ( "h-screen" ) ;
41
+ searchPanel . classList . add ( "mt-10" ) ;
42
+
43
+ const listEl = document . createElement ( "div" ) ;
44
+ listEl . className = "listEl sm:flex p-2 my-5" ;
45
+ const noLogo = "geosearch.png" ;
46
+
47
+ listEl . innerHTML = `
48
+ <div class="w-32 p-4">
49
+ <img src=${
50
+ el . attributes . logo ? el . attributes . logo : noLogo
51
+ } ></img>
52
+ </div>
53
+ <div class="ml-5">
54
+ <h1 class="name">${ el . attributes . name } </h1>
55
+ <ul class="features">
56
+ <li><strong>Riesgo: </strong>${
57
+ el . attributes . riesgo ? el . attributes . riesgo : ""
58
+ } </li>
59
+ <li><strong>Información: </strong>${
60
+ el . attributes . info ? el . attributes . info : ""
61
+ } </li>
62
+ <li><strong>Ámbito territorial: </strong>${
63
+ el . attributes . territorio ? el . attributes . territorio : ""
64
+ } </li>
65
+ <li><strong>Idiomas: </strong>${
66
+ el . attributes . idiomas ? el . attributes . idiomas : ""
67
+ } </li>
68
+ <li><strong>Descripción: </strong>${
69
+ el . attributes . descripcion ? el . attributes . descripcion : ""
70
+ } </li>
71
+ </ul>
72
+ <a class="url" href="${ el . attributes . url } " target="_blank">${
73
+ el . attributes . url
74
+ } </a>
75
+ </div>
76
+ ` ;
40
77
41
- listEl . innerHTML = JSON . stringify ( el . attributes ) ;
42
78
resultsBoxEl . appendChild ( listEl ) ;
43
79
} ) ;
44
80
} else {
45
- resultsBoxEl . innerHTML = "<li >No hay resultados</li >" ;
81
+ resultsBoxEl . innerHTML = "<p >No hay resultados</p >" ;
46
82
}
47
83
} )
48
84
. catch ( function ( e ) {
49
85
resultsBoxEl . innerHTML =
50
- "<li >No se ha podido consultar la base de datos, por favor inténtelo más tarde</li >" ;
86
+ "<p >No se ha podido consultar la base de datos, por favor inténtelo más tarde</p >" ;
51
87
console . error ( "query failed: " , e ) ;
52
88
} ) ;
53
89
} ) ;
0 commit comments