The code is not nice. It currently generates a leave button for every member of each circle. And I don't know how to hide the join button for circles of which the user already belongs.