specifičen vnos
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
function getSpecific(kljuc) {
|
||||
window.location.href = `/vnos.html?kljuc=${kljuc}`;
|
||||
}
|
||||
|
||||
function getLast() {
|
||||
const url = `http://localhost:3000/vnosi`;
|
||||
fetch(url, {
|
||||
@@ -19,7 +23,7 @@ function getLast() {
|
||||
|
||||
for (let entry of data.data) {
|
||||
let build = `
|
||||
<div class="entry-card">
|
||||
<div class="entry-card" onclick="getSpecific('${entry.PK}')">
|
||||
<h3 class="entry-title">${entry.kljuc}</h3>
|
||||
<p class="entry-definition">${entry.tip}</p>
|
||||
${entry.vsebina}
|
||||
@@ -48,7 +52,8 @@ function search() {
|
||||
},
|
||||
body: JSON.stringify({
|
||||
query: `*${val}*`, // Potencialno mora biti tukaj en "*" wildcard
|
||||
limit: -1
|
||||
limit: -1,
|
||||
sort: true
|
||||
})
|
||||
})
|
||||
.then(response => response.json())
|
||||
@@ -62,7 +67,7 @@ function search() {
|
||||
let len = data.data.length;
|
||||
document.getElementById("page-title").innerText = `Rezultati iskanja (${len}):`;
|
||||
document.getElementById("entry-container").innerHTML = "";
|
||||
|
||||
|
||||
if (len <= 0) {
|
||||
document.getElementById("entry-container").innerHTML = `
|
||||
<p class="page-paragraph">Ni bilo najednih zadetkov za poizvedbo "${val}".</p>
|
||||
@@ -72,7 +77,7 @@ function search() {
|
||||
|
||||
for (let entry of data.data) {
|
||||
let build = `
|
||||
<div class="entry-card">
|
||||
<div class="entry-card" onclick="getSpecific('${entry.PK}')">
|
||||
<h3 class="entry-title">${entry.kljuc}</h3>
|
||||
<p class="entry-definition">${entry.tip}</p>
|
||||
${entry.vsebina}
|
||||
|
||||
Reference in New Issue
Block a user