Снорк (nely_snork) wrote in changelog,
Снорк
nely_snork
changelog

[ljcom] r9825: LJSUP-7377: Wishlist

Committer: narefieva
LJSUP-7377: Wishlist
U   trunk/cgi-bin/LJ/Hooks/Userinfo.pm
Modified: trunk/cgi-bin/LJ/Hooks/Userinfo.pm
===================================================================
--- trunk/cgi-bin/LJ/Hooks/Userinfo.pm	2010-12-11 15:13:23 UTC (rev 9824)
+++ trunk/cgi-bin/LJ/Hooks/Userinfo.pm	2010-12-11 15:19:55 UTC (rev 9825)
@@ -278,19 +278,32 @@
     }
 
     my $wishes = LJ::WishList->load_profile($u);
-    if (scalar @$wishes) {
+    if (@$wishes) {
         my $ulink = $u->journal_base;
         if ($with_header) {
             $$r .= "<div class='section$extra_section_class'><span class='expandcollapse on' id='wished_header'>";
             $$r .= "<img id='wishes_arrow' src='$LJ::IMGPREFIX/profile_icons/arrow-down.gif' align='absmiddle' /> " . LJ::Lang::ml('ljcom.userinfo.wishes.header');
             $$r .= "</span> <span class='section_link'>[<a href='$ulink/wishlist'>" . LJ::Lang::ml('ljcom.userinfo.wishes.viewall') . "</a>]</span></div>";
             $$r .= "\n<div class='section_body' id='wishes_body'>";
-			$$r .= "\n<ul class='b-wishes-list'>";
+            $$r .= "\n<p class='i-nav'><i class='i-nav-prev'></i><i class='i-nav-next i-nav-next-dis'></i></p>";
+			$$r .= "\n<div class='b-wishes-profile'><ul class='b-wishes-list'>";
         } else {
             $$r .= "<div style='float: left; margin-top: 1em'>";
-			$$r .= "\n<ul>";
+			$$r .= "\n</div></ul>";
         }
-        $$r .= LJ::JSON->to_json($wishes);
+        
+        my $template = LJ::HTML::Template->new(
+            { use_expr => 1 }, # force HTML::Template::Pro with Expr support
+            filename => "$ENV{'LJHOME'}/templates/WishList/profile.tmpl",
+            die_on_bad_params => 0,
+            strict => 0,
+        ) or die "Can't open template: $!";
+        foreach my $w (@$wishes) {
+            $w->{json} = LJ::JSON->to_json($w);
+        }
+        $template->param( wishes => $wishes);
+        $$r .= $template->output;
+        
         $$r .= "</ul>\n";
         $$r .= "<p style='font-size: .9em; white-space: nowrap'><a href='$ulink/wishlist'>" . LJ::Lang::ml('ljcom.userinfo.wishes.viewall') . " . </a></p>" unless $with_header;
         $$r .= "</div>\n";

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