Changes for page Administration

Last modified by Leon Poon on 2025/05/12 14:26

From version 5.1
edited by Leon Poon
on 2020/12/11 06:49
Change comment: Install extension [org.xwiki.platform:xwiki-platform-administration-ui/11.10.12]
To version 8.1
edited by Leon Poon
on 2024/03/23 04:26
Change comment: Install extension [org.xwiki.platform:xwiki-platform-administration-ui/15.10.7]

Summary

Details

Page properties
Content
... ... @@ -9,7 +9,7 @@
9 9  #set ($adminAction = 'admin')
10 10  #set ($crtCategoryId = "$!{request.category}")
11 11  #if ($crtCategoryId != '')
12 - #set ($crtCategoryId = $mathtool.toInteger($crtCategoryId))
12 + #set ($crtCategoryId = $numbertool.toNumber($crtCategoryId).intValue())
13 13  #end
14 14  #set ($crtSectionId = "$!{request.section}")
15 15  
... ... @@ -87,7 +87,7 @@
87 87  #set ($crtCategory = $NULL)
88 88  #foreach ($category in $adminMenu)
89 89   ## "Standard" URLs and icons for categories
90 - #set ($category.url = $xwiki.getURL($currentDoc, $adminAction, "category=${mathtool.sub($velocityCount, 1)}"))
90 + #set ($category.url = $xwiki.getURL($currentDoc, $adminAction, "category=${mathtool.sub($foreach.count, 1)}"))
91 91   #if ($xwiki.getDocument('XWiki.AdminSheet').getAttachment("${category.id}.png"))
92 92   #set ($category.iconReference = "XWiki.AdminSheet@${category.id}.png")
93 93   #else
... ... @@ -96,7 +96,7 @@
96 96   #set ($category.description = $services.localization.render("admin.${category.id}.description").trim())
97 97   #set ($category.cssClass = "${category.id}Icon")
98 98   #set ($category.name = $services.localization.render("admin.${category.id}").trim())
99 - #if ("$!{crtCategoryId}" != '' && $velocityCount == $mathtool.add($crtCategoryId, 1))
99 + #if ("$!{crtCategoryId}" != '' && $foreach.count == $mathtool.add($crtCategoryId, 1))
100 100   #set ($crtCategory = $category)
101 101   #end
102 102   ##
... ... @@ -232,7 +232,8 @@
232 232  
233 233  #macro (verticalNavigation $menu $options)
234 234   {{html clean="false"}}
235 - <div id="$!options.id" class="panel-group $!options.cssClass" role="tablist" aria-multiselectable="true">
235 + <nav id="$!options.id" class="panel-group $!options.cssClass"
236 + aria-label="$escapetool.xml($services.localization.render('administration.menu.label'))">
236 236   <div class="panel xform">
237 237   <label for="adminsearchmenu" class="hidden">$services.localization.render('search')</label>
238 238   <input type="text" class="form-control panel-group-filter" autocomplete="off" id="adminsearchmenu"
... ... @@ -248,7 +248,7 @@
248 248   $escapetool.xml($services.localization.render('administration.menu.search.noResults'))
249 249   </div>
250 250   </div>
251 - </div>
252 + </nav>
252 252   {{/html}}
253 253  #end
254 254  
... ... @@ -264,11 +264,11 @@
264 264   #set ($children = [])
265 265   #sortCollectionOfMapsByField($item.children, 'order', 99999, 'asc', $children)
266 266   <div class="panel panel-default">
267 - <a class="panel-heading#if (!$isActive) collapsed#end" role="tab" id="panel-heading-$escapedId"
268 + <a class="panel-heading#if (!$isActive) collapsed#end" id="panel-heading-$escapedId"
268 268   href="$!item.url" data-toggle="collapse"#if ("$!options.id" != '') data-parent="#$options.id" #end
269 269   data-target="#panel-body-$escapedId" aria-expanded="$isActive" aria-controls="panel-body-$escapedId"
270 270   title="$!escapetool.xml($item.description)">$!services.icon.renderHTML($item.icon)$escapetool.xml($name)</a>
271 - <div class="panel-collapse collapse#if ($isActive) in#end" role="tabpanel" id="panel-body-$escapedId"
272 + <section class="panel-collapse collapse#if ($isActive) in#end" id="panel-body-$escapedId"
272 272   aria-labelledby="panel-heading-$escapedId">
273 273   <div class="list-group">
274 274   #foreach ($child in $children)
... ... @@ -275,7 +275,7 @@
275 275   #verticalNavigationItem($child $options)
276 276   #end
277 277   </div>
278 - </div>
279 + </section>
279 279   </div>
280 280   #else
281 281   <a class="list-group-item#if ($isActive) active#end" data-id="$escapedId"
... ... @@ -333,7 +333,7 @@
333 333   #end
334 334  #end
335 335  (% id="document-title" %)(((
336 - = $services.localization.render("administration.sectionTitle$level", [$sectionName]) =
337 + = $services.localization.render("administration.sectionTitle$level", 'xwiki/2.1', [$sectionName]) =
337 337   ## Display the category/section description below the title.
338 338   #set ($categoryOrSectionId = $crtCategory.id)
339 339   #if ("$!crtSection.id" != '')
... ... @@ -367,11 +367,8 @@
367 367   ##------------------------------------------------------------------------------------------------------------
368 368   ## The Administration allows editing other pages from different applications inside the admin context (UI)
369 369   ##------------------------------------------------------------------------------------------------------------
370 - #if ("$!{request.editmode}" == 'inline' && $xwiki.exists($section))
371 - #set ($discard = $xcontext.setDisplayMode('edit'))
372 - {{html clean="false"}}{{include reference="XWiki.AdminInlineSheet" /}}{{/html}}
373 - #elseif ($xwiki.exists("XWiki.Admin${section}Sheet"))
374 - ## Custom XE administration section
371 + #if ($xwiki.exists("XWiki.Admin${section}Sheet"))
372 + ## Handle known XWiki administration sections
375 375   {{include reference="XWiki.Admin${section}Sheet" /}}
376 376   #elseif ($xwiki.exists($section))
377 377   {{html clean="false"}}#includeForm($section){{/html}}
XWiki.JavaScriptExtension[0]
Code
... ... @@ -26,7 +26,7 @@
26 26   // Filter the categories.
27 27   panelGroup.find('a.panel-heading').each(function() {
28 28   var panel = $(this).closest('.panel');
29 - var hasVisibleSections = panel.find('.list-group-item').not('.hidden').size() > 0;
29 + var hasVisibleSections = panel.find('.list-group-item').not('.hidden').length > 0;
30 30   var matchesFilterQuery = !filterItem.call($(this), text);
31 31   panel.toggle(hasVisibleSections || matchesFilterQuery);
32 32   if (!hasVisibleSections && matchesFilterQuery) {
... ... @@ -50,7 +50,7 @@
50 50   .next('.panel-collapse').addClass('in').css('height', '');
51 51   }
52 52   // Show/Hide the "No results." message.
53 - var hasVisibleCategories = panelGroup.find('a.panel-heading').filter(':visible').size() > 0;
53 + var hasVisibleCategories = panelGroup.find('a.panel-heading').filter(':visible').length > 0;
54 54   panelGroup.find('.noitems').toggleClass('hidden', hasVisibleCategories);
55 55   };
56 56  
... ... @@ -61,7 +61,7 @@
61 61   var panelGroup = $(this).closest('.panel-group');
62 62   var text = $(this).val().toLowerCase();
63 63   // Schedule a new filter operation.
64 - timeoutId = setTimeout($.proxy(filterPanelGroup, panelGroup, text), 500);
64 + timeoutId = setTimeout(filterPanelGroup.bind(panelGroup, text), 500);
65 65  
66 66   // Finally, enable the search input.
67 67   }).prop('disabled', false);
XWiki.StyleSheetExtension[0]
Code
... ... @@ -89,8 +89,8 @@
89 89  }
90 90  
91 91  .admin-menu .panel-heading.collapsed {
92 - border-bottom-left-radius: 3px;
93 - border-bottom-right-radius: 3px;
92 + border-bottom-left-radius: 5px;
93 + border-bottom-right-radius: 5px;
94 94  }
95 95  
96 96  .admin-menu a.panel-heading {
... ... @@ -112,8 +112,8 @@
112 112  }
113 113  
114 114  .admin-menu .panel-collapse > .list-group:last-child .list-group-item.last {
115 - border-bottom-right-radius: 3px;
116 - border-bottom-left-radius: 3px;
115 + border-bottom-right-radius: 5px;
116 + border-bottom-left-radius: 5px;
117 117  }
118 118  
119 119  .admin-menu .panel.noitems > .panel-heading {