diff options
author | Yorhel <git@yorhel.nl> | 2021-01-10 12:21:38 +0100 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2021-01-10 12:21:38 +0100 |
commit | a9812a77315b9d9a77f6be663bb46b0425e3b7bb (patch) | |
tree | 02a1a7e399559636ba86b396cf05a4578c8ebc7c /lib | |
parent | 4eede471c44dfead6c92c34b288b0df0deebeaed (diff) |
v2rw: Convert /r/engines (+ make it link to new AdvSearch system)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/VNDB/Handler/Releases.pm | 30 | ||||
-rw-r--r-- | lib/VNWeb/Releases/Engines.pm | 43 |
2 files changed, 43 insertions, 30 deletions
diff --git a/lib/VNDB/Handler/Releases.pm b/lib/VNDB/Handler/Releases.pm index 20ceb493..1fdbb0d6 100644 --- a/lib/VNDB/Handler/Releases.pm +++ b/lib/VNDB/Handler/Releases.pm @@ -10,7 +10,6 @@ use VNDB::Types; TUWF::register( qr{old/r} => \&browse, - qr{r/engines} => \&engines, qr{xml/engines.xml} => \&enginexml, ); @@ -135,35 +134,6 @@ sub _fil_compat { } -sub engines { - my $self = shift; - my $lst = $self->dbReleaseEngines(); - $self->htmlHeader(title => 'Engine list', noindex => 1); - - div class => 'mainbox'; - h1 'Engine list'; - p; - lit q{ - This is a list of all engines currently associated with releases. This - list can be used as reference when filling out the engine field for a - release and to find inconsistencies in the engine names. See the <a - href="/d3#3">releases guidelines</a> for more information. - }; - end; - ul; - for my $e (@$lst) { - li; - # TODO: link to new advsearch listing - a href => '/old/r?fil='.fil_serialize({engine => $e->{engine}}), $e->{engine}; - b class => 'grayedout', " $e->{cnt}"; - end; - } - end; - - end; -} - - sub enginexml { my $self = shift; diff --git a/lib/VNWeb/Releases/Engines.pm b/lib/VNWeb/Releases/Engines.pm new file mode 100644 index 00000000..c6e142e2 --- /dev/null +++ b/lib/VNWeb/Releases/Engines.pm @@ -0,0 +1,43 @@ +package VNWeb::Releases::Engines; + +use VNWeb::Prelude; +use VNWeb::AdvSearch; + + +TUWF::get qr{/r/engines}, sub { + my $list = tuwf->dbAlli(' + SELECT engine, count(*) AS cnt + FROM releases + WHERE NOT hidden AND engine <> \'\' + GROUP BY engine + ORDER BY count(*) DESC' + ); + + framework_ title => 'Engine list', sub { + div_ class => 'mainbox', sub { + h1_ 'Engine list'; + p_ sub { + lit_ q{ + This is a list of all engines currently associated with releases. This + list can be used as reference when filling out the engine field for a + release and to find inconsistencies in the engine names. See the <a + href="/d3#3">releases guidelines</a> for more information. + }; + }; + }; + div_ class => 'mainbox browse', sub { + table_ class => 'stripe', sub { + my $c = tuwf->compile({advsearch => 'r'}); + tr_ sub { + td_ class => 'tc1', style => 'text-align: right; width: 80px', $_->{cnt}; + td_ class => 'tc2', sub { + a_ href => '/r?f='.$c->validate([engine => '=', $_->{engine}])->data->query_encode(), $_->{engine}; + } + } for @$list; + }; + }; + }; +}; + + +1; |