[Rt-commit] rt branch, development, updated. 441e78f45a33171dc6fce184bbe098f4dda8ee93
Thomas Sibley
trs at bestpractical.com
Wed Jul 21 11:50:56 EDT 2010
The branch, development has been updated
via 441e78f45a33171dc6fce184bbe098f4dda8ee93 (commit)
via 8724d3f95ba5768eaffd27ee27855ed1d604742f (commit)
from 899a826adf7d9a6cd5679b695a42aa00dd5bdf80 (commit)
Summary of changes:
lib/RT.pm | 3 --
lib/RT/Config.pod | 7 ++---
lib/RT/View/SetupWizard.pm | 35 ++++++++++++++++++++++++++++++++++
lib/RT/View/SetupWizard/Helpers.pm | 23 ++++++++++++++-------
share/web/static/css/setupwizard.css | 10 ++++++--
share/web/static/js/setupwizard.js | 14 ++++++------
6 files changed, 67 insertions(+), 25 deletions(-)
- Log -----------------------------------------------------------------
commit 8724d3f95ba5768eaffd27ee27855ed1d604742f
Author: Thomas Sibley <trs at bestpractical.com>
Date: Wed Jul 21 10:56:26 2010 -0400
Note why we have our own mailer config widget
diff --git a/lib/RT/View/SetupWizard/Helpers.pm b/lib/RT/View/SetupWizard/Helpers.pm
index 54c82b7..84489d0 100644
--- a/lib/RT/View/SetupWizard/Helpers.pm
+++ b/lib/RT/View/SetupWizard/Helpers.pm
@@ -63,7 +63,9 @@ use base qw/ Jifty::Plugin::SetupWizard::View::Helpers /;
=head2 mail_widget
-Provides a mail configuration widget for RT's setup wizard.
+Provides a mail configuration widget for RT's setup wizard. NOTE: this
+configures RT's, not Jifty's, mailer. Jifty's mail infrastructure is unused by
+RT4 at the moment.
Much of it is based on the database config widget provided by Jifty's
SetupWizard plugin.
commit 441e78f45a33171dc6fce184bbe098f4dda8ee93
Author: Thomas Sibley <trs at bestpractical.com>
Date: Wed Jul 21 11:51:34 2010 -0400
Add BaseURL and Port to the web step
This requires rejiggering how we do our sliding doc for RT config
fields. It now uses Jifty's form field hints.
diff --git a/lib/RT.pm b/lib/RT.pm
index 56171fe..2b58799 100644
--- a/lib/RT.pm
+++ b/lib/RT.pm
@@ -451,9 +451,6 @@ sub start {
rulebuilder.js
));
- Jifty->web->add_javascript('setupwizard.js')
- if Jifty->config->framework('SetupMode');
-
Jifty::Web->add_trigger(
name => 'after_include_javascript',
callback => sub {
diff --git a/lib/RT/Config.pod b/lib/RT/Config.pod
index 6481b88..4ba9f38 100644
--- a/lib/RT/Config.pod
+++ b/lib/RT/Config.pod
@@ -511,11 +511,10 @@ Default: C<'concise'>
=item C<web_path>
-If you're putting the web ui somewhere other than at the root of
-your server, you should set C<web_path> to the path you'll be
-serving RT at.
+If RT's web interface is installed somewhere other than at the root of your web
+server, you should set C<web_path> to the path where RT is located.
-C<web_path> requires a leading / but no trailing /.
+C<web_path> requires a leading / (forward slash) but no trailing /.
In most cases, you should leave C<web_path> set to '' (an empty value).
diff --git a/lib/RT/View/SetupWizard.pm b/lib/RT/View/SetupWizard.pm
index 6159647..ef82a97 100644
--- a/lib/RT/View/SetupWizard.pm
+++ b/lib/RT/View/SetupWizard.pm
@@ -52,10 +52,17 @@ package RT::View::SetupWizard;
use Jifty::View::Declare -base;
use base qw/ RT::View::SetupWizard::Helpers /;
+use URI;
+
sub setup_page (&) {
my ($code) = @_;
page { title => "RT Setup Wizard" } content {
my $self = shift;
+ script {{
+ src is URI->new(Jifty->web->url( path => '/static/js/setupwizard.js' ))->path,
+ type is 'text/javascript'
+ }};
+
h1 { _("RT Setup Wizard") };
div {{ id is 'setupwizard' };
form {
@@ -185,9 +192,37 @@ template 'web' => setup_page {
# XXX TODO: How can we set the jifty BaseUrl and Port without respawning
# the current server
+
+ div {{ class is 'reveal-hints' };
+ $self->config_field(
+ field => 'BaseURL',
+ context => '/framework/Web',
+ message => "Set RT's base URL",
+ value_args => {
+ label => _("Base URL"),
+ hints => "The base scheme (e.g. http://) and host for your RT",
+ },
+ );
+ };
+
+ div {{ class is 'reveal-hints' };
+ $self->config_field(
+ field => 'Port',
+ context => '/framework/Web',
+ message => "Set RT's default port",
+ value_args => {
+ label => _("Port"),
+ hints => "Almost always port 80, the default for HTTP",
+ },
+ );
+ };
+
$self->rt_config_field( field => [qw( web_path logo_url )] );
};
+# XXX TODO: step for checking and turning off Admin, Devel, and Setup modes?
+# LogLevel?
+
template 'done' => setup_page {
my $self = shift;
diff --git a/lib/RT/View/SetupWizard/Helpers.pm b/lib/RT/View/SetupWizard/Helpers.pm
index 84489d0..f837b68 100644
--- a/lib/RT/View/SetupWizard/Helpers.pm
+++ b/lib/RT/View/SetupWizard/Helpers.pm
@@ -95,7 +95,7 @@ private template 'mail_widget' => sub {
$self->rt_config_field(
field => 'mail_command',
- doc_class => 'static-doc',
+ static_doc => 1,
value_args => {
onchange => [$onchange]
}
@@ -157,7 +157,7 @@ sub rt_config_field {
my %args = (
field => [],
value_args => {},
- doc_class => '',
+ static_doc => 0,
@_
);
@@ -167,12 +167,17 @@ sub rt_config_field {
$args{'field'} = [ $args{'field'} ]
if not ref $args{'field'};
+ my $class = $args{'static_doc'} ? 'static-hints' : 'reveal-hints';
+
for my $field ( @{$args{'field'}} ) {
- div {{ class is 'config-field' };
- render_param( $config => $field, %{ $args{'value_args'} } );
- div {{ class is join(' ', 'doc', $args{'doc_class'}) };
- outs_raw( $meta->{$field}{'doc'} )
- } if $meta->{$field} and defined $meta->{$field}{'doc'};
+ div {{ class is $class };
+ my %params = %{$args{'value_args'}};
+
+ $params{'hints'} = $meta->{$field}{'doc'}
+ if not defined $params{'hints'}
+ and $meta->{$field} and defined $meta->{$field}{'doc'};
+
+ render_param( $config => $field, %params );
};
}
diff --git a/share/web/static/css/setupwizard.css b/share/web/static/css/setupwizard.css
index 0c6bd82..37e7d1f 100644
--- a/share/web/static/css/setupwizard.css
+++ b/share/web/static/css/setupwizard.css
@@ -88,19 +88,23 @@
width: 18em;
}
-#setupwizard .config-field .form_field .label {
+#setupwizard .form_field .label,
+#setupwizard .form_field label {
width: 12em;
font-weight: bold;
font-size: 1em;
line-height: 1.6em;
}
-#setupwizard .config-field .doc {
+#setupwizard .form_field .hints {
+ float: none;
display: block;
margin-left: 12.7em;
+ font-size: 1em;
+ color: black;
}
-#setupwizard .config-field .doc p:first-child {
+#setupwizard .form_field .hints p:first-child {
padding-top: 0;
margin-top: 0;
}
diff --git a/share/web/static/js/setupwizard.js b/share/web/static/js/setupwizard.js
index 60a34a9..803e719 100644
--- a/share/web/static/js/setupwizard.js
+++ b/share/web/static/js/setupwizard.js
@@ -1,21 +1,21 @@
Behaviour.register({
- ".config-field .widget": function(e) {
+ "#setupwizard .reveal-hints .form_field .widget": function(e) {
jQuery(e).focus(
function(){
- var thisdoc = jQuery(this).parent().parent().find(".doc");
+ var thisdoc = jQuery(this).parent().find(".hints");
// Slide up everything else and slide down this doc
- jQuery('.config-field .doc').not(thisdoc).not(".static-doc").slideUp();
- thisdoc.not(".static-doc").slideDown();
+ jQuery('#setupwizard .reveal-hints .form_field .hints').not(thisdoc).slideUp();
+ thisdoc.slideDown();
}
);
},
- ".config-field .doc": function(e) {
- jQuery(e).not(".static-doc").hide();
+ "#setupwizard .reveal-hints .form_field .hints": function(e) {
+ jQuery(e).hide();
}
});
jQuery(function() {
- jQuery('.config-field .widget')[0].focus();
+ jQuery('#setupwizard .form_field .widget')[0].focus();
});
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list