juks (juks) wrote in changelog,
juks
juks
changelog

[ljcom] r9979: LJSUP-7445: TrynBuy

Committer: iaskarov
LJSUP-7445: TrynBuy
U   trunk/cgi-bin/LJ/Pay.pm
U   trunk/cgi-bin/LJ/Widget/HomepageRU.pm
Modified: trunk/cgi-bin/LJ/Pay.pm
===================================================================
--- trunk/cgi-bin/LJ/Pay.pm	2011-02-01 10:32:40 UTC (rev 9978)
+++ trunk/cgi-bin/LJ/Pay.pm	2011-02-01 10:39:37 UTC (rev 9979)
@@ -401,14 +401,16 @@
     $ret .= '<td class="b-accstats-subhead b-accstats-storage"><span>' . BML::ml('pay.widget.storage.title') . '</span></td>' unless $is_comm || $is_identity;
     $ret .= '<td class="b-accstats-subhead b-accstats-subs"><span>' . BML::ml('pay.widget.subscriptions.title') . '</span></td>' if $u->can_use_esn && !$u->is_community;
     $ret .= '<td class="b-accstats-subhead b-accstats-voice"><span>' . BML::ml('pay.widget.voiceposts.title') . '</span></td>' unless $is_comm || $is_identity;
-    $ret .= '<td rowspan="3" class="b-accstats-button"><a href="' . $LJ::SITEROOT .'/manage/account/?changelevel=1" class="b-accstats-trynbuy">' . BML::ml('pay.widget.trynbuy') . '</a></td>';
-    $ret .= $is_identity ? '<td rowspan="3" class="b-accstats-button"><a href="' . $LJ::SITEROOT .'/identity/convert.bml" class="b-accstats-upgrade">' . BML::ml('pay.widget.upgradefull') . '</a></td>' : '<td rowspan="3" class="b-accstats-button"><a href="' . $LJ::SITEROOT .'/manage/account/?changelevel=2" class="b-accstats-upgrade">' . BML::ml('pay.widget.upgradenow') . '</a></td>';
+    if (!$u->get_cap('paid')) {
+        $ret .= '<td rowspan="3" class="b-accstats-button"><a href="' . $LJ::SITEROOT .'/manage/account/?changelevel=1" class="b-accstats-trynbuy">' . BML::ml('pay.widget.trynbuy') . '</a></td>';
+        $ret .= $is_identity ? '<td rowspan="3" class="b-accstats-button"><a href="' . $LJ::SITEROOT .'/identity/convert.bml" class="b-accstats-upgrade">' . BML::ml('pay.widget.upgradefull') . '</a></td>' : '<td rowspan="3" class="b-accstats-button"><a href="' . $LJ::SITEROOT .'/manage/account/?changelevel=2" class="b-accstats-upgrade">' . BML::ml('pay.widget.upgradenow') . '</a></td>';
+    }
     $ret .= '</tr>';
     $ret .= '<tr>';
-    $ret .= '<th class="b-accstats-subhead b-accstats-border">' . BML::ml('pay.widget.header') . '</th>';
+    $ret .= '<th class="b-accstats-subhead">' . BML::ml('pay.widget.header') . '</th>';
     
     #userpics
-    $ret .= '<td class="b-accstats-border">';
+    $ret .= '<td>';
     my %cap_opts = ();
     my $upicmax = LJ::get_cap($u, 'userpics', \%cap_opts) || 0;
     my $upicusage = 0;
@@ -434,7 +436,7 @@
     };
     my $used_size = LJ::Blob->get_disk_usage($u);
     my $max_size = LJ::get_cap($u, "disk_quota") * $shift{MiB};
-    $ret .= '<td class="b-accstats-border">' . BML::ml('pay.widget.storage', {'amountused' => $size->($used_size), 'max' => $size->($max_size)}) . '</td>'
+    $ret .= '<td>' . BML::ml('pay.widget.storage', {'amountused' => $size->($used_size), 'max' => $size->($max_size)}) . '</td>'
         unless $is_comm || $is_identity;
     
     #subscriptions
