juks (juks) wrote in changelog,
juks
juks
changelog

[ljcom] r10004: LJSUP-7445 Try & buy

Committer: iaskarov
LJSUP-7445 Try & buy
U   trunk/htdocs/manage/account/index.bml
U   trunk/htdocs/manage/payments/index.bml.text.local
Modified: trunk/htdocs/manage/account/index.bml
===================================================================
--- trunk/htdocs/manage/account/index.bml	2011-02-09 04:24:51 UTC (rev 10003)
+++ trunk/htdocs/manage/account/index.bml	2011-02-09 08:30:48 UTC (rev 10004)
@@ -36,12 +36,16 @@
     $warning = BML::ml('.downgrade_success', { aopts => "href='$LJ::SITEROOT/'" }) if $GET{downgrade};
     if (LJ::did_post()) {
         return LJ::bad_input($ML{'error.invalidform'})  unless LJ::check_form_auth();
+
         if ($POST{plus}) {
             # Add to plus and use horizontal ads if prop hasn't ever been set
             $u->add_to_class('plus');
             $u->set_prop('journal_box_placement', 'h')
                 if $u->prop('journal_box_placement') eq '';
             return BML::redirect( "$LJ::SITEROOT/manage/account/adsettings.bml?changelevel=1" );
+        } elsif ($POST{acct_level} eq "trynbuy") {
+            my %res = LJ::Widget->handle_post(\%POST, qw(Trynbuy));
+            BML::redirect("/free-trial/congratulations.bml") if (%res and $res{activated});
         } elsif ($POST{cancel_sponsorship}) {
             if (!$u->is_sponsored) {
                 $warning = $ML{'.sup_sponsored.warning.not_sponsored'};
@@ -439,6 +443,15 @@
                 $body .= "</td></tr>";
             }
 
+            if($u && !LJ::TryNBuy->active($u) && !LJ::TryNBuy->already_used($u)) {
+                $body .= "<tr><td>";
+                $body .= LJ::html_check({ type => "radio", name => "acct_level", value => "trynbuy", id => "change_level_trynbuy", selected => $u->knows_about_sponsors ? 0 : 1 });
+                $body .= "</td><td>";
+                $body .= "<p><strong><label for='change_level_trynbuy'>$ML{'.changelevel.trynbuy.title'}</label></strong><br />";
+                $body .= "<label for='change_level_trynbuy'>" . BML::ml('.changelevel.trynbuy.text') . "</label></p>";
+                $body .= "</td></tr>";
+            }
+
             $body .= "<tr class='paid_block'><td>";
             $body .= LJ::html_check({ type => "radio", name => "acct_level", value => "paid", id => "change_level_paid", selected => $u->knows_about_sponsors ? 0 : 1 });
             $body .= "</td><td>";

Modified: trunk/htdocs/manage/payments/index.bml.text.local
===================================================================
--- trunk/htdocs/manage/payments/index.bml.text.local	2011-02-09 04:24:51 UTC (rev 10003)
+++ trunk/htdocs/manage/payments/index.bml.text.local	2011-02-09 08:30:48 UTC (rev 10004)
@@ -101,6 +101,10 @@
 .changelevel.sponsored.title|staleness=1
 .changelevel.sponsored.title=Upgrade to a Sponsored Account
 
+.changelevel.trynbuy.text=Try&Buy text
+
+.changelevel.trynbuy.title=Try&Buy Title
+
 .downgrade_success|staleness=1
 .downgrade_success=Your account level change was a success.  <a [[aopts]]>Return Home</a>
 

Tags: bml, juks, ljcom, local
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