#requireResource("confluence.web.resources:ajs")
#requireResource("confluence.web.resources:jquery-autocomplete")
#requireResource("confluence.macros.profile:network-resources")

<div class="network-macro follow-$mode follow-$theme">

    #if($theme != "tiny")
    <h2 class="subheading">$action.getText("community.macro.follow.$mode")</h2>
    #end

    #if($viewingMyProfile)
    <div class="description">$action.getText("community.macro.${mode}.my", [$totalPeople])</div>
    #else
    <div class="description">$action.getText("community.macro.$mode", ["$user.fullName", $totalPeople])</div>
    #end

    <ul class="avatars">
    #foreach($personHtml in $people)
        <li>#logoBlock("~$personHtml")</li>
    #end
    </ul>
    #if ($morePeople)
    <span class="description">$action.getText("community.macro.follow.showing", [$maxResults, $totalPeople])
    (<a href="$req.contextPath/users/view${mode}.action?username=$generalUtil.urlEncode($username)" class="show-all">$action.getText("community.macro.follow.show.all")</a>)
    </span>
    #end

    #if ($showAddUser)
    <form class="follow-user noprint" name="follow-user" action="$req.contextPath/followuser.action" method="post">
        #form_xsrfToken()

        <label>
            <span class="container">
                ## Can't use #tag or #bodytag within wikicontent since there is no PageContext CONF-14926
                <input type="text" name="follow-autocomplete" class="follow-user-box" tabindex="225" autocomplete="off"/>
                <input type="hidden" value="" name="username"/>
            </span>
        </label>
        <input type="submit" name="follow" value="$action.getText("person.follow")"/>
        <fieldset class="hidden parameters">
            <input type="hidden" class="followUserBoxPlaceholder" id="followUserBoxPlaceholder" value="$action.getText("follow.user.box.placeholder")" />
        </fieldset>
        <div class="follow-user-result">&nbsp;</div>
    </form>
    #end
    
</div>