[Jifty-commit] jifty branch, setupwizard-refactor, updated. 885299a321d8871c615466a059be2d9f9d26e591
Jifty commits
jifty-commit at lists.jifty.org
Tue Jul 20 13:45:07 EDT 2010
The branch, setupwizard-refactor has been updated
via 885299a321d8871c615466a059be2d9f9d26e591 (commit)
from 74a60ebf2843656bc02818f4675ed1887c749558 (commit)
Summary of changes:
lib/Jifty/Plugin/SetupWizard/View/Helpers.pm | 28 ++++++++++++++++++++++++-
1 files changed, 26 insertions(+), 2 deletions(-)
- Log -----------------------------------------------------------------
commit 885299a321d8871c615466a059be2d9f9d26e591
Author: Thomas Sibley <trs at bestpractical.com>
Date: Tue Jul 20 13:46:39 2010 -0400
Add a Save button and change next to Save and Continue
diff --git a/lib/Jifty/Plugin/SetupWizard/View/Helpers.pm b/lib/Jifty/Plugin/SetupWizard/View/Helpers.pm
index 62f7f27..b538376 100644
--- a/lib/Jifty/Plugin/SetupWizard/View/Helpers.pm
+++ b/lib/Jifty/Plugin/SetupWizard/View/Helpers.pm
@@ -268,6 +268,7 @@ private template 'buttons' => sub {
my @args = @_;
div {{ class is 'button-line' };
show 'next_step_button', @args;
+ show 'save_step_button', @args;
show 'previous_step_button', @args;
};
};
@@ -275,7 +276,7 @@ private template 'buttons' => sub {
private template 'previous_step_button' => sub {
my $self = shift;
my %args = (
- prev_label => 'Previous step',
+ prev_label => 'Discard and go back',
@_
);
@@ -314,7 +315,7 @@ private template 'next_step_button' => sub {
}
# Keep calm and carry on
else {
- $args{'next_label'} = 'Next step';
+ $args{'next_label'} = 'Save and Continue';
}
}
@@ -345,6 +346,29 @@ private template 'next_step_button' => sub {
}
};
+private template 'save_step_button' => sub {
+ my $self = shift;
+ my %args = (
+ save_label => 'Save',
+ @_
+ );
+
+ if ( defined $args{'for'} and not defined $args{'next'} ) {
+ $args{'next'} = $self->step_after( $args{'for'} );
+ }
+
+ if ( defined $args{'for'} and not defined $args{'prev'} ) {
+ $args{'prev'} = $self->step_before( $args{'for'} );
+ }
+
+ if ( defined $args{'prev'} and defined $args{'next'} ) {
+ form_submit(
+ label => $args{'save_label'},
+ class => 'save-button',
+ );
+ }
+};
+
=head1 METHODS
=head2 config_field
-----------------------------------------------------------------------
More information about the Jifty-commit
mailing list