[Rt-commit] rt branch, development, updated. 9399bb1e216af77b387b915305c58ba696614d08

Thomas Sibley trs at bestpractical.com
Mon Jun 21 19:14:24 EDT 2010


The branch, development has been updated
       via  9399bb1e216af77b387b915305c58ba696614d08 (commit)
      from  d9fb87e33817149740e0f65ae165fde6962038ed (commit)

Summary of changes:
 lib/RT/Action/ConfigSystem.pm |   10 +++++++---
 lib/RT/Dispatcher.pm          |    2 +-
 lib/RT/View.pm                |    2 +-
 lib/RT/View/Admin/Global.pm   |    2 +-
 lib/RT/View/SetupWizard.pm    |   41 ++++++++++++++++++++++++++++++++++++++++-
 5 files changed, 50 insertions(+), 7 deletions(-)

- Log -----------------------------------------------------------------
commit 9399bb1e216af77b387b915305c58ba696614d08
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Mon Jun 21 19:14:44 2010 -0400

    The beginnings of a custom setup wizard

diff --git a/lib/RT/Action/ConfigSystem.pm b/lib/RT/Action/ConfigSystem.pm
index ce0a76c..86883c3 100644
--- a/lib/RT/Action/ConfigSystem.pm
+++ b/lib/RT/Action/ConfigSystem.pm
@@ -2,7 +2,11 @@ use strict;
 use warnings;
 
 package RT::Action::ConfigSystem;
-use base qw/RT::Action Jifty::Action/;
+
+use Moose;
+extends qw/RT::Action Jifty::Action/;
+with    qw/Jifty::Plugin::Multipage::Action/;
+
 use Scalar::Defer; 
 use Try::Tiny;
 use Data::Dumper;
@@ -27,7 +31,7 @@ sub arguments {
     return $self->{__cached_arguments} = $args;
 }
 
-sub meta {
+sub metadata {
     my $self = shift;
     return $self->{__cached_meta} if ( $self->{__cached_meta} );
     my $meta = {};
@@ -60,7 +64,7 @@ sub meta {
 sub arguments_by_sections {
     my $self = shift;
     my $args = $self->arguments;
-    my $meta = $self->meta;
+    my $meta = $self->metadata;
     my $return;
     for my $name ( keys %$args ) {
         $return->{$meta->{$name} && $meta->{$name}{section} ||
diff --git a/lib/RT/Dispatcher.pm b/lib/RT/Dispatcher.pm
index 7edff86..59ae6f4 100644
--- a/lib/RT/Dispatcher.pm
+++ b/lib/RT/Dispatcher.pm
@@ -159,7 +159,7 @@ on qr{^/$} => run {
         Jifty->find_plugin('Jifty::Plugin::SetupWizard')
             or die "The SetupWizard plugin needs to be used with SetupMode";
 
-        show '/__jifty/admin/setupwizard';
+        redirect '/setup/';
     }
 
     # Make them log in first, otherwise they'll appear to be logged in
diff --git a/lib/RT/View.pm b/lib/RT/View.pm
index 7694645..56a0211 100644
--- a/lib/RT/View.pm
+++ b/lib/RT/View.pm
@@ -67,7 +67,7 @@ require RT::View::Prefs;
 alias RT::View::Prefs under 'prefs/';
 
 require RT::View::SetupWizard;
-alias RT::View::SetupWizard under '__jifty/admin/setupwizard/';
+alias RT::View::SetupWizard under 'setup/';
 
 __PACKAGE__->use_mason_wrapper;
 
diff --git a/lib/RT/View/Admin/Global.pm b/lib/RT/View/Admin/Global.pm
index 768b71f..8007ce6 100644
--- a/lib/RT/View/Admin/Global.pm
+++ b/lib/RT/View/Admin/Global.pm
@@ -138,7 +138,7 @@ template 'system' => page { title => _('Configure RT') } content {
     );
     $restart->order(2);
     my $args = $config->arguments_by_sections;
-    my $meta = $config->meta;
+    my $meta = $config->metadata;
 
     if ($section) {
         with( name => $moniker ), form {
diff --git a/lib/RT/View/SetupWizard.pm b/lib/RT/View/SetupWizard.pm
index 38909f9..fa910f6 100644
--- a/lib/RT/View/SetupWizard.pm
+++ b/lib/RT/View/SetupWizard.pm
@@ -50,6 +50,45 @@ use strict;
 
 package RT::View::SetupWizard;
 use Jifty::View::Declare -base;
+use base qw/ Jifty::Plugin::SetupWizard::View::Helpers /;
+
+template 'index.html' => page { title => 'RT Setup Wizard' } content {
+    h1 { _("RT Setup Wizard") };
+    h2 { _("Welcome to RT!") };
+
+    p {
+        _("Let's get your RT install setup and ready to go.  We'll step you through a few steps to configure the basics.");
+    };
+
+    my $config = new_action(
+        class   => 'RT::Action::ConfigSystem',
+        moniker => 'sysconfig'
+    );
+
+    form { $config->next_page_button( url => 'database', label => 'Start' ) };
+
+    p {
+        outs_raw _("This setup wizard was activated by the presence of <tt>SetupMode: 1</tt> in one of your configuration files. If you are seeing this erroneously, you may restore normal operation by adjusting the <tt>etc/site_config.yml</tt> file to have <tt>SetupMode: 0</tt> set under <tt>framework</tt>.");
+    };
+};
+
+template 'database' => page { title => 'RT Setup Wizard: Database' } content {
+    h1 { _("RT Setup Wizard") };
+    h2 { _("Database") };
+    
+    my $config = new_action(
+        class   => 'RT::Action::ConfigSystem',
+        moniker => 'sysconfig'
+    );
+
+    form { $config->next_page_button( url => 'web', label => 'Next step' ) };
+};
+
+# database
+# web - base url, port, more RT stuff
+# rt specific stuff
+# turn off SetupMode in finalize
+
 
 template 'basics' => sub {
     p { _("It is very important that you change the password to RT's root user. Leaving it as the default of 'password' is a serious security risk.") };
@@ -63,7 +102,7 @@ template 'basics' => sub {
     p { _("You may change basic information about your RT install.") };
 
     my $config = new_action( class => 'RT::Action::ConfigSystem' );
-    my $meta = $config->meta;
+    my $meta = $config->metadata;
     for my $field (
         qw/rtname time_zone comment_address correspond_address sendmail_path
         owner_email/

-----------------------------------------------------------------------


More information about the Rt-commit mailing list