mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2025-06-12 09:00:40 +00:00
Add roadmap and use just one template
This commit is contained in:
BIN
app/static/images/logo_-_dfg.gif
Normal file
BIN
app/static/images/logo_-_dfg.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 14 KiB |
BIN
app/static/images/logo_-_sfb_1288.png
Normal file
BIN
app/static/images/logo_-_sfb_1288.png
Normal file
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 |
@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -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"},
|
||||
|
Reference in New Issue
Block a user