From a79348ff0a8af6d59696ee31fd7a293707989a84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=A6=8C=EA=A6=AB=EA=A6=B6=EA=A6=8F=EA=A7=80=EA=A6=A6?= =?UTF-8?q?=EA=A6=BF=EA=A6=A7=EA=A6=AE=EA=A6=91=EA=A6=A9=EA=A6=AD=EA=A7=80?= Date: Sun, 4 Jul 2021 18:52:14 +0800 Subject: Separated web code --- pages/results.html | 92 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 pages/results.html (limited to 'pages/results.html') diff --git a/pages/results.html b/pages/results.html new file mode 100644 index 0000000..aea3ff7 --- /dev/null +++ b/pages/results.html @@ -0,0 +1,92 @@ +@_TOP_@ + + +
+
[search-region][on-match][tmp meta_header][calcn] + return unless $Values->{more_link}; + (my $more_page = $Session->{last_url}) =~ s|^/.*/([^\..]+)(?:\.html)?|$1|; + if ($more_page =~ /^(Next|Prev)/) { + $Tag->tag({ op => 'header' }, qq{Cache-control: no-cache\nCache-control: no-store\nPragma: no-cache\nExpires: 0\nContent-type: text/html}); + } + ## $mc set above. + my $ml = $Values->{mv_matchlimit} || ''; + my $fm = $Values->{mv_first_match} || ''; + my ($canon, $rel_prev, $rel_next); + #Debug("more_page=$more_page, ml=$ml, fm=$fm, mc=$mc"); + my ($prev, $next); + REL: { + last REL if $mc < $ml; + if ($fm == 0 || $fm == 1) { # first page + $rel_next = $Values->{more_link} . '/2'; + } elsif (($mc - $fm - $ml) <= 0) { # last page + $prev = sprintf("%.0f", (($fm+$ml) / $ml) - 1); + $rel_prev = $Values->{more_link} . '/' . ($prev ? $prev : '1'); + } else { # page 2 to second-to-last + $prev = sprintf("%.0f", ($fm / $ml)); + $next = $prev + 2; + $rel_prev = $Values->{more_link} . "/$prev"; + $rel_next = $Values->{more_link} . "/$next"; + } + } + CANON: { + last CANON if $more_page !~ /^1|(Next|Prev)/; + if ($more_page eq '1') { + $canon = ''; + } else { + $canon = sprintf("%.0f", ($fm+$ml) / $ml); + $canon = '' if $canon == 1; + } + $canon = $Values->{more_link} . ($canon ? "/$canon" : ''); + } + my @out; + my $url = ($Variable->{SAMPLEURL} . $Variable->{CGI_URL}) || ''; + my $ext = $Scratch->{mv_add_dot_html} ? '.html' : ''; + $url !~ /\/$/ and $url .= '/'; + push @out, qq{} if $rel_prev; + push @out, qq{} if $rel_next; + $Tag->tmp('rel_next', 1) if $rel_next; + push @out, qq{} if $canon; + if ($prev || $next) { $Scratch->{page_title} = $Scratch->{page_title} . ' - Page ' . (($prev || $next)+1) }; + return "\t" . join "\n\t", @out; + [/calcn][/tmp][/on-match][tmp bw_more][more-list][first-anchor][/first-anchor][last-anchor][/last-anchor][link-template]
  • $ANCHOR$
  • [/link-template] + + [/more-list][/tmp][calc] + my $more = $Scratch->{bw_more}; + $more and $more =~ s,,
  • ,; + $more and $more =~ s, *,
  • ,g; + $Scratch->{bw_more} = $more; + return $Values->{more_link} ? $more : undef; + [/calc][search-list] +
    + + [item-description] + +
    [/search-list][no-match] +
    [comment] + Don't show the search string if it was empty, since it looks weird + and the user will see the error below anyway. + [/comment][tmp matchstring][value-extended name=mv_searchspec joiner=" | " filter=encode_entities][/tmp][if scratch matchstring] + [msg arg.0="[scratch matchstring]"]Sorry, no matches for %s.[/msg] + [/if][if value mv_search_error] + + [L]Errors[/L]: +
    [value-extended name=mv_search_error joiner="
    " filter=encode_entities] +
    + [/if] +
    + [/no-match][if value more_link][scratch bw_more][else][more-list] +
    + [msg arg.0="[matches]" arg.1="[match-count]"]Matches %s of %s found.[/msg] + [link-template]$ANCHOR$[/link-template] +
    [more]
    +
    + [/more-list] + [/else] + [/if][/search-region] +
    +
    + __BOTTOM__ -- cgit v1.2.3