r1855@llin: dpavlin | 2009-04-29 18:48:47 +0200
authorDobrica Pavlinusic <dpavlin@rot13.org>
Wed, 29 Apr 2009 18:06:19 +0000 (18:06 +0000)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Wed, 29 Apr 2009 18:06:19 +0000 (18:06 +0000)
 move search for to end of results and provide named anchor to it
 optimize layout a little

git-svn-id: svn+ssh://mjesec/home/dpavlin/svn/webpac2/trunk@1177 07558da8-63fa-0310-ba24-9fe276d99e06

vhost/style.css
vhost/webpac2.cgi

index dd43208..4336b15 100644 (file)
@@ -22,8 +22,13 @@ h2 {
        font-size: 80%;
 }
 
+a.skip {
+       float: right;
+       color: #aaa;
+}
+
 form {
-       margin: 2em;
+       margin-top: 2em;
 }
 
 form label,
@@ -41,9 +46,7 @@ form #inputs {
 }
 
 #results {
-       clear: left;
-       float: left;
-       margin: 1em;
+       margin-top: 2em;
        border: 1px solid #eee;
 }
 
@@ -54,7 +57,7 @@ form #inputs {
 
 #results ol {
        float: left;
-       margin: 1em;
+       margin-right: 2em;
 }
 
 #results ol li {
index d4f6ffd..664669e 100755 (executable)
@@ -142,13 +142,8 @@ my @style = ( '../../style.css' );
 push @style, "../../$path/$path.css" if -e "$dir/$path/$path.css";
 dump_yaml( 'style', \@style );
 
-print
-       start_html(
-               -title => $db->{name},
-               -style => [ @style ],
-       ),
-       h1( $db->{name} ),
-       qq|<div id=description>|, $db->{description}, qq|</div>|,
+sub search_form {
+       qq|<a name="form"></a>|,
        start_form( -action => self_url( query => 0 ) ),
                radio_group(
                        -name => 'attr',
@@ -170,14 +165,26 @@ print
                        -linebreak=> 'true',
                ),
                qq|</div>|,
+               end_form,
+       ;
+}
 
-;
 
-print  end_form;
+print
+       start_html(
+               -title => $db->{name},
+               -style => [ @style ],
+       ),
+       h1( $db->{name} ),
+       qq|<div id=description>|, $db->{description}, qq|</div>|,
+;
 
 if ( my $search = param('search') ) {
 
-       print qq|<div id="results">|;
+       print qq|
+               <a href="#form" class="skip" title="skip to search form">#</a>
+               <div id="results">
+       |;
 
        my $swish = SWISH::API->new( "$dir/../var/swish/$database" );
        $swish->abort_last_error if $swish->Error;
@@ -254,7 +261,7 @@ if ( my $search = param('search') ) {
                        dump_yaml( 'data', $data );
 
                        my $li_class = '';
-                       $li_class = qq| class="z"| if $nr++ % 2 == 0;
+                       $li_class = qq| class="z"| if $nr % 2 == 0;
                        print qq|<li$li_class>|;
                        foreach my $attr ( @attr ) {
                                next unless defined $data->{$attr};
@@ -283,6 +290,8 @@ if ( my $search = param('search') ) {
 
 }
 
+print search_form;
+
 dump_yaml( "config databases $database", $db );
 dump_yaml( 'html_markup_skip', $html_markup_skip );