From e2edf16150da53ac31af404dbe2baca6d61c6678 Mon Sep 17 00:00:00 2001 From: Henning Noeth Date: Mon, 16 Dec 2024 10:18:41 +0100 Subject: [PATCH] refactor(demo): add home button Add a "Home"-Button du go to the root of the current Tobago demo. A click on the brand leads to "https://tobago-demo.apache.org/". --- .../apache/myfaces/tobago/example/demo/NavigationState.java | 4 ++++ tobago-example/tobago-example-demo/src/main/webapp/menu.xhtml | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/NavigationState.java b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/NavigationState.java index d2951d25cf..be97e9c895 100644 --- a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/NavigationState.java +++ b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/NavigationState.java @@ -88,6 +88,10 @@ public String gotoFirst() { return gotoNode(tree.getTree().getNextNode()) + "?faces-redirect=true"; // the first after the root node } + public String rootUrl() { + return tree.getTree().getNextNode().toString(); + } + public String gotoPrevious() { if (currentNode == null) { return gotoFirst(); diff --git a/tobago-example/tobago-example-demo/src/main/webapp/menu.xhtml b/tobago-example/tobago-example-demo/src/main/webapp/menu.xhtml index 08929f0fb5..4537ecd586 100644 --- a/tobago-example/tobago-example-demo/src/main/webapp/menu.xhtml +++ b/tobago-example/tobago-example-demo/src/main/webapp/menu.xhtml @@ -34,12 +34,12 @@ + link="https://tobago-demo.apache.org/"/> - +