wisest owl (wisest_owl) wrote in changelog,
wisest owl
wisest_owl
changelog

[livejournal] r18472: LJSV-1452. Users should be able to exclu...

Committer: gprochaev
LJSV-1452. Users should be able to exclude themselves from the list of maintainers for a certain community

U   trunk/htdocs/community/members.bml
Modified: trunk/htdocs/community/members.bml
===================================================================
--- trunk/htdocs/community/members.bml	2011-03-04 03:55:06 UTC (rev 18471)
+++ trunk/htdocs/community/members.bml	2011-03-04 04:09:18 UTC (rev 18472)
@@ -704,14 +704,21 @@
         if ($_->{'admin'} && !$remote->can_super_manage($c)) {
             %disabled_maint = %disabled ? () : ( disabled => 'disabled' );
         }
+        my $username = $_->{'name'};
         my $rstyle = ($rc++ & 1) ? "altrow2" : "altrow1";
-        $ret .= "<tr class='$rstyle'><td>" . LJ::ljuser($_->{'name'}) . "</td>";
+        $ret .= "<tr class='$rstyle'><td>" . LJ::ljuser($username) . "</td>";
         my $wstr;
         foreach my $key (@attribs) {
             $ret .= "<td style='text-align: center;'>";
             $ret .= LJ::html_check({ 'name' => "edit_$_->{'userid'}_$key",
-                                     'selected' => $_->{$key}, $key =~ /admin/ ? (%disabled, %disabled_maint) : () });
-            $ret .= LJ::html_hidden({ 'name' => "edit_$_->{'userid'}_$key", value => $_->{$key} ? 'on' : '' }) if $key =~ /admin/ && (%disabled || %disabled_maint);
+                                     'selected' => $_->{$key},
+                                     ($username ne $remote->user && ($key =~ /admin/))
+                                        ? (%disabled, %disabled_maint)
+                                        : (),
+                                   });
+            $ret .= LJ::html_hidden({ 'name' => "edit_$_->{'userid'}_$key",
+                                      value => $_->{$key} ? 'on' : '' 
+                                    }) if ($username ne $remote->user) && ($key =~ /admin/) && (%disabled || %disabled_maint);
             $wstr .= $attrshort_r{$key} if $_->{$key};
             $ret .= "</td>";
         }

Tags: bml, livejournal, wisest-owl
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments