afuna: Cat under a blanket. Text: "Cats are just little people with Fur and Fangs" (Default)
afuna ([personal profile] afuna) wrote in [site community profile] changelog2009-04-15 08:26 pm

[dw-free] Manage circle should also include member status for communities

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

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

Add member status for communities in manage/circle/edit.bml

Patch by [community profile] isabeau.

Files modified:
  • htdocs/manage/circle/edit.bml
  • htdocs/manage/circle/edit.bml.text
--------------------------------------------------------------------------------
diff -r 26ee6ca622b7 -r f45eab63005d htdocs/manage/circle/edit.bml
--- a/htdocs/manage/circle/edit.bml	Wed Apr 15 19:57:04 2009 +0000
+++ b/htdocs/manage/circle/edit.bml	Wed Apr 15 20:25:39 2009 +0000
@@ -133,7 +133,7 @@ body<=
         if ( @nonperson_userids ) {
             $ret .= "<p>$ML{'.circle.intro.nonpeople'}</p>";
             $ret .= "<div align='center'><table class='editfriends'>";
-            $ret .= "<tr class='header'><th>$ML{'.circle.username'}</th><th>$ML{'.circle.name'}</th><th>$ML{'.circle.watch'}</th></tr>";
+            $ret .= "<tr class='header'><th>$ML{'.circle.username'}</th><th>$ML{'.circle.name'}</th><th>$ML{'.circle.member'}</th><th>$ML{'.circle.watch'}</th></tr>";
             foreach my $uid ( @nonperson_userids ) { # no need to sort because we inserted them into the array in order
                 my $other_u = $us->{$uid};
                 next unless $other_u;
@@ -147,6 +147,28 @@ body<=
                 $ret .= "<tr>";
                 $ret .= "<td>" . $other_u->ljuser_display . "</td>";
                 $ret .= "<td style='color: $u_fg; background-color: $u_bg;'>" . $other_u->name_html . "</td>";
+
+                if ( $other_u->is_community ) { #check membership
+
+                    my ( $m_text, $jl_url, $jl_text );
+
+                    if ( $is_member_of_userid{$uid} ) {
+                        $m_text = "Y";
+                        $jl_url = "community/leave.bml";
+                        $jl_text = $ML{'.comm.leave'};
+                    } else {
+                        $m_text = "N";
+                        $jl_url = "community/join.bml";                                                     
+                        $jl_text = $ML{'.comm.join'};
+                     }
+
+                    $ret .= "<td>$m_text 
+                             [<a href='$LJ::SITEROOT/$jl_url?comm=" . $other_u->user . "'>$jl_text</a>]
+                             </td>";
+
+                } else {
+                    $ret .= "<td>&nbsp;</td>";
+                }
 
                 if ( $u->can_watch( $other_u ) ) {
                     $ret .= "<td>" . LJ::html_check({
diff -r 26ee6ca622b7 -r f45eab63005d htdocs/manage/circle/edit.bml.text
--- a/htdocs/manage/circle/edit.bml.text	Wed Apr 15 19:57:04 2009 +0000
+++ b/htdocs/manage/circle/edit.bml.text	Wed Apr 15 20:25:39 2009 +0000
@@ -18,6 +18,8 @@
 
 .circle.intro.nonpeople=Here are the communities and feeds in your circle:
 
+.circle.member=Member
+
 .circle.na=N/A
 
 .circle.name=Name
@@ -31,6 +33,10 @@
 .circle.watch=Subscribe?
 
 .circle.watched_by=Subscribes to you?
+
+.comm.join=Join
+
+.comm.leave=Leave
 
 .editfriends.friend=Friend?
 
--------------------------------------------------------------------------------

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