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

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

Committer: nnikulochkina
LJSUP-12917: Add RESERVED and INCOMING tabs to user wallet page
U   trunk/cgi-bin/LJ/Widget/Shop/View/Wallet.pm
U   trunk/cgi-bin/LJ/Widget/Shop.pm
Modified: trunk/cgi-bin/LJ/Widget/Shop/View/Wallet.pm
===================================================================
--- trunk/cgi-bin/LJ/Widget/Shop/View/Wallet.pm	2012-08-16 14:45:23 UTC (rev 12484)
+++ trunk/cgi-bin/LJ/Widget/Shop/View/Wallet.pm	2012-08-17 12:20:25 UTC (rev 12485)
@@ -20,10 +20,24 @@
 
 sub need_res {
     my $self = shift;
-    
-    LJ::need_res(qw(
-                    ));
-    
+
+    unless ($LJ::DISABLED{wallet_ext}) {
+        LJ::need_res(qw(
+                        templates/Widgets/shop/incoming_data.tmpl
+                        templates/Widgets/pagination.tmpl
+                        js/jquery/jquery.lj.pagination.js
+                        js/jquery/shop/jquery.lj.shopIncoming.js
+                        js/shop/tokens.js
+                        ));
+
+        LJ::need_string(qw{
+            shop.history.paging.title
+            shop.history.paging.previous
+            shop.history.paging.next
+        });
+ 
+    }
+
     return $self->SUPER::need_res();
 
 }
@@ -153,6 +167,9 @@
                 return "$LJ::SITEROOT/shop/tokens.bml?show=incoming&page=$page";
             },
         );
+        
+        LJ::need_var($paging_params{js_params});
+
     }
 
     if ($show_tab =~ /reserved/) {
@@ -175,6 +192,8 @@
                 return "$LJ::SITEROOT/shop/tokens.bml?show=reserved&page=$page";
             },
         );
+        
+        LJ::need_var($paging_params{js_params});
     }
 
 

Modified: trunk/cgi-bin/LJ/Widget/Shop.pm
===================================================================
--- trunk/cgi-bin/LJ/Widget/Shop.pm	2012-08-16 14:45:23 UTC (rev 12484)
+++ trunk/cgi-bin/LJ/Widget/Shop.pm	2012-08-17 12:20:25 UTC (rev 12485)
@@ -481,16 +481,20 @@
     my $pagecount    = $args{'pagecount'};
     my $cb_page_link = $args{'cb_page_link'};
 
+    my $js_params;
+
     return () unless $pagecount > 1;
 
     my %ret = ( "${prefix}show_paging" => 1 );
 
     if ( $pagenum > 1 ) {
         $ret{"${prefix}previous_page"} = $cb_page_link->( $pagenum - 1 );
+        $js_params->{"${prefix}previous_page"} = $pagenum - 1;
     }
 
     if ( $pagenum < $pagecount ) {
         $ret{"${prefix}next_page"} = $cb_page_link->( $pagenum + 1 );
+        $js_params->{"${prefix}next_page"} = $pagenum + 1;
     }
 
     my $start_page = $pagenum - 1;
@@ -498,6 +502,7 @@
         $start_page = 1;
     } else {
         $ret{"${prefix}first_page"} = $cb_page_link->(1);
+        $js_params->{"${prefix}first_page"} = 1;
     }
 
     my $end_page = $pagenum + 1;
@@ -506,6 +511,7 @@
     } else {
         $ret{"${prefix}last_page"} = $cb_page_link->($pagecount);
         $ret{"${prefix}last_page_num"} = $pagecount;
+        $js_params->{"${prefix}last_page"} = $pagecount;
     }
 
     if ( $end_page - $start_page <= 1 ) {
@@ -518,6 +524,10 @@
         }
     }
 
+    $js_params->{"${prefix}page_current"} = $pagenum;
+    $js_params->{"${prefix}start_page"} = $start_page;
+    $js_params->{"${prefix}end_page"} = $end_page;
+
     my @pages_display;
     foreach my $page ( $start_page .. $end_page ) {
         push @pages_display, {
@@ -527,7 +537,9 @@
         };
     }
     $ret{"${prefix}pages"} = \@pages_display;
-
+    
+    $ret{"js_params"} = $js_params;
+    
     return %ret;
 }
 

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