mark: A photo of Mark kneeling on top of the Taal Volcano in the Philippines. It was a long hike. (Default)
Mark Smith ([staff profile] mark) wrote in [site community profile] changelog2010-01-08 11:50 pm

[dw-free] change feedback when last invite code has been used

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

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

Don't ask a user to invite more people if they don't have more invite codes.

Patch by [personal profile] yvi.

Files modified:
  • htdocs/manage/circle/invite.bml
  • htdocs/manage/circle/invite.bml.text
--------------------------------------------------------------------------------
diff -r 63973df563bf -r fcfda13ceac5 htdocs/manage/circle/invite.bml
--- a/htdocs/manage/circle/invite.bml	Fri Jan 08 23:45:20 2010 +0000
+++ b/htdocs/manage/circle/invite.bml	Fri Jan 08 23:50:27 2010 +0000
@@ -166,7 +166,10 @@
                 my $invite_obj = DW::InviteCodes->new( code => $code );
                 $invite_obj->send_code( email => $email );
 
-                $body .= "<?standout " . BML::ml('.success.code', { email  => $email, invitecode => $code }) . " standout?>";
+                $body .= "<?standout " . BML::ml( '.success.code', { email  => $email, invitecode => $code } );
+                $body .= BML::ml( '.success.invitemore' )
+                    if DW::InviteCodes->unused_count( userid => $u->id ) > 1;
+                $body .= " standout?>";
 
                 $code_sent = 1;
 
diff -r 63973df563bf -r fcfda13ceac5 htdocs/manage/circle/invite.bml.text
--- a/htdocs/manage/circle/invite.bml.text	Fri Jan 08 23:45:20 2010 +0000
+++ b/htdocs/manage/circle/invite.bml.text	Fri Jan 08 23:50:27 2010 +0000
@@ -106,6 +106,8 @@ The [[sitename]] Team
 
 .success=Message sent to [[email]]! Want to invite somebody else?
 
-.success.code=Message sent to [[email]] using invite code "[[invitecode]]"! Want to invite somebody else?
+.success.code=Message sent to [[email]] using invite code "[[invitecode]]".
+
+.success.invitemore=Would you like to invite someone else?
 
 .title=Invite a Friend!
--------------------------------------------------------------------------------