diff options
author | Yorhel <git@yorhel.nl> | 2021-01-09 17:06:25 +0100 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2021-01-10 09:31:12 +0100 |
commit | 5061421becc459f86b758eef5ca45ec4d608e954 (patch) | |
tree | 7e974ceb318d9b5e904eda1ad2a3384351c96b28 | |
parent | 5d275ce2ceb1112c1e02bbe9134b22ac478975fc (diff) |
AdvSearch: Time to put this live.2.29
Moved old release browser, VN browser and tag pages to /old/, moved
/experimental/ pages to /, removed warnings and updated some references.
-rw-r--r-- | lib/VNDB/Handler/Releases.pm | 9 | ||||
-rw-r--r-- | lib/VNDB/Handler/Tags.pm | 12 | ||||
-rw-r--r-- | lib/VNDB/Handler/VNBrowse.pm | 8 | ||||
-rw-r--r-- | lib/VNWeb/Misc/Redirects.pm | 6 | ||||
-rw-r--r-- | lib/VNWeb/Releases/List.pm | 9 | ||||
-rw-r--r-- | lib/VNWeb/Releases/Page.pm | 3 | ||||
-rw-r--r-- | lib/VNWeb/TT/TagPage.pm | 4 | ||||
-rw-r--r-- | lib/VNWeb/VN/List.pm | 9 | ||||
-rwxr-xr-x | util/updates/2021-01-10-advsearch-convert-saved-filters.pl (renamed from util/updates/wip-advsearch-convert-saved-filters.pl) | 0 |
9 files changed, 26 insertions, 34 deletions
diff --git a/lib/VNDB/Handler/Releases.pm b/lib/VNDB/Handler/Releases.pm index 49d9441a..20ceb493 100644 --- a/lib/VNDB/Handler/Releases.pm +++ b/lib/VNDB/Handler/Releases.pm @@ -9,7 +9,7 @@ use VNDB::Types; TUWF::register( - qr{r} => \&browse, + qr{old/r} => \&browse, qr{r/engines} => \&engines, qr{xml/engines.xml} => \&enginexml, ); @@ -39,7 +39,7 @@ sub browse { $self->htmlHeader(title => 'Browse releases'); - form method => 'get', action => '/r', 'accept-charset' => 'UTF-8'; + form method => 'get', action => '/old/r', 'accept-charset' => 'UTF-8'; div class => 'mainbox'; h1 'Browse releases'; $self->htmlSearchBox('r', $f->{q}); @@ -52,7 +52,7 @@ sub browse { end; end 'form'; - my $uri = sprintf '/r?q=%s;fil=%s', uri_escape($f->{q}), $f->{fil}; + my $uri = sprintf '/old/r?q=%s;fil=%s', uri_escape($f->{q}), $f->{fil}; $self->htmlBrowse( class => 'relbrowse', items => $list, @@ -153,7 +153,8 @@ sub engines { ul; for my $e (@$lst) { li; - a href => '/r?fil='.fil_serialize({engine => $e->{engine}}), $e->{engine}; + # TODO: link to new advsearch listing + a href => '/old/r?fil='.fil_serialize({engine => $e->{engine}}), $e->{engine}; b class => 'grayedout', " $e->{cnt}"; end; } diff --git a/lib/VNDB/Handler/Tags.pm b/lib/VNDB/Handler/Tags.pm index bced924f..d4807055 100644 --- a/lib/VNDB/Handler/Tags.pm +++ b/lib/VNDB/Handler/Tags.pm @@ -10,7 +10,7 @@ use VNDB::Types; TUWF::register( - qr{g([1-9]\d*)}, \&tagpage, + qr{old/g([1-9]\d*)}, \&tagpage, qr{g/debug}, \&fulltree, qr{xml/tags\.xml}, \&tagxml, ); @@ -106,15 +106,15 @@ sub tagpage { childtags($self, 'Child tags', 'g', $t) if @{$t->{childs}}; if($t->{searchable} && $t->{state} == 2) { - form action => "/g$t->{id}", 'accept-charset' => 'UTF-8', method => 'get'; + form action => "/old/g$t->{id}", 'accept-charset' => 'UTF-8', method => 'get'; div class => 'mainbox'; a class => 'addnew', href => "/g/links?t=$tag", 'Recently tagged'; h1 'Visual novels'; p class => 'browseopts'; - a href => "/g$t->{id}?fil=$f->{fil};s=$f->{s};o=$f->{o};m=0", $f->{m} == 0 ? (class => 'optselected') : (), 'Hide spoilers'; - a href => "/g$t->{id}?fil=$f->{fil};s=$f->{s};o=$f->{o};m=1", $f->{m} == 1 ? (class => 'optselected') : (), 'Show minor spoilers'; - a href => "/g$t->{id}?fil=$f->{fil};s=$f->{s};o=$f->{o};m=2", $f->{m} == 2 ? (class => 'optselected') : (), 'Spoil me!'; + a href => "/old/g$t->{id}?fil=$f->{fil};s=$f->{s};o=$f->{o};m=0", $f->{m} == 0 ? (class => 'optselected') : (), 'Hide spoilers'; + a href => "/old/g$t->{id}?fil=$f->{fil};s=$f->{s};o=$f->{o};m=1", $f->{m} == 1 ? (class => 'optselected') : (), 'Show minor spoilers'; + a href => "/old/g$t->{id}?fil=$f->{fil};s=$f->{s};o=$f->{o};m=2", $f->{m} == 2 ? (class => 'optselected') : (), 'Spoil me!'; end; p class => 'filselect'; @@ -133,7 +133,7 @@ sub tagpage { } end 'div'; end 'form'; - $self->htmlBrowseVN($list, $f, $np, "/g$t->{id}?fil=$f->{fil};m=$f->{m}", 1) if @$list; + $self->htmlBrowseVN($list, $f, $np, "/old/g$t->{id}?fil=$f->{fil};m=$f->{m}", 1) if @$list; } $self->htmlFooter(pref_code => 1); diff --git a/lib/VNDB/Handler/VNBrowse.pm b/lib/VNDB/Handler/VNBrowse.pm index 64cc57d4..090f58ad 100644 --- a/lib/VNDB/Handler/VNBrowse.pm +++ b/lib/VNDB/Handler/VNBrowse.pm @@ -9,7 +9,7 @@ use VNDB::Types; TUWF::register( - qr{v/([a-z0]|all)} => \&list, + qr{old/v/([a-z0]|all)} => \&list, ); @@ -78,13 +78,13 @@ sub list { $self->htmlHeader(title => 'Browse visual novels', search => $f->{q}); my $quri = uri_escape($f->{q}); - form action => '/v/all', 'accept-charset' => 'UTF-8', method => 'get'; + form action => '/old/v/all', 'accept-charset' => 'UTF-8', method => 'get'; # url generator my $url = sub { my($char, $toggle) = @_; - return "/v/$char?q=$quri;fil=$f->{fil};rfil=$f->{rfil};cfil=$f->{cfil};s=$f->{s};o=$f->{o}" . + return "/old/v/$char?q=$quri;fil=$f->{fil};rfil=$f->{rfil};cfil=$f->{cfil};s=$f->{s};o=$f->{o}" . ($toggle ? ";$toggle=".($f->{$toggle}?0:1) : ''); }; @@ -118,7 +118,7 @@ sub list { end; end 'form'; - $self->htmlBrowseVN($list, $f, $np, "/v/$char?q=$quri;fil=$f->{fil};rfil=$f->{rfil};cfil=$f->{cfil}", $f->{fil} =~ /tag_inc-/); + $self->htmlBrowseVN($list, $f, $np, "/old/v/$char?q=$quri;fil=$f->{fil};rfil=$f->{rfil};cfil=$f->{cfil}", $f->{fil} =~ /tag_inc-/); $self->htmlFooter(pref_code => 1); } diff --git a/lib/VNWeb/Misc/Redirects.pm b/lib/VNWeb/Misc/Redirects.pm index 4a84150b..fd729727 100644 --- a/lib/VNWeb/Misc/Redirects.pm +++ b/lib/VNWeb/Misc/Redirects.pm @@ -12,8 +12,10 @@ TUWF::get qr{/notes}, sub { tuwf->resRedirect('/d8', 'perm') }; TUWF::get qr{/faq}, sub { tuwf->resRedirect('/d6', 'perm') }; TUWF::get qr{/p}, sub { tuwf->resRedirect('/p/all'.tuwf->reqQuery(), 'perm') }; -TUWF::get qr{/v}, sub { tuwf->resRedirect('/v/all'.tuwf->reqQuery(), 'perm') }; -TUWF::get qr{/v/search}, sub { tuwf->resRedirect('/v/all'.tuwf->reqQuery(), 'perm') }; +TUWF::get qr{/v/search}, sub { tuwf->resRedirect('/v'.tuwf->reqQuery(), 'perm') }; + +TUWF::get qr{/experimental/v}, sub { tuwf->resRedirect('/v'.tuwf->reqQuery(), 'temp') }; +TUWF::get qr{/experimental/r}, sub { tuwf->resRedirect('/r'.tuwf->reqQuery(), 'temp') }; TUWF::get qr{/u/list(/[a-z0]|/all)?}, sub { tuwf->resRedirect('/u'.(tuwf->capture(1)//'/all'), 'perm') }; diff --git a/lib/VNWeb/Releases/List.pm b/lib/VNWeb/Releases/List.pm index c9ac1eff..4f3664ca 100644 --- a/lib/VNWeb/Releases/List.pm +++ b/lib/VNWeb/Releases/List.pm @@ -30,7 +30,7 @@ sub listing_ { } -TUWF::get qr{/experimental/r}, sub { +TUWF::get qr{/r}, sub { my $opt = tuwf->validate(get => q => { onerror => undef }, p => { upage => 1 }, @@ -84,12 +84,7 @@ TUWF::get qr{/experimental/r}, sub { framework_ title => 'Browse releases', sub { div_ class => 'mainbox', sub { h1_ 'Browse releases'; - div_ class => 'warning', sub { - h2_ 'EXPERIMENTAL'; - p_ "This is Yorhel's playground. Lots of functionality is missing, lots of stuff is or will be broken. Here be dragons. Etc."; - }; - br_; - form_ action => '/experimental/r', method => 'get', sub { + form_ action => '/r', method => 'get', sub { searchbox_ r => $opt->{q}//''; input_ type => 'hidden', name => 'o', value => $opt->{o}; input_ type => 'hidden', name => 's', value => $opt->{s}; diff --git a/lib/VNWeb/Releases/Page.pm b/lib/VNWeb/Releases/Page.pm index bc885c33..8067de7c 100644 --- a/lib/VNWeb/Releases/Page.pm +++ b/lib/VNWeb/Releases/Page.pm @@ -143,8 +143,7 @@ sub _infotable_ { tr_ sub { td_ 'Engine'; td_ sub { - # TODO: Should not rely on legacy VNDB::* functions! - a_ href => '/r?fil='.VNDB::Util::Misc::fil_serialize({engine => $r->{engine}}), $r->{engine}; + a_ href => '/r?f='.tuwf->compile({advsearch => 'r'})->validate(['engine', '=', $r->{engine}])->data->query_encode, $r->{engine}; } } if length $r->{engine}; diff --git a/lib/VNWeb/TT/TagPage.pm b/lib/VNWeb/TT/TagPage.pm index bd545c98..9b76e4de 100644 --- a/lib/VNWeb/TT/TagPage.pm +++ b/lib/VNWeb/TT/TagPage.pm @@ -149,7 +149,7 @@ sub vns_ { a_ href => "/g/links?t=$t->{id}", 'Recently tagged'; }; h1_ 'Visual novels'; - form_ action => "/experimental/g$t->{id}", method => 'get', sub { + form_ action => "/g$t->{id}", method => 'get', sub { p_ class => 'browseopts', sub { button_ type => 'submit', name => 'm', value => 0, $opt->{m} == 0 ? (class => 'optselected') : (), 'Hide spoilers'; button_ type => 'submit', name => 'm', value => 1, $opt->{m} == 1 ? (class => 'optselected') : (), 'Show minor spoilers'; @@ -166,7 +166,7 @@ sub vns_ { } -TUWF::get qr{/experimental/$RE{gid}}, sub { +TUWF::get qr{/$RE{gid}}, sub { my $t = tuwf->dbRowi('SELECT id, name, description, state, c_items, cat, defaultspoil, searchable, applicable FROM tags WHERE id =', \tuwf->capture('id')); return tuwf->resNotFound if !$t->{id}; diff --git a/lib/VNWeb/VN/List.pm b/lib/VNWeb/VN/List.pm index 76ca2051..ce780cef 100644 --- a/lib/VNWeb/VN/List.pm +++ b/lib/VNWeb/VN/List.pm @@ -73,7 +73,7 @@ sub enrich_userlist { } -TUWF::get qr{/experimental/v(?:/(?<char>all|[a-z0]))?}, sub { +TUWF::get qr{/v(?:/(?<char>all|[a-z0]))?}, sub { my $opt = tuwf->validate(get => q => { onerror => undef }, sq=> { onerror => undef }, @@ -146,12 +146,7 @@ TUWF::get qr{/experimental/v(?:/(?<char>all|[a-z0]))?}, sub { framework_ title => 'Browse visual novels', sub { div_ class => 'mainbox', sub { h1_ 'Browse visual novels'; - div_ class => 'warning', sub { - h2_ 'EXPERIMENTAL'; - p_ "This is Yorhel's playground. Lots of functionality is missing, lots of stuff is or will be broken. Here be dragons. Etc."; - }; - br_; - form_ action => '/experimental/v', method => 'get', sub { + form_ action => '/v', method => 'get', sub { searchbox_ v => $opt->{q}//''; p_ class => 'browseopts', sub { button_ type => 'submit', name => 'ch', value => ($_//''), ($_//'') eq ($opt->{ch}//'') ? (class => 'optselected') : (), !defined $_ ? 'ALL' : $_ ? uc $_ : '#' diff --git a/util/updates/wip-advsearch-convert-saved-filters.pl b/util/updates/2021-01-10-advsearch-convert-saved-filters.pl index 16e569b0..16e569b0 100755 --- a/util/updates/wip-advsearch-convert-saved-filters.pl +++ b/util/updates/2021-01-10-advsearch-convert-saved-filters.pl |