From eb8c405b3cf4b59bcd9bf2cf2798e1d7dd68a413 Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Sat, 25 Apr 2009 22:07:59 +0000 Subject: [PATCH] r1844@llin: dpavlin | 2009-04-26 00:07:58 +0200 few more fixes to pager, new design of dump output git-svn-id: svn+ssh://mjesec/home/dpavlin/svn/webpac2/trunk@1171 07558da8-63fa-0310-ba24-9fe276d99e06 --- vhost/style.css | 12 ++++++++---- vhost/webpac2.cgi | 7 +++---- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/vhost/style.css b/vhost/style.css index 9250ee8..547fd40 100644 --- a/vhost/style.css +++ b/vhost/style.css @@ -84,10 +84,14 @@ ul.pager li.current_page { color: #000; } -pre { - border-top: 1px solid #888; - clear: left; - background-color: #eee; +.dump { + background-color: #efe; + clear: both; +} + +div.dump > pre { + background-color: #eef; + margin: 0; } .error { diff --git a/vhost/webpac2.cgi b/vhost/webpac2.cgi index b0a919e..84b6a16 100755 --- a/vhost/webpac2.cgi +++ b/vhost/webpac2.cgi @@ -22,7 +22,7 @@ print header( sub dump_yaml { my $name = shift; - print qq|
# $name\n|, YAML::Dump( @_ ), qq|
| if $debug; + print qq|
$name
|, YAML::Dump( @_ ), qq|
| if $debug; } sub show_pager { @@ -150,7 +150,8 @@ print popup_menu( -name => 'attr_operator', %$attr_operator ), submit, hidden( -name => 'entries_per_page', -default => $entries_per_page ), - hidden( -name => 'current_page', -default => 1 ), + # we need current_page fixed at 1 so that every submit through form will reset it + qq||, checkbox( -name => 'debug', -default => 0 ), # FIXME hidden? qq|
|, h2( 'Select input' ), @@ -172,9 +173,7 @@ if ( my $search = param('search') ) { my $swish = SWISH::API->new( "$dir/../var/swish/$database" ); $swish->abort_last_error if $swish->Error; - param( 'entries_per_page', $entries_per_page ) unless param('entries_per_page'); # FIXME not needed? my $pager = Data::Page->new; - $pager->total_entries( param('current_page') * param('entries_per_page') ); $pager->$_( param($_) ) foreach ( qw/entries_per_page current_page/ ); dump_yaml( 'pager', $pager ); -- 2.20.1