[% WRAPPER page_layout %]



    [% PROCESS form %]
    <p>
    [% IF result.shown %]
        [% PROCESS results_header %]
        [% PROCESS display_results %]
        <p>
        [% PROCESS next_links %]
    [% END %]

    [% IF result %]
        [% IF result.message %]
            <div class="message">[% result.message %]</div>
        [% ELSIF ! result.hits %]
            <div class="message">No Results Found</div>
        [% END %]
    [% END %]

[% END %]

[% BLOCK form %]

        Limit search to:
        Body and Title
        Just Title
        Path

[% END %]

[% BLOCK results_header %]

    Results for [% request.query | html %]
    Showing page [% result.page %] 
    ([% result.start +1 %] - [% (result.start + result.shown) %] of [% result.hits %] hits) 

    [% USE myurl = url( request.myself, query=request.query, metaname=request.metaname, size=request.pagesize ) %]

    [% PROCESS next_links %]


[% END %]

[% BLOCK next_links %]

    [% IF result.prev %]
       <a href="[% myurl( page=result.prev ) %]">Previous</a>
    [% END %]
    [% IF result.next %]
       <a href="[% myurl( page=result.next ) %]">Next</a> 
    [% END %]
[% END %]

[% BLOCK display_results %]
    [% USE date %]
    [% FOREACH item = result.results %]

                [%  item.Property('swishtitle') || 'missing title' | highlight('swishtitle', item ) %]

            <span class="rank"> -- rank: <b>[% item.Property('swishrank') %]</b></span>
        </div>

        <div class="description">
            [% item.Property('swishdescription') || "No description" | highlight('swishdescription', item) %]
        </div>

        <div class="metadata">
            Path: <a href="[% item.Property('swishdocpath') | uri | html %]">
                [% item.Property('swishdocpath') | highlight('swishdocpath', item ) %]</a>
                - [% item.Property('swishdocsize') %] bytes<br>
            Date: [% date.format( item.Property('swishlastmodified')) %]<br>
        </div>
    [% END %]
[% END %]


