Changes for page Nice Display

Last modified by Benjamin Fischer on 2025/03/26 13:19

From version 25.1
edited by Judith Steinfeld
on 2024/10/17 08:53
Change comment: There is no comment for this version
To version 28.7
edited by admin
on 2024/10/23 13:06
Change comment: There is no comment for this version

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.JudithSteinfeld
1 +XWiki.admin
Content
... ... @@ -5,34 +5,23 @@
5 5  The list thrives on being filled. If you want to be subscribed or unsubscribed from this list please contact [[judith.steinfeld@erumdatahub.de>>mailto:judith.steinfeld@erumdatahub.de]]
6 6  )))
7 7  
8 -
9 -
10 -|=(% scope="row" %)(((
11 -=== **Research Group** ===
12 -)))|(((
13 -=== **Affiliation** ===
14 -
15 -**Location**
16 -)))|(((
17 -=== **Information/Contact** ===
18 -)))|(% style="width:553px" %)(((
19 -=== **Research Focus** ===
20 -)))|(% style="width:134px" %)(((
21 -=== **Community** ===
22 -)))
23 -|Group PD Dr. Thorsten Enßlin|(((
24 -Max-Planck-Insititut für Astrophysik (MPA)
25 -
26 -Garching
27 -)))|[[https:~~/~~/wwwmpa.mpa-garching.mpg.de/~~~~ensslin/>>https://wwwmpa.mpa-garching.mpg.de/~~ensslin/]]|(% style="width:553px" %)Information Field Theory|(% style="width:134px" %)KAT
28 -|HUB Materie|(((
29 -|Helmholtz Metadata Collaboration
30 -)))|(((
31 -|https:~/~/helmholtz-metadaten.de/de/materie/uebersicht
32 -)))|(% style="width:553px" %)(((
33 -|Strategien für das Forschungsdatenmanagement
34 -)))|(% style="width:134px" %)
35 -|=(% scope="col" %) | | |(% style="width:553px" %) |(% style="width:134px" %)
36 -|= | | |(% style="width:553px" %) |(% style="width:134px" %)
37 -
38 -
8 +{{velocity}}
9 +#set ($columnsProperties = {
10 + 'affiliation': {"filterable":true, "sortable":true, "html":true},
11 + 'URL': {"type": "hidden"},
12 + "content": {"type": "hidden"},
13 + "tags": {"sortable": false, "filterable": false, "html": true, "headerClass": "tagsCol"},
14 + '_actions': {"actions":["view","edit"]}
15 +})
16 +#set ($options = {
17 + 'className': 'Research Groups.Code.Research GroupsClass',
18 + 'translationPrefix': 'research groups.livetable.',
19 + 'tagCloud': true,
20 + 'rowCount': 15,
21 + 'maxPages': 10,
22 + 'selectedColumn': 'affiliation',
23 + 'defaultOrder': 'asc'
24 +})
25 +#set ($columns = ['affiliation', 'URL', "content", "tags", "tags", "tags", '_actions'])
26 +#livetable('research groups' $columns $columnsProperties $options)
27 +{{/velocity}}
People in ErUM v2.xlsx
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.JudithSteinfeld
Size
... ... @@ -1,0 +1,1 @@
1 +34.5 KB
Content
XWiki.JavaScriptExtension[0]
Caching policy
... ... @@ -1,0 +1,1 @@
1 +default
Code
... ... @@ -1,0 +1,66 @@
1 +const tabName = "research groups";
2 +const tagCols = [
3 + ["Community", "KAT", "KET", "KfB", "KFN", "KFS", "KFSI", "KHuK", "RDS", "beyond ErUM"],
4 + ["Experiment", "CMS", "ATLAS", "Belle2", "CTA", "Auger"],
5 + ["Tags", true],
6 +]
7 +
8 +document.observe('xwiki:livetable:loading', () => {
9 + const mats = document.getElementById(tabName);
10 +
11 + // coulmn data sources
12 + const conf = JSON.parse(mats.dataset.settings);
13 + tagCols.forEach(([name], i) => {
14 + const cn = `tags-${i}`;
15 + conf.columns.splice(conf.columns.indexOf("tags"), 1, cn);
16 + conf.columnDescriptors[cn] = {
17 + displayName: name,
18 + headerClass: "tagsCol",
19 + html: true,
20 + sortable: false,
21 + };
22 + });
23 + mats.dataset.settings = JSON.stringify(conf);
24 +
25 + // column headers
26 + mats.querySelectorAll(".xwiki-livetable-display-header .tagsCol").forEach(
27 + (v, i) => v.textContent = tagCols[i][0]
28 + );
29 +
30 + // handle clicks for tags
31 + document.getElementById(`${tabName}-display`).addEventListener("click", ev => {
32 + if (ev.button) return; // only left click
33 + if (ev.target.nodeName !== "SPAN") return;
34 + if (!ev.target.classList.contains("ltTag")) return;
35 + const tag = ev.target.textContent;
36 + ev.preventDefault();
37 + const lt = mats.__liveTable;
38 + const st = lt.tagCloud.selectedTags;
39 + if (tag in st) delete st[tag];
40 + else st[tag] = {};
41 + lt.tags = Object.keys(st);
42 + lt.clearCache();
43 + lt.showRows(1, lt.limit);
44 + })
45 +});
46 +
47 +document.observe(`xwiki:livetable:${tabName}:receivedEntries`, ({memo: {data}}) => {
48 + for (const row of data.rows) {
49 + row.affiliation = `<a href="${row.URL}" class="wikiexternallink">${
50 + row.affiliation_value.split("\n").map((a, i) => i ? a : `<b>${a}</b>`).join("<br/>")
51 + }</a>`;
52 +
53 + // tags
54 + const tags = new Set(row.tags_value.slice(1, -1).split(", "));
55 + tagCols.forEach(([name, ...want], i) =>
56 + row[`tags-${i}`] = (
57 + want[0] === true
58 + ? Array.from(tags)
59 + : want.filter(tag => tags.delete(tag))
60 + ).sort().map(tag => `<span class="ltTag" style="cursor:pointer;">${tag}</span>`).join(", ")
61 + );
62 + }
63 +});
64 +
65 +
66 +
Name
... ... @@ -1,0 +1,1 @@
1 +Live Table - Research Groups
Parse content
... ... @@ -1,0 +1,1 @@
1 +No
Use this extension
... ... @@ -1,0 +1,1 @@
1 +currentPage