#* DECORATOR FOR SPACE LEVEL INFORMATION
This decorator handles many contexts - pages, mail, blogposts, space-operations, and space-administration.
*#
#set ($helper = $params.get("helper"))
#set ($mode = $params.get("mode"))
#set ($context = $params.get("context"))
## The collector-key specifies the selected collector when ambiguous. Must be a web-item key of the location "system.space.sidebar".
#set ($collectorKey = $params.get("collector-key"))
#set ($confPage = $helper.page)
#if ($space && $action.getThemeManager().getSpaceTheme($space.key).hasSpaceSideBar())
#set ($useSpaceSideBar = true)
#else
#set ($useSpaceSideBar = false)
#end
#infoPanelInitFromParams()
## GENERAL PAGE DECORATING BEGINS
#requireResourcesForContext("space")
#if(!$useSpaceSideBar)
#parse ("/decorators/includes/space-navigation.vm")
#elseif($context == "space-operations" || $context == "space-administration")
$i18n.getText("action.space.tools")
#end
#if ($infoPanelRequired)
#infoPanel(true true true true)
#end
#if($useSpaceSideBar)
#putMetadata('space-key', $space.key)
#putMetadata('space-name', $space.name)
#requireResource("confluence.web.resources:ajs")
#if($darkFeatures.isDarkFeatureEnabled('confluence.sidebar.deferred'))
$decoratorUtil.setSidebarContext($action.space, $confPage, $confPage.idAsString, $context, $context, $collectorKey)
#else
#foreach ($webPanel in $webInterfaceManager.getDisplayableWebPanels("atl.page.left.sidebar", {"page": $confPage, "context": $context}))
$!webPanel.getHtml({"action": $action, "context-key": $context, "collector-key" : $collectorKey})
#end
#end
spacetools with-space-sidebar ${mode}-mode
#else
spacetools ${mode}-mode
#end
#parse ( "/template/includes/actionerrors.vm" )
#if($useSpaceSideBar)
#parse("/templates/link-browser-web-items.vm")
#parse("/template/includes/space-tools-web-items.vm")
#end
## CONTEXT SPECIFIC DECORATING BEGINS
## CONTEXT: "space-pages". MODES: "list-alphabetically", "list-recently-added", "list-content-tree"
#if ($context == "space-pages")
#if ($mode != "create-page")
#permitSearchEngines()
## Show current mode
$action.getText('view.name'):
#foreach ($item in $webInterfaceManager.getDisplayableItems("system.space.pages", $action.webInterfaceContext))
#if ($velocityCount != 1) · #end
#if ($mode == $item.key)
$item.label.getDisplayableLabel($req, $action.webInterfaceContext)
#else
$item.label.getDisplayableLabel($req, $action.webInterfaceContext)
#end
#end
$body
#else
$body
#end
## CONTEXT: "blogposts". MODES: "view-blogposts", "create-blogpost"
#elseif ($context == "space-blogposts")
#if ($mode == "view-blogposts")
#permitSearchEngines()
#requireResourcesForContext("viewcontent")
#requireResourcesForContext("blogpost")
#if ($blogPosts.size() == 0)
#blankExperience("blog", $hasCreatePermission, "blank.experience.posts", "blank.experience.posts.no.create.permission", "post.create", "/pages/createblogpost.action?spaceKey=$space.key")
#else
#foreach ($blog in $blogPosts)
#set ($blogBody = $action.renderBlogPost($blog))
#set ($showIconBlock = true)
#parse("/pages/blogpost-listing.vm")
#end
#set($whereKey = $helper.spaceKey)
#customQuickSearch("space-blog" false false [{"name":"type","value":"blogpost"}, {"name":"where", "value":"$whereKey"}])
#if ($calendarForThisMonth)
#blogPostsByMonth($action)
#end
#if ($action.isRecentBlogPosts() || $action.isBlogPostsByDateAction())
#showOlderNewerBlogNavigation($action)
#end
#end
#elseif ($mode == "create-blogpost")
$body
#end
#else
#if ($mode == "view-mail-archive")
#permitSearchEngines()
#end
$body
#end
## CONTEXT * MODE SPECIFIC DECORATING ENDS
## GENERAL PAGE DECORATING ENDS
#parse ( "/breadcrumbs.vm" )
#if ($helper.spaceKey)