журнал (shhh) wrote in changelog,
журнал
shhh
changelog

[ljcom] r12284: LJSUP-12917: Add RESERVED and INCOMING t...

Committer: nnikulochkina
LJSUP-12917: Add RESERVED and INCOMING tabs to user wallet page
U   trunk/bin/upgrading/en_LJ.dat
U   trunk/cgi-bin/LJ/Widget/Shop/View/Wallet.pm
U   trunk/templates/Shop/Wallet.tmpl
Modified: trunk/bin/upgrading/en_LJ.dat
===================================================================
--- trunk/bin/upgrading/en_LJ.dat	2012-07-13 08:13:12 UTC (rev 12283)
+++ trunk/bin/upgrading/en_LJ.dat	2012-07-13 10:23:36 UTC (rev 12284)
@@ -13741,8 +13741,11 @@
 wallet.bml.free.tokens.title|staleness=1
 wallet.bml.free.tokens.title=Sed ut perspiciatis unde omnis iste natus 100 LJ Tokens for free?
 
-wallet.bml.incoming.repost=Paid repost <a href="[[url]]">[[subject]]</a>
+wallet.bml.incoming.amount=Amount LJ Tokens
+wallet.bml.incoming.date=Date/Time
 wallet.bml.incoming.repost.nosubject=No subject
+wallet.bml.incoming.repost=Incoming for paid reposting <a href="[[url]]">[[subject]]</a>
+wallet.bml.incoming.subject=Subject
 
 wallet.bml.landing.ajax_check_error.amt.insufficient_funds|staleness=1
 wallet.bml.landing.ajax_check_error.amt.insufficient_funds=Please reduce amount
@@ -13832,6 +13835,14 @@
 wallet.bml.langing.to_input|staleness=1
 wallet.bml.langing.to_input=recipient
 
+wallet.bml.reserved.balance=Amount LJ Tokens
+wallet.bml.reserved.blocked=Refunded LJ Tokens
+wallet.bml.reserved.repost.nosubject=No subject
+wallet.bml.reserved.repost=Paid repost <a href="[[url]]">[[subject]]</a>
+wallet.bml.reserved.subject=Subject Reservation for
+wallet.bml.reserved.takeoff=Taking off the reservation
+wallet.bml.reserved.total=Total
+
 wallet.error_acc_insufficient_blocked=Not enough blocked tokens on this account
 
 wallet.error_acc_insufficient_funds=Not enough tokens on this account

Modified: trunk/cgi-bin/LJ/Widget/Shop/View/Wallet.pm
===================================================================
--- trunk/cgi-bin/LJ/Widget/Shop/View/Wallet.pm	2012-07-13 08:13:12 UTC (rev 12283)
+++ trunk/cgi-bin/LJ/Widget/Shop/View/Wallet.pm	2012-07-13 10:23:36 UTC (rev 12284)
@@ -120,15 +120,17 @@
     }
 
     my ($blockings, $accounts);
+    my ($total_blocked, $total_balance);
 
     if ($show_tab =~ /incoming/) {
-        my $res = LJ::Pay::Wallet::Blocking->get_incoming_blockings($remote);
+        my $res = eval{LJ::Pay::Wallet::Blocking->get_incoming_blockings($remote)};
         $blockings = $res->{items} if $res;
     }
 
     if ($show_tab =~ /reserved/) {
         my $res = eval{LJ::Pay::Wallet::Account->get_user_active_accounts($remote)};
-        $accounts = $res->{items};
+        $accounts = $res->{items} if $res;
+        ($total_blocked, $total_balance) = ($res->{total_blocked}, $res->{total_balance});
     }
 
 
@@ -158,10 +160,14 @@
 
         'wallet_ext_disabled' => $LJ::DISABLED{wallet_ext},
         'blockings' => $blockings,
+        'total_blocked' => $total_blocked,
+        'total_balance' => $total_balance,
         'accounts'  => $accounts,
 
         'tab_buy_active' => $show_tab eq 'buy',
         'tab_send_active' => $show_tab eq 'send',
+        'tab_incoming_active' => $show_tab eq 'incoming',
+        'tab_reserved_active' => $show_tab eq 'reserved',
         'tab_tokens_free' => $show_tab eq 'free',
         'buy_select_options' => $buy_select_options,
         'ljtokens_slider' => !$LJ::DISABLED{ljtokens_slider},

Modified: trunk/templates/Shop/Wallet.tmpl
===================================================================
--- trunk/templates/Shop/Wallet.tmpl	2012-07-13 08:13:12 UTC (rev 12283)
+++ trunk/templates/Shop/Wallet.tmpl	2012-07-13 10:23:36 UTC (rev 12284)
@@ -164,11 +164,31 @@
 <tmpl_var js_complete>
 
 <TMPL_UNLESS wallet_ext_disabled>
-<TMPL_IF blockings>
+<TMPL_IF tab_incoming_active>
+        <tmpl_var expr="ml('wallet.bml.incoming.date')"> | 
+        <tmpl_var expr="ml('wallet.bml.incoming.subject')"> |
+        <tmpl_var expr="ml('wallet.bml.incoming.amount')">
+        <br>
         <TMPL_LOOP blockings>
         <tmpl_var date> | <tmpl_var desc> | <tmpl_var qty> <br>
         </TMPL_LOOP>
 </TMPL_IF>
+
+<TMPL_IF tab_reserved_active>
+        <tmpl_var expr="ml('wallet.bml.reserved.subject')"> |
+        <tmpl_var expr="ml('wallet.bml.reserved.blocked')"> |
+        <tmpl_var expr="ml('wallet.bml.reserved.balance')">
+        <br>
+        <form>
+        <TMPL_LOOP accounts>
+        <input type="checkbox"> | <tmpl_var desc> | <tmpl_var blocked> | <tmpl_var balance> <br>
+        </TMPL_LOOP>
+        <tmpl_var expr="ml('wallet.bml.reserved.total')"> | <tmpl_var total_blocked> | <tmpl_var total_balance> <br>
+        <input type="submit" value="<tmpl_var expr="ml('wallet.bml.reserved.takeoff')">">
+        </form>
+</TMPL_IF>
+
+
 </TMPL_UNLESS>
 
 </div>

Tags: dat, ljcom, nikulochkina, nnikulochkina, pm, tmpl
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