[Rt-commit] rt branch, admin_ui, updated. 572b1188518bd2d4d42f088319c33c9da352f294

sunnavy at bestpractical.com sunnavy at bestpractical.com
Thu Jan 21 01:56:49 EST 2010


The branch, admin_ui has been updated
       via  572b1188518bd2d4d42f088319c33c9da352f294 (commit)
      from  2791d164abb3dc160f699394b7bfebd9d5da883f (commit)

Summary of changes:
 lib/RT/Action/EditUserPrefsOther.pm |   46 +++++++++++++++++++++++-----------
 lib/RT/View/Prefs.pm                |    8 +++---
 2 files changed, 35 insertions(+), 19 deletions(-)

- Log -----------------------------------------------------------------
commit 572b1188518bd2d4d42f088319c33c9da352f294
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Thu Jan 21 14:56:41 2010 +0800

    ordered sections is better

diff --git a/lib/RT/Action/EditUserPrefsOther.pm b/lib/RT/Action/EditUserPrefsOther.pm
index 996a970..2017b28 100644
--- a/lib/RT/Action/EditUserPrefsOther.pm
+++ b/lib/RT/Action/EditUserPrefsOther.pm
@@ -251,24 +251,40 @@ sub default_value {
     }
 }
 
-sub fields {
-    my %fields = (
-        'General' => [
-            qw/default_queue username_format web_default_stylesheet
-              message_box_rich_text message_box_rich_text_height message_box_width
-              message_box_height/
-        ],
-        'Locale'         => [qw/date_time_format/],
-        Mail             => [qw/email_frequency/],
-        'RT at a glance' => [
-            qw/default_summary_rows max_inline_body oldest_transactions_first
-              show_unread_message_notifications plain_text_pre/
-        ],
+sub sections {
+    my @sections = (
+        {
+            title  => 'General',
+            fields => [
+                qw/default_queue username_format web_default_stylesheet
+                  message_box_rich_text message_box_rich_text_height message_box_width
+                  message_box_height/
+            ]
+        },
+        {
+            title  => 'Locale',
+            fields => [qw/date_time_format/]
+        },
+        {
+            title  => 'Mail',
+            fields => => [qw/email_frequency/]
+        },
+        {
+            title  => 'RT at a glance',
+            fields => [
+                qw/default_summary_rows max_inline_body oldest_transactions_first
+                  show_unread_message_notifications plain_text_pre/
+            ]
+        },
     );
     if ( RT->config->get('gnupg')->{'enable'} ) {
-        $fields{'Cryptography'} = [qw/preferred_key/];
+        push @sections,
+          {
+            title  => 'Cryptography',
+            values => [qw/preferred_key/]
+          };
     }
-    return %fields;
+    return @sections;
 }
 
 
diff --git a/lib/RT/View/Prefs.pm b/lib/RT/View/Prefs.pm
index 622cd45..e86cf03 100644
--- a/lib/RT/View/Prefs.pm
+++ b/lib/RT/View/Prefs.pm
@@ -117,12 +117,12 @@ template 'other' => page { title => _('Customize Others') } content {
         moniker => $moniker,
     );
 
-    my %fields      = RT::Action::EditUserPrefsOther->fields;
+    my @sections      = RT::Action::EditUserPrefsOther->sections;
 
     with( name => $moniker ), form {
-        for my $section ( keys %fields ) {
-            h2 { _($section) };
-            for my $field ( @{ $fields{$section} } ) {
+        for my $section ( @sections ) {
+            h2 { _($section->{title}) };
+            for my $field ( @{ $section->{fields} } ) {
                 outs_raw( $action->form_field($field) );
             }
         }

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


More information about the Rt-commit mailing list