Changes for page Nice Display

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

From version 28.13
edited by admin
on 2024/10/23 14:00
Change comment: There is no comment for this version
To version 30.1
edited by admin
on 2024/10/23 14:36
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -11,6 +11,7 @@
11 11   'URL': {"type": "hidden"},
12 12   "content": {"type": "hidden"},
13 13   "tags": {"sortable": false, "filterable": false, "html": true, "headerClass": "tagsCol"},
14 + "doc.date": {"filterable": false, "displayName": "Last Updated"},
14 14   '_actions': {"actions":["view","edit"]}
15 15  })
16 16  #set ($options = {
... ... @@ -19,9 +19,9 @@
19 19   'tagCloud': true,
20 20   'rowCount': 15,
21 21   'maxPages': 10,
22 - 'selectedColumn': 'affiliation',
23 + 'selectedColumn': 'doc.date',
23 23   'defaultOrder': 'asc'
24 24  })
25 -#set ($columns = ['affiliation', 'URL', "content", "tags", "tags", "tags", '_actions'])
26 -#livetable('research groups' $columns $columnsProperties $options)
26 +#set ($columns = ['affiliation', 'URL', "content", "tags", "tags", "tags", "doc.date", '_actions'])
27 +#livetable('research_groups' $columns $columnsProperties $options)
27 27  {{/velocity}}
XWiki.JavaScriptExtension[0]
Code
... ... @@ -1,7 +1,7 @@
1 -const tabName = "research groups";
1 +const tabName = "research_groups";
2 2  const tagCols = [
3 3   ["Community", "KAT", "KET", "KfB", "KFN", "KFS", "KFSI", "KHuK", "RDS", "beyond ErUM"],
4 - ["Experiment", "CMS", "ATLAS", "Belle2", "CTA", "Auger"],
4 + ["Experiment", "CMS", "ATLAS", "Belle2", "CTA", "Auger", "SKA", "IceCube"],
5 5   ["Tags", true],
6 6  ]
7 7  
... ... @@ -48,11 +48,10 @@
48 48   for (const row of data.rows) {
49 49   const a = new Element("a", { href: row.URL });
50 50   a.innerHTML = row.affiliation_value.split("\n").map((a, i) => i ? a : `<b class="wikiexternallink">${a}</b>`).join("<br/>");
51 - if (row.content && row.content !== "-") {
52 - a.title = row.content;
53 - a.dataset.toggle = "tooltip";
54 - //a.dataset.placement="left";
55 - //a.dataset.html="true";
51 + a.title = row.doc_title;
52 + if (row.content !== "-") {
53 + a.dataset.content = row.content;
54 + a.dataset.toggle = "popover";
56 56   }
57 57  
58 58   row.affiliation = a.outerHTML;
... ... @@ -71,8 +71,14 @@
71 71  });
72 72  
73 73  require(['jquery', 'bootstrap'], function($) {
73 + document.styleSheets[0].insertRule(`#mainContentArea .popover {max-width: 50%;}`)
74 +
74 74   const ttApply = () => {
75 - $(`[id='${tabName}'] [data-toggle="tooltip"]`).tooltip({ html: true, placement: "right" });
76 + $(`#${tabName} [data-toggle="popover"]`).popover({
77 + html: true,
78 + container: `#mainContentArea`,
79 + trigger: "hover",
80 + });
76 76   };
77 77  
78 78   document.observe(`xwiki:livetable:${tabName}:displayComplete`, ttApply);