fu: Close-up of Fu, bringing a scoop of water to her mouth (Default)
fu ([personal profile] fu) wrote in [site community profile] changelog2011-03-28 09:29 am

[dw-free] alphabetize sysban types

[commit: http://hg.dwscoalition.org/dw-free/rev/656f82e7b129]

http://bugs.dwscoalition.org/show_bug.cgi?id=3565

Sort the types of sysbans in various locations.

Patch by [personal profile] exor674.

Files modified:
  • htdocs/admin/sysban.bml
--------------------------------------------------------------------------------
diff -r acd6f7cd86bc -r 656f82e7b129 htdocs/admin/sysban.bml
--- a/htdocs/admin/sysban.bml	Mon Mar 28 17:23:09 2011 +0800
+++ b/htdocs/admin/sysban.bml	Mon Mar 28 17:28:50 2011 +0800
@@ -80,7 +80,7 @@ body<=
     my $ret = "<form method='post' action='sysban'>";
     $ret   .= LJ::form_auth();
     $ret   .= "<select name='bantype'>";
-    foreach my $type ( @sysban_privs ) {
+    foreach my $type ( sort @sysban_privs ) {
         $ret .=  "<option value='$type'>$type</option>\n";
     }
     $ret .= <<FORM;
@@ -179,7 +179,8 @@ QUERYFORM
         if ( %$sysbans ) {
             $ret .= "Sysbans for " . LJ::ehtml( $banquery );
             $ret .= "<table><thead><tr><th>Type</th><th>Expiration</th><th>Note</th></tr></thead>";
-            while ( my ( $what, $details ) = each %$sysbans  ) {
+            foreach my $what ( sort keys %$sysbans  ) {
+                my $details = $sysbans->{$what};
                 $ret .= "<tr>";
                 $ret .= "<td>$what</td>";
                 $ret .= "<td>" . localtime( $details->{expire} ) . "</td> ";
@@ -232,7 +233,7 @@ RETURN
 
         $ret = "<form method='post' action='sysban'> " . LJ::form_auth() . 
                 "<select name='bantype'>";
-        foreach my $type ( @sysban_privs ) {
+        foreach my $type ( sort @sysban_privs ) {
             if ( $type eq $bantype ) {
                 $ret .=  "<option selected value='$type'>$type</option>\n";
             } else {
--------------------------------------------------------------------------------

Post a comment in response:

This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

If you are unable to use this captcha for any reason, please contact us by email at support@dreamwidth.org