display details and back doesn't reset page to 1
authorDobrica Pavlinusic <dpavlin@rot13.org>
Sun, 1 Jun 2003 15:33:08 +0000 (15:33 +0000)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Sun, 1 Jun 2003 15:33:08 +0000 (15:33 +0000)
git-svn-id: file:///home/dpavlin/private/svn/webpac/trunk@51 13eb9ef6-21d5-0310-b721-a9d68796d827

WebPac.pm
template_html/results.html

index 5911d54..42d423c 100644 (file)
--- a/WebPac.pm
+++ b/WebPac.pm
@@ -14,7 +14,7 @@ use index_DBI;
 use back2html;
 
 # configuration options
-# FIX: they really should go in configuration file!
+# FIXME they really should go in configuration file!
 my $TEMPLATE_PATH = '/data/webpac/template_html';
 my $CHARSET = 'ISO-8859-2';
 my $SWISH = '/usr/bin/swish-e';
@@ -137,6 +137,9 @@ sub show_results_list {
        $tmpl->param('hits',$hits);
        $tmpl->param('search',$sw_q);
 
+       $tmpl->param('PAGER_offset',$q->param("PAGER_offset") || 0);
+       $tmpl->param('last_PAGER_offset',$q->param("last_PAGER_offset") || 0);
+
        # create a Pager object
        my $pager = HTML::Pager->new(
                # required parameters
@@ -204,7 +207,7 @@ sub show_index {
        $tmpl->param('limit',$limit);
        $tmpl->param('total',$total);
 
-# FIX: I should set offset and leave out limit from fetch!!
+# FIXME I should set offset and leave out limit from fetch!!
 #      if (! $q->param("PAGER_offset") {
 #              $q->param("Pager_offet)
 #      }
index 6362f9e..33a2842 100644 (file)
@@ -8,6 +8,7 @@
 <body>
 <p align="right"><a href="/">Home logo</a></p>
 
+
 <form method=post>
   <div align="center">
     <input type=submit value="Pretra¾ivanje" class="navigacijaDISABLED">
 <TABLE BORDER=0 WIDTH=100%>
 <TR><TD><TABLE BORDER=1 WIDTH=100%>
 
+<!-- FIXME
+<pre>
+last_PAGER_offset: <TMPL_VAR last_PAGER_offset>
+PAGER_offset: <TMPL_VAR PAGER_offset>
+</pre>
+-->
+
 <TMPL_IF NAME="full">
 
 <input type=submit value="Back to all results">
+<input type="hidden" name="PAGER_offset" value="<TMPL_VAR last_PAGER_offset>" />
 
 <TMPL_LOOP NAME="PAGER_DATA_LIST">
   <TR>
@@ -48,7 +57,9 @@
 
 <TMPL_ELSE>
 
-<input type=submit value="Display details about checked items">
+<input type=submit value="Display details about checked items" onClick="PAGER_set_offset_and_submit(0);">
+<input type="hidden" name="last_PAGER_offset" value="<TMPL_VAR PAGER_offset>" />
+
 <TMPL_LOOP NAME="PAGER_DATA_LIST">
   <TR>
        <td><input type=checkbox name="path" value="<TMPL_VAR NAME="path">"><TMPL_VAR NAME="nr"></td>