Changes for page Desk allocation

Last modified by Ricardo Julio Rodríguez Fernández on 2025/06/02 10:02

From version 174.1
edited by Abdullah Sharifi
on 2024/03/11 19:27
Change comment: There is no comment for this version
To version 212.1
edited by Abdullah Sharifi
on 2024/03/12 16:59
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -1,2 +1,3 @@
1 -{{kanban width="29%" source="https://portal.igfae.usc.es/xwiki/bin/downloadrev/Kanban%20playground%20for%20Ricardo/WebHome/room.json?rev=1.2" addBoardButton="true" addItemButton="true" removeBoardButton="true" removeBoardItem="true"}}
1 +{{kanban width="235px" source="https://portal.igfae.usc.es/xwiki/bin/view/Towards%20JSON/Rooms/?outputSyntax=plain&xpage=plain" addBoardButton="true" addItemButton="true" removeBoardButton="true" removeBoardItem="true"}}
2 +[{"id":"room 01, floor 1","item":[{"title":"person 001 - LHCB"}],"color":"green","title":"Room#: 01, Floor#: 1"},{"id":"room 02, floor 1","item":[{"title":"person 002 - STRI"}],"color":"blue","title":"Room#: 02, Floor#: 1"},{"id":"room 03, floor 2","item":[{"title":"person 003 - LHCB"}],"color":"red","title":"Room#: 03, Floor#: 2"},{"id":"room 05, floor 2","item":[{"title":"person 003 - LHCB"},{"title":"person 004 - NUCL"}],"color":"yellow","title":"Room#: 05, Floor#: 2"},{"id":"room 08, floor 1","item":[{"title":"person 119 - HQCD"},{"title":"person 135 - LHCB"},{"title":"person 078 - HQCD"}],"color":"orange","title":"Room#: 08, Floor#: 1"},{"id":"room 16, floor 1","item":[{"title":"person 123 - AUGE"}],"color":"green","title":"Room#: 16, Floor#: 1"},{"id":"room 30, floor 1","item":[{"title":"person 354 - NEXT"}],"color":"green","title":"Room#: 30, Floor#: 1"},{"id":"room 18, floor 1","item":[{"title":"person 256 - GRWA"}],"color":"green","title":"Room#: 18, Floor#: 1"},{"id":"room 19, floor 1","item":[{"title":"person 354 - LACC"}],"color":"green","title":"Room#: 19, Floor#: 1"}]
2 2  {{/kanban}}
XWiki.JavaScriptExtension[0]
Code
... ... @@ -3,12 +3,19 @@
3 3   const headerElements = document.getElementsByClassName('kanban-board-header');
4 4   const titleContainers = document.getElementsByClassName('kanban-item');
5 5  
6 - /* for (let i = 0; i < titleElements.length; i++) {
6 + const kanbanContainer = document.querySelector('.kanban-container');
7 + kanbanContainer.style.display = "flex";
8 + kanbanContainer.style.justifyContent = "space-between"
9 + kanbanContainer.style.gap = "30px"
10 + kanbanContainer.style.alignItems = "start"
11 + kanbanContainer.style.flexWrap = "wrap"
12 +
13 + for (let i = 0; i < titleElements.length; i++) {
7 7   const titleElement = titleElements[i];
8 8   titleElement.style.padding = "2px 4px";
9 9   titleElement.style.borderRadius = "4px";
10 10  
11 - if (titleElement.textContent.includes('2')) {
18 + if (titleElement.textContent.includes('LHCB')) {
12 12   titleElement.style.color = 'white';
13 13   titleElement.style.backgroundColor = 'red';
14 14   const parentElement = titleElement.closest('.kanban-item');
... ... @@ -16,7 +16,63 @@
16 16   parentElement.style.backgroundColor = 'yellow';
17 17   }
18 18   }
19 - } */
26 + if (titleElement.textContent.includes('STRI')) {
27 + titleElement.style.color = 'white';
28 + titleElement.style.backgroundColor = 'navy';
29 + const parentElement = titleElement.closest('.kanban-item');
30 + if (parentElement) {
31 + parentElement.style.backgroundColor = '#FFDB58';
32 + }
33 + }
34 + if (titleElement.textContent.includes('AUGE')) {
35 + titleElement.style.color = 'white';
36 + titleElement.style.backgroundColor = '#FF7F50';
37 + const parentElement = titleElement.closest('.kanban-item');
38 + if (parentElement) {
39 + parentElement.style.backgroundColor = '#008080';
40 + }
41 + }
42 + if (titleElement.textContent.includes('HQCD')) {
43 + titleElement.style.color = 'white';
44 + titleElement.style.backgroundColor = 'crimson';
45 + const parentElement = titleElement.closest('.kanban-item');
46 + if (parentElement) {
47 + parentElement.style.backgroundColor = '#808000';
48 + }
49 + }
50 + if (titleElement.textContent.includes('NUCL')) {
51 + titleElement.style.color = 'white';
52 + titleElement.style.backgroundColor = '#E2725B';
53 + const parentElement = titleElement.closest('.kanban-item');
54 + if (parentElement) {
55 + parentElement.style.backgroundColor = '#708090';
56 + }
57 + }
58 + if (titleElement.textContent.includes('GRWA')) {
59 + titleElement.style.color = 'white';
60 + titleElement.style.backgroundColor = '#FF00FF';
61 + const parentElement = titleElement.closest('.kanban-item');
62 + if (parentElement) {
63 + parentElement.style.backgroundColor = '#F4C430';
64 + }
65 + }
66 + if (titleElement.textContent.includes('NEXT')) {
67 + titleElement.style.color = 'white';
68 + titleElement.style.backgroundColor = '#4B0082';
69 + const parentElement = titleElement.closest('.kanban-item');
70 + if (parentElement) {
71 + parentElement.style.backgroundColor = '#E0115F';
72 + }
73 + }
74 + if (titleElement.textContent.includes('LACC')) {
75 + titleElement.style.color = 'white';
76 + titleElement.style.backgroundColor = '#87CEEB';
77 + const parentElement = titleElement.closest('.kanban-item');
78 + if (parentElement) {
79 + parentElement.style.backgroundColor = '#98FF98';
80 + }
81 + }
82 + }
20 20  
21 21   for (let i = 0; i < headerElements.length; i++) {
22 22   const element = headerElements[i];
Name
... ... @@ -1,1 +1,1 @@
1 -Change background Color
1 +Styling boards
XWiki.XWikiRights[1]
Allow/Deny
... ... @@ -1,0 +1,1 @@
1 +Allow
Levels
... ... @@ -1,0 +1,1 @@
1 +view
Users
... ... @@ -1,0 +1,1 @@
1 +XWiki.XWikiGuest