[Jifty-commit] r7273 - jifty/trunk/lib/Jifty/Plugin/SetupWizard

Jifty commits jifty-commit at lists.jifty.org
Tue Jun 16 01:18:34 EDT 2009


Author: sartak
Date: Tue Jun 16 01:18:34 2009
New Revision: 7273

Modified:
   jifty/trunk/lib/Jifty/Plugin/SetupWizard/View.pm

Log:
Instead of providing next/back links, link to every step

Modified: jifty/trunk/lib/Jifty/Plugin/SetupWizard/View.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Plugin/SetupWizard/View.pm	(original)
+++ jifty/trunk/lib/Jifty/Plugin/SetupWizard/View.pm	Tue Jun 16 01:18:34 2009
@@ -49,22 +49,29 @@
 
     div {
         class is 'setupwizard-links';
-        step_link(
-            index => $step - 1,
-            label => "Back: %1",
-        );
-        br {};
-        step_link(
-            index => $step + 1,
-            label => "Skip to: %1",
-        );
+
+        span { 'Skip to: ' };
+
+        for my $i (0 .. @$steps - 1) {
+            # Separator
+            if ($i > 0) {
+                span { ' | ' }
+            }
+
+            step_link(
+                index   => $i,
+                label   => "%1",
+                current => $i == $step,
+            );
+        }
     };
 };
 
 sub step_link {
     my %args = (
-        index => 0,
-        label => "%1",
+        index   => 0,
+        label   => "%1",
+        current => 0,
         @_,
     );
 
@@ -76,15 +83,20 @@
     my $info = $steps->[$index];
     my $name = $info->{link} || $info->{header} || $info->{template};
 
-    hyperlink(
-        label => _($args{label}, $name),
-        onclick => {
-            replace_self => 1,
-            arguments => {
-                step => $index,
+    if ($args{current}) {
+        b { _($args{label}, $name) },
+    }
+    else {
+        hyperlink(
+            label => _($args{label}, $name),
+            onclick => {
+                replace_self => 1,
+                arguments => {
+                    step => $index,
+                },
             },
-        },
-    );
+        );
+    }
 }
 
 sub config_field {


More information about the Jifty-commit mailing list