]> Sergey Matveev's repositories - public-inbox.git/commitdiff
wwwstream: prioritize search in top title bar
authorEric Wong <e@80x24.org>
Tue, 2 Aug 2016 01:47:55 +0000 (01:47 +0000)
committerEric Wong <e@80x24.org>
Tue, 2 Aug 2016 07:49:30 +0000 (07:49 +0000)
search is probably more useful so users should be able to select
it sooner.  Put it on its own line so it won't get scrolled off
the edge for non-CSS users.

Fix a minor spacing bug in the input tag while we're at it, too

lib/PublicInbox/WwwStream.pm

index ec9ae0cf25b167fc296bb37ada4184923ad3fa13..29395f40909661ec2231304677a4d33a5dbbae35 100644 (file)
@@ -33,11 +33,12 @@ sub _html_top ($) {
        my $upfx = $ctx->{-upfx} || '';
        my $atom = $ctx->{-atom} || $upfx.'new.atom';
        my $tip = $ctx->{-html_tip} || '';
-       my $top = "<b>$desc</b> (<a\nhref=\"$atom\">Atom feed</a>)";
+       my $top = "<b>$desc</b>";
+       my $links = "<a\nhref=\"$atom\">Atom feed</a>";
        if ($obj->search) {
                my $q_val = $ctx->{-q_value_html};
                if (defined $q_val && $q_val ne '') {
-                       $q_val = qq(\nvalue="$q_val" );
+                       $q_val = qq(\nvalue="$q_val");
                } else {
                        $q_val = '';
                }
@@ -45,12 +46,13 @@ sub _html_top ($) {
                my $extra = $ctx->{-extra_form_html} || '';
                my $action = $upfx eq '' ? './' : $upfx;
                $top = qq{<form\naction="$action"><pre>$top} .
-                         qq{ <input\nname=q\ntype=text$q_val/>} .
+                         qq{\n<input\nname=q\ntype=text$q_val />} .
                          $extra .
                          qq{<input\ntype=submit\nvalue=search />} .
+                         ' ' . $links .
                          q{</pre></form>}
        } else {
-               $top = '<pre>' . $top . '</pre>';
+               $top = '<pre>' . $top . "\n" . $links . '</pre>';
        }
        "<html><head><title>$title</title>" .
                "<link\nrel=alternate\ntitle=\"Atom feed\"\n".