#if ($sitemeshPage.getProperty("page.show-personal-sidebar") == "true")
    #set ($usernameFromSpaceKey = $spaceUtils.getUsernameFromPersonalSpaceKey($spaceKey))
    #if($user && $user.name.equals($usernameFromSpaceKey))
        #set($viewProfileActionName = $action.getText("edit.name"))
        #set($viewProfileAction = "$req.contextPath/users/editmyprofile.action")
    #else
        #set($viewProfileActionName = $action.getText("more.word.capitalised"))
        #set($viewProfileAction = "$req.contextPath/users/viewuserprofile.action?username=$usernameFromSpaceKey")
    #end

    <div class="noprint" id="personal-info-sidebar">
        <a href="#" class="sidebar-collapse"></a>
        <div class="sidebar-content">
            $!sitemeshPage.getProperty("page.sidebar")
            <div class="sidebar-section">
                <a href="$viewProfileAction" class="more-edit">$viewProfileActionName</a>
                <h3 class="sidebar-heading">$action.getText("profile.name")</h3>
                $helper.renderConfluenceMacro("{profile:user=$usernameFromSpaceKey}")
            </div>

            <div class="sidebar-section">
                <a href="$req.contextPath/users/viewuserprofile.action?username=$usernameFromSpaceKey" class="more-edit">$action.getText("more.word.capitalised")</a>
                <h3 class="sidebar-heading">$action.getText("activity.name")</h3>
                $helper.renderConfluenceMacro("{recently-updated:author=$usernameFromSpaceKey|max=5|theme=sidebar|spaces=*}")
            </div>

            <div class="sidebar-section">
                <a href="$req.contextPath/users/viewfollow.action?username=$usernameFromSpaceKey" class="more-edit">$action.getText("more.word.capitalised")</a>
                <h3 class="sidebar-heading">$action.getText("network.name")</h3>
                $helper.renderConfluenceMacro("{network:following|username=$usernameFromSpaceKey|max=10|theme=tiny}")
                $helper.renderConfluenceMacro("{network:followers|username=$usernameFromSpaceKey|max=10|theme=tiny}")
            </div>
        </div>
    </div>
#end