@@ -446,21 +448,23 @@
     }
     my $sub_count = $u->subscriptions_count;
     my $sub_max = $u->get_cap('subscriptions');
-    $ret .= '<td class="b-accstats-border">' . BML::ml('pay.widget.subscriptions', { numused => $sub_count, max => $sub_max }) . '</td>'
+    $ret .= '<td>' . BML::ml('pay.widget.subscriptions', { numused => $sub_count, max => $sub_max }) . '</td>'
         if $u->can_use_esn && !$u->is_community;
     
     #voice
-    $ret .= '<td class="b-accstats-border">' . BML::ml('pay.widget.voiceposts', {'numused' => $phoneusage, 'max' => $phonemax, 'aopts' => "href='$LJ::SITEROOT/support/faqbrowse.bml?faqid=183&amp;view=full'"}) . '</td>'
+    $ret .= '<td>' . BML::ml('pay.widget.voiceposts', {'numused' => $phoneusage, 'max' => $phonemax, 'aopts' => "href='$LJ::SITEROOT/support/faqbrowse.bml?faqid=183&amp;view=full'"}) . '</td>'
         unless $is_comm || $is_identity;
     
     $ret .= '</tr>';
-    $ret .= '<tr>';
-    $ret .= '<th class="b-accstats-subhead">' . BML::ml('pay.widget.upgrade') . '</th>';
-    $ret .= '<td>' . BML::ml('pay.widget.upgradebonus.userpics') . '</td>';
-    $ret .= '<td>' . BML::ml('pay.widget.upgradebonus.storage') . '</td>' unless $is_comm || $is_identity;
-    $ret .= '<td>' . BML::ml('pay.widget.upgradebonus.subscriptions') . '</td>' if $u->can_use_esn && !$u->is_community;
-    $ret .= '<td>' . BML::ml('pay.widget.upgradebonus.voice') . '</td>' unless $is_comm || $is_identity;
-    $ret .= '</tr>';
+    if (!$u->get_cap('paid')) {
+        $ret .= '<tr>';
+        $ret .= '<th class="b-accstats-subhead b-accstats-border">' . BML::ml('pay.widget.upgrade') . '</th>';
+        $ret .= '<td class="b-accstats-border">' . BML::ml('pay.widget.upgradebonus.userpics') . '</td>';
+        $ret .= '<td class="b-accstats-border">' . BML::ml('pay.widget.upgradebonus.storage') . '</td>' unless $is_comm || $is_identity;
+        $ret .= '<td class="b-accstats-border">' . BML::ml('pay.widget.upgradebonus.subscriptions') . '</td>' if $u->can_use_esn && !$u->is_community;
+        $ret .= '<td class="b-accstats-border">' . BML::ml('pay.widget.upgradebonus.voice') . '</td>' unless $is_comm || $is_identity;
+        $ret .= '</tr>';
+    }
     $ret .= '</table>';
     $ret .= '</div>';
 

Modified: trunk/cgi-bin/LJ/Widget/HomepageRU.pm
===================================================================
--- trunk/cgi-bin/LJ/Widget/HomepageRU.pm	2011-02-01 10:32:40 UTC (rev 9978)
+++ trunk/cgi-bin/LJ/Widget/HomepageRU.pm	2011-02-01 10:39:37 UTC (rev 9979)
@@ -128,6 +128,9 @@
     ## Widget SettingProdDisplay
     $result{widget_settingproddisplay} = LJ::Widget::SettingProdDisplay->render;
     
+    ## Widget Trynbuy
+    $result{widget_trynbuy} = LJ::Widget::Trynbuy->render(stage => 'simple');
+    
     ## Strings
     $result{string_join_lj_url} = LJ::run_hook('construct_adcall', orient => "App-Join-Livejournal");
 

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