wisest owl (wisest_owl) wrote in changelog,
wisest owl
wisest_owl
changelog

[ljcom] r9626: LJSUP-7177. We should display sponsored ...

Committer: gprochaev
LJSUP-7177. We should display sponsored vgifts on the top of the shop

U   trunk/cgi-bin/LJ/Widget/Shop/View/VGifts.pm
Modified: trunk/cgi-bin/LJ/Widget/Shop/View/VGifts.pm
===================================================================
--- trunk/cgi-bin/LJ/Widget/Shop/View/VGifts.pm	2010-10-18 04:04:37 UTC (rev 9625)
+++ trunk/cgi-bin/LJ/Widget/Shop/View/VGifts.pm	2010-10-18 05:13:08 UTC (rev 9626)
@@ -136,10 +136,18 @@
         push @tmp, $vgift;
     }
 
-    @shown_vgifts = sort {
-        $a->sort_value cmp $b->sort_value
-    } @tmp;
+    my @sponsored = grep { $_->{is_sponsored} } @tmp;
+    my @not_sponsored = grep { !$_->{is_sponsored} } @tmp;
 
+    @shown_vgifts = (
+        ( sort {
+            $a->sort_value cmp $b->sort_value
+        } @sponsored ),
+        ( sort {
+            $a->sort_value cmp $b->sort_value
+        } @not_sponsored )
+    );
+
     # let's now translate vgift objects to parameters the template accepts
     my @vgift_params;
     foreach my $vgift (@shown_vgifts) {

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