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:
39
src/main/resources/static/dataset.js
Normal file
39
src/main/resources/static/dataset.js
Normal 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;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user