Add roadmap and use just one template

This commit is contained in:
Patrick Jentsch
2020-02-07 15:21:59 +01:00
parent 3ce28de053
commit acf5ae32ae
35 changed files with 256 additions and 131 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

View File

@ -80,11 +80,23 @@ nopaque.forms.init = function() {
nopaque.navigation = {};
nopaque.navigation.init = function() {
for (let entry of document.querySelectorAll("#slide-out a:not(.subheader)")) {
var slideOutElement, tocElement;
slideOutElement = document.getElementById("slide-out");
for (let entry of slideOutElement.querySelectorAll("a:not(.subheader)")) {
if (entry.href === window.location.href) {
entry.parentNode.classList.add("active");
}
}
tocElement = document.getElementById("roadmap");
if (!tocElement) {
return
}
for (let entry of tocElement.querySelectorAll("a")) {
if (entry.href === window.location.href) {
entry.classList.add("active");
}
}
}

View File

@ -7,7 +7,8 @@ class RessourceList extends List {
_init(ressources) {
this.addRessources(Object.values(ressources));
this.add(Object.values(ressources));
this.sort("creation_date", {order: "desc"});
}
@ -20,7 +21,7 @@ class RessourceList extends List {
switch(operation.op) {
case "add":
if (pathArray.includes("results")) {break;}
this.addRessources([operation.value]);
this.add([operation.value]);
break;
case "remove":
this.remove("id", pathArray[0]);
@ -41,27 +42,29 @@ class RessourceList extends List {
}
addRessources(ressources) {
add(ressources) {
if (this.dataMapper) {
this.add(ressources.map(x => this.dataMapper(x)));
super.add(ressources.map(x => this.dataMapper(x)));
} else {
this.add(ressources);
super.add(ressources);
}
}
}
RessourceList.dataMapper = {
corpus: corpus => ({description: corpus.description,
id: corpus.id,
link: `/corpora/${corpus.id}`,
service: "corpus",
status: corpus.status,
title: corpus.title}),
job: job => ({description: job.description,
id: job.id,
link: `/jobs/${job.id}`,
service: job.service,
status: job.status,
title: job.title})
corpus: corpus => ({creation_date: corpus.creation_date,
description: corpus.description,
id: corpus.id,
link: `/corpora/${corpus.id}`,
service: "corpus",
status: corpus.status,
title: corpus.title}),
job: job => ({creation_date: job.creation_date,
description: job.description,
id: job.id,
link: `/jobs/${job.id}`,
service: job.service,
status: job.status,
title: job.title})
};
RessourceList.options = {
item: `<tr>
@ -83,7 +86,8 @@ RessourceList.options = {
</tr>`,
page: 4,
pagination: {innerWindow: 8, outerWindow: 1},
valueNames: ["description",
valueNames: ["creation_date",
"description",
"title",
{data: ["id"]},
{name: "link", attr: "href"},