#set ($formAction = "dosearchsite.action?")
#set ($queryStringProperty = "queryString")


<html>
	<head>
		<title>$action.getText("title.search.all")</title>
		#requireResource("confluence.web.resources:ajs")
		#requireResource("confluence.web.resources:jquery-autocomplete")
		#requireResource("confluence.sections.search.view:search")
        
        #requireResourcesForContext("search")
	</head>
	<body>
    <content tag="title-text-span">
        <form id="supporting-site-search-form">#* the purpose of this form is to capture the ENTER key event from the text field without having to write too much javascript to do it *#
        </form>
    </content>

    <content tag="search-decorator-flag">
        <span class="hidden">true</span>
    </content>

    <div id="search-container">
        <form id="site-search-form" name="searchsite" method="get" action="${formAction}">
            <input type="text" id="query-string" name="${queryStringProperty}" class="search-query-text-input" maxlength="1024" value="$generalUtil.escapeXml($!queryString)" tabindex="220">
            #tag( "Submit" "id=search-query-submit-button" "value='search.name'" "align='left'" "theme='notable'" "cssClass='search-query-submit'" "tabindex=221")

            <div id="search-sidebar">
                #parse ("/search/searchpanel.vm")
                #parse ("/breadcrumbs.vm")
            </div>
            <div id="search-results-container">
                #if ($action.actionErrors.isEmpty() && $action.fieldErrors.isEmpty()) ## only display results if there are no errors in the action
                    #applyDecorator ("root")
                        #decoratorParam ("context" "search-results")
                        #decoratorParam ("results" $action.results)
                        #decoratorParam ("start" $action.startIndex)
                        #decoratorParam ("end" $action.endIndex)
                        #decoratorParam ("total" $action.totalSearchResults)
                        #decoratorParam ("queryString" $action.queryString)
                    #end
                #else
                    #fielderror ("queryString")
                #end
            </div>
        </form>

        #if ($action.paginationSupport.previousStartIndexes || $action.paginationSupport.nextStartIndexes)
        <form method="get" action="$req.contextPath/dosearchsite.action" id="secondary-search">
            <input type="text" name="${queryStringProperty}" maxlength="1024" value="$generalUtil.escapeXml($!queryString)">
            #tag( "Submit" "value='search.name'" "align='left'" "theme='notable'")
        </form>
        #end
    </div>
    </body>
</html>