From cf8e093eace0f3a86fc42726b09e4f2c9979f40e Mon Sep 17 00:00:00 2001 From: Yorhel Date: Thu, 17 Sep 2015 16:59:08 +0200 Subject: Handler::Discussions: Add search box to non-item thread lists As requested at https://vndb.org/t6862.28 --- lib/VNDB/Handler/Discussions.pm | 53 ++++++++++++++++++++++++----------------- 1 file changed, 31 insertions(+), 22 deletions(-) (limited to 'lib') diff --git a/lib/VNDB/Handler/Discussions.pm b/lib/VNDB/Handler/Discussions.pm index 0b1e5254..7be4f3fe 100644 --- a/lib/VNDB/Handler/Discussions.pm +++ b/lib/VNDB/Handler/Discussions.pm @@ -308,29 +308,38 @@ sub board { $self->htmlHeader(title => $title, noindex => 1, feeds => [ $type eq 'an' ? 'announcements' : 'posts' ]); $self->htmlMainTabs($type, $obj, 'disc') if $iid; - div class => 'mainbox'; - h1 $title; - p; - a href => '/t', mt '_disboard_rootlink'; - txt ' > '; - a href => "/t/$type", mt $type eq 'all' ? '_disboard_item_all' : "_dboard_$type"; - if($iid) { - txt ' > '; - a style => 'font-weight: bold', href => "/t/$type$iid", "$type$iid"; - txt ':'; - a href => "/$type$iid", $ititle; - } - end; - p class => 'center'; - if(!@$list) { - b mt '_disboard_nothreads'; - br; br; - a href => "/t/$type$iid/new", mt '_disboard_createyourown'; - } else { - a href => '/t/'.($iid ? $type.$iid : $type ne 'ge' ? 'db' : $type).'/new', mt '_disboard_startnew' if $type ne 'all'; + form action => '/t/search', method => 'get'; + div class => 'mainbox'; + h1 $title; + p; + a href => '/t', mt '_disboard_rootlink'; + txt ' > '; + a href => "/t/$type", mt $type eq 'all' ? '_disboard_item_all' : "_dboard_$type"; + if($iid) { + txt ' > '; + a style => 'font-weight: bold', href => "/t/$type$iid", "$type$iid"; + txt ':'; + a href => "/$type$iid", $ititle; + } + end; + if(!$iid) { + fieldset class => 'search'; + input type => 'text', name => 'bq', id => 'bq', class => 'text'; + input type => 'hidden', name => 'b', value => $type if $type ne 'all'; + input type => 'submit', class => 'submit', value => mt '_searchbox_submit'; + end 'fieldset'; } - end; - end 'div'; + p class => 'center'; + if(!@$list) { + b mt '_disboard_nothreads'; + br; br; + a href => "/t/$type$iid/new", mt '_disboard_createyourown'; + } else { + a href => '/t/'.($iid ? $type.$iid : $type ne 'ge' ? 'db' : $type).'/new', mt '_disboard_startnew' if $type ne 'all'; + } + end; + end 'div'; + end 'form'; _threadlist($self, $list, $f, $np, "/t/$type$iid", $type.$iid) if @$list; -- cgit v1.2.3