From e924e6a691a454ae8ed3ae9df178ebaccdf3cef1 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sun, 5 Feb 2017 18:08:30 +0000 Subject: Add use group pages and update links on package page --- gentoobrowse/src/mash.ice | 11 +++++++ gentoobrowse/src/test.cpp | 16 +++++++++- gentoobrowse/src/use.json | 39 +++++++++++++++++++++++ gentoobrowse/xslt/package.xslt | 29 ++++++++++------- gentoobrowse/xslt/use.xslt | 3 ++ gentoobrowse/xslt/usegroup-detail.xslt | 36 +++++++++++++++++++++ gentoobrowse/xslt/usegroup.xslt | 57 ++++++++++++++++++++++++++++++++++ 7 files changed, 179 insertions(+), 12 deletions(-) create mode 100644 gentoobrowse/xslt/usegroup-detail.xslt create mode 100644 gentoobrowse/xslt/usegroup.xslt diff --git a/gentoobrowse/src/mash.ice b/gentoobrowse/src/mash.ice index ff3f5f9..40680fa 100644 --- a/gentoobrowse/src/mash.ice +++ b/gentoobrowse/src/mash.ice @@ -106,4 +106,15 @@ module GentooBrowse { class UseIndex extends PageBase { Gentoo::Uses uses; }; + + ["slicer:root:gentoo"] + class UseGroup extends PageBase { + Gentoo::Uses uses; + string group; + }; + + ["slicer:root:gentoo"] + class UseGroupIndex extends PageBase { + Gentoo::StringList groups; + }; }; diff --git a/gentoobrowse/src/test.cpp b/gentoobrowse/src/test.cpp index a3fff0e..79d3d42 100644 --- a/gentoobrowse/src/test.cpp +++ b/gentoobrowse/src/test.cpp @@ -111,7 +111,7 @@ BOOST_FIXTURE_TEST_SUITE(ta, CoreWithDefaultRouter); BOOST_AUTO_TEST_CASE( endpointCount ) { - BOOST_REQUIRE_EQUAL(22, AdHoc::PluginManager::getDefault()->getAll().size()); + BOOST_REQUIRE_EQUAL(24, AdHoc::PluginManager::getDefault()->getAll().size()); BOOST_REQUIRE_EQUAL(5, routes.size()); } @@ -206,6 +206,20 @@ BOOST_AUTO_TEST_CASE( use_404 ) request.standardAssertions(typeid(this).name()); } +BOOST_AUTO_TEST_CASE( usegroup ) +{ + ChromiumRequestHtml request(this, HttpMethod::GET, "/usegroup"); + process(&request); + request.standardAssertions(typeid(this).name()); +} + +BOOST_AUTO_TEST_CASE( usegroup_gles ) +{ + ChromiumRequestHtml request(this, HttpMethod::GET, "/usegroup/i18n"); + process(&request); + request.standardAssertions(typeid(this).name()); +} + BOOST_AUTO_TEST_CASE( search_default ) { ChromiumRequestHtml request(this, HttpMethod::GET, "/search"); diff --git a/gentoobrowse/src/use.json b/gentoobrowse/src/use.json index a0bd57d..02ec208 100644 --- a/gentoobrowse/src/use.json +++ b/gentoobrowse/src/use.json @@ -44,6 +44,45 @@ } }, "type": "GentooBrowse.Use" + }, + "useGroupIndex": { + "path": "/usegroup", + "bases": [ "common" ], + "mutators": [ "addUser" ], + "outputSerializers": { + "text/html": { + "serializer": "IceSpider.XsltStreamSerializer", + "params": [ "\"xslt/usegroup.xslt\"" ] + } + }, + "operations": { + "groups": { + "operation": "Gentoo.Portage.getUseGroups" + } + }, + "type": "GentooBrowse.UseGroupIndex" + }, + "useGroupDetail": { + "path": "/usegroup/{group}", + "bases": [ "common" ], + "mutators": [ "addUser" ], + "outputSerializers": { + "text/html": { + "serializer": "IceSpider.XsltStreamSerializer", + "params": [ "\"xslt/usegroup-detail.xslt\"" ] + } + }, + "operations": { + "uses": { + "operation": "Gentoo.Portage.getGroupUses" + } + }, + "params": { + "group": { + "source": "URL" + } + }, + "type": "GentooBrowse.UseGroup" } }, "slices": [ diff --git a/gentoobrowse/xslt/package.xslt b/gentoobrowse/xslt/package.xslt index 287ede2..e6de8f0 100644 --- a/gentoobrowse/xslt/package.xslt +++ b/gentoobrowse/xslt/package.xslt @@ -138,7 +138,10 @@

- + + /usegroup/ + +

@@ -149,20 +152,24 @@
- - - /use/ - - - _ - - - + local - + + + + + /use/ + + + + local + + + +
diff --git a/gentoobrowse/xslt/use.xslt b/gentoobrowse/xslt/use.xslt index 3b148a2..8c8509d 100644 --- a/gentoobrowse/xslt/use.xslt +++ b/gentoobrowse/xslt/use.xslt @@ -20,6 +20,9 @@