Changes for page People in ErUM-Data

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

From version 27.3
edited by Judith Steinfeld
on 2024/10/17 08:56
Change comment: There is no comment for this version
To version 28.2
edited by admin
on 2024/10/23 12:56
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,36 +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 -
39 -{{office attachment="People in ErUM v2.xlsx" filterStyles="false"/}}
40 -
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}}
XWiki.JavaScriptExtension[0]
Caching policy
... ... @@ -1,0 +1,1 @@
1 +default
Code
... ... @@ -1,0 +1,90 @@
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(tagName);
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(`${tagName}-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:${tagName}:receivedEntries`, ({memo: {data}}) => {
48 + debugger;
49 + return;
50 + for (const row of data.rows) {
51 + const ol = new DOMParser().parseFromString(row.doc_location, "text/xml").documentElement;
52 + const li = ol.children;
53 +
54 + li[0].remove(); // remove "Event"
55 + for (let i = 1; i < li.length - 1; i++) // intermediate
56 + li[i].textContent = li[i].textContent; // remove link
57 +
58 + const a = li[li.length - 1].children[0];
59 + const u = new URL(row.link_value);
60 + let icon;
61 + if (u.hostname.includes("github")) icon = "github";
62 + if (u.hostname.includes("gitlab")) icon = "gitlab";
63 + if (u.hostname.includes("google")) icon = "google";
64 + if (u.pathname.endsWith(".pdf")) icon = "file-pdf-o";
65 + if (icon) {
66 + const s = a.ownerDocument.createElement("span");
67 + s.textContent = " ";
68 + s.setAttribute("class", `fa fa-${icon}`);
69 + s.setAttribute("style", "padding-right: .3em;");
70 + a.insertBefore(s, a.firstChild);
71 + }
72 + a.setAttribute("class", "wikiexternallink");
73 + a.setAttribute("href", u.href);
74 +
75 + row.doc_location = ol.outerHTML;
76 +
77 + // tags
78 + const tags = new Set(row.tags_value.slice(1, -1).split(", "));
79 + tagCols.forEach(([name, ...want], i) =>
80 + row[`tags-${i}`] = (
81 + want[0] === true
82 + ? Array.from(tags)
83 + : want.filter(tag => tags.delete(tag))
84 + ).sort().map(tag => `<span class="ltTag" style="cursor:pointer;">${tag}</span>`).join(", ")
85 + );
86 + }
87 +});
88 +
89 +
90 +
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