search nw displays the search results.

other section are being hidden in the case of a search and vice versa.
a 'nothing found' div was implemented
This commit is contained in:
J-Klinke
2024-06-24 17:03:47 +02:00
parent 43d3ff17d5
commit d96da1b1e7
7 changed files with 137 additions and 19 deletions

View File

@@ -0,0 +1,39 @@
export default class Dataset {
#abstract;
#author;
#categories;
#date;
#description;
#id;
#rating;
#title;
#type;
#upvotes;
#url;
#votes;
constructor({abst: shortDescription, author, categories, date, description, id, rating, title, type, upvotes, url, votes}) {
this.#abstract = shortDescription;
this.#author = author;
this.#categories = categories;
this.#date = date;
this.#description = description;
this.#id = id;
this.#rating = rating;
this.#title = title;
this.#type = type;
this.#upvotes = upvotes;
this.#url = url;
this.#votes = votes;
}
createDatasetHTMLElement() {
let template = document.querySelector("#dataset-template");
const clone = template.content.cloneNode(true);
clone.querySelector(".dataset").dataset.id = this.#id;
clone.querySelector("h3").innerText = this.#title;
clone.querySelector("p").innerText = this.#description;
clone.querySelector("span").innerText = this.#upvotes;
return clone;
}
}