[Rt-commit] r19465 - rt/3.999/branches/config-in-db/share/html/Admin/Global

sunnavy at bestpractical.com sunnavy at bestpractical.com
Wed May 6 12:22:42 EDT 2009


Author: sunnavy
Date: Wed May  6 12:22:42 2009
New Revision: 19465

Modified:
   rt/3.999/branches/config-in-db/share/html/Admin/Global/System.html

Log:
make sections shown in different pages, also both "Save" and "Save and Restart" buttons

Modified: rt/3.999/branches/config-in-db/share/html/Admin/Global/System.html
==============================================================================
--- rt/3.999/branches/config-in-db/share/html/Admin/Global/System.html	(original)
+++ rt/3.999/branches/config-in-db/share/html/Admin/Global/System.html	Wed May  6 12:22:42 2009
@@ -45,22 +45,50 @@
 %# those contributions and any derivatives thereof.
 %# 
 %# END BPS TAGGED BLOCK }}}
- 
-<h1><&|/l&>RT Config</&></h1>
-<% Jifty->web->form->start %>
-% for my $section ( sort keys %$args ) {
-<h2><% $section |n%></h2>
+<&| /Admin/Elements/Header, title => $title, feed_uri => 'templates' &>
+<& /Admin/Elements/SystemTabs, 
+    current_tab => 'Admin/Global/Templates.html', 
+    current_subtab => 'Admin/Global/Templates.html', 
+    subtabs => $subtabs, 
+    title => $title &>
+% if ( $section ) {
+<% Jifty->web->form->start( submit_to => Jifty->web->request->path .
+        "?section=$section" ) %>
 % for my $field ( sort keys %{$args->{$section}} ) {
+<div class="hints">
 <% $meta->{$field} && $meta->{$field}{doc} |n %>
-<% $action->form_field( $field ) %>
-<hr />
-% } }
-<% Jifty->web->form->submit( label => _('Save and Restart RT') ) %>
+</div>
+<% $config->form_field( $field ) %>
+% }
+<% Jifty->web->form->submit( label => _('Save') ) %>
+<% Jifty->web->form->submit( label => _('Save and Restart RT'),
+            submit => [ $config, $restart ],
+        ) %>
 <% Jifty->web->form->end %>
-
+% } else {
+    select a section
+%}
+</&>
 <%init>
-my $action = Jifty->web->new_action( class => 'ConfigSystem' );
-my $args = $action->arguments_by_sections;
-my $meta = $action->meta;
+my $config = Jifty->web->new_action( class => 'ConfigSystem' );
+$config->order(1);
+my $restart = Jifty->web->new_action( class =>
+        'Jifty::Plugin::Config::Action::Restart' );
+$restart->order(2);
+my $args = $config->arguments_by_sections;
+my $meta = $config->meta;
+
+my $title = _("Configure RT");
+my $subtabs = {};
+my $sort_order = 'A'; # sort order begins with 'A'
+for my $section ( sort keys %$args ) {
+    $subtabs->{ $sort_order++ } = {
+        title => _($section),
+        path  => "Admin/Global/System.html?section=$section"
+    };
+}
 </%init>
 
+<%args>
+$section => undef
+</%args>


More information about the Rt-commit mailing list