#requireResource("confluence.web.resources:jquery")
#requireResource("confluence.web.resources:ajs")
#requireResource("confluence.web.resources:aui-forms")
#requireResource("confluence.admin.user:userpicker")

 <fieldset class="hidden parameters">
        <input type="hidden" id="user-search" value="$userSearch">
        <input type="hidden" id="disable-simple-mode" value="$action.isSupportsSimpleSearch()">
</fieldset>

<div id="tab-navigation">
    <ul class="tab-navigation">
        <li class="current tab">
            <a href="#" id="user-tab">$action.getText("user.name")</a>
        </li>
        <li class="tab">
            <a href="#" id="membership-tab">$action.getText("membership.name")</a>
        </li>
    </ul>
</div>

<div class="pageSection" id="user-search-section">
    <div id="search-simple" #if($advanced)style="display:none"#end>
        <form method="POST" action="$req.contextPath/users/userpicker.action" name="searchusers" class="aui greyboxed">
            <fieldset>
            <div>
            #bodytag( "Component" "label='userpicker.user.details'" "id=searchTerm" "name='searchTerm'" "theme='aui'" "template='text-inline.vm'" )
                #param("size" "40")
                #param("tabindex" "1")
            #end
            <a href="showallusers.action?reset=true" id="switch-advanced">$action.getText('advanced.word')</a>
            <span class="description">
                #if($action.emailVisible)
                    $action.getText('userpicker.user.desc')
                #else
                    $action.getText('userpicker.user.desc.no.email')
                #end
            </span>
            </div>
            <div>
                    <input type="hidden" name="onPopupSubmit" value="$generalUtil.htmlEncode($onPopupSubmit)">
                    <input type="hidden" name="advanced" value="false">
                    <input type="hidden" name="userSearch" value="true">
                    <input value="$action.getText('search.name')" type="submit" />
            </div>
            </fieldset>
        </form>
        </div>
        <div id="search-advanced" #if(!$advanced)style="display:none"#end>
        <form method="POST" action="$req.contextPath/users/userpicker.action" name="searchusers" class="aui greyboxed">
            <fieldset>
                <legend><span>$action.getText('userpicker.user.details')</span></legend>
                    <div>
                        #bodytag( "TextField" "label='username.name'" "id=usernameTerm" "name='usernameTerm'" "theme='aui'" "template='text-inline.vm'" )#end
                        <a href="showallusers.action?reset=true" id="switch-simple">$action.getText('simple.word')</a>                        
                    </div>
                    #tag( "TextField" "label='fullname.name'" "id=fullnameTerm" "name='fullnameTerm'" "theme='aui'")
                    #if($action.emailVisible)
                        #tag( "TextField" "label='email.name.withdash'" "id=emailTerm" "name='emailTerm'" "theme='aui'")
                    #end

##                <fieldset class="submit">
                  <div>
                <input type="hidden" name="onPopupSubmit" value="$generalUtil.htmlEncode($onPopupSubmit)">
                    <input type="hidden" name="advanced" value="true">
                    <input type="hidden" name="userSearch" value="true">
                    <input type="submit" value="$action.getText('search.name')"  />
                  </div>                
##                </fieldset>
            </fieldset>
        </form>
    </div>
</div>

<div class="pageSection" id="membership-search-section">
<form method="POST" action="$req.contextPath/users/userpicker.action" name="searchgroup" class="aui greyboxed">
    <fieldset>
        <div>
            #bodytag( "Component" "label='userpicker.group.membership'" "id=groupTerm" "name='groupTerm'" "theme='aui'" "template='text-inline.vm'")#end
            <input type="hidden" name="onPopupSubmit" value="$generalUtil.htmlEncode($onPopupSubmit)">
            <span class="description">$action.getText('userpicker.group.desc')</span>
        </div>
        <div>
            <input type="hidden" name="userSearch" value="false">
            <input value="$action.getText('search.name')" type="submit" />
        </div>
    </fieldset>
</form>
</div>

