2heoh (2heoh) wrote in changelog,
2heoh
2heoh
changelog

[livejournal] r20502: LJM-1948: m.livejournal.com Polls: vote ...

Committer: slobin
LJM-1948: m.livejournal.com Polls: vote and view results

M cgi-bin/LJ/Entry.pm
M cgi-bin/LJ/Poll.pm
M htdocs/poll/index.bml
U   trunk/cgi-bin/LJ/Entry.pm
U   trunk/cgi-bin/LJ/Poll.pm
U   trunk/htdocs/poll/index.bml
Modified: trunk/cgi-bin/LJ/Entry.pm
===================================================================
--- trunk/cgi-bin/LJ/Entry.pm	2011-11-09 08:50:03 UTC (rev 20501)
+++ trunk/cgi-bin/LJ/Entry.pm	2011-11-09 09:06:07 UTC (rev 20502)
@@ -243,6 +243,12 @@
     return $url;
 }
 
+sub mobile_url {
+    my $self = shift;
+    my $u = $self->{u};    
+    return "http://m.$LJ::DOMAIN/read/user/".$u->user.'/'. $self->ditemid;
+}
+
 sub anum {
     my $self = shift;
     return $self->{anum} if defined $self->{anum};

Modified: trunk/cgi-bin/LJ/Poll.pm
===================================================================
--- trunk/cgi-bin/LJ/Poll.pm	2011-11-09 08:50:03 UTC (rev 20501)
+++ trunk/cgi-bin/LJ/Poll.pm	2011-11-09 09:06:07 UTC (rev 20502)
@@ -1059,6 +1059,13 @@
 #   qid  => show a specific question
 #   page => page #
 #   widget => true if rendering must be short
+#
+# found call places:
+#  - LJ/Widget/PollOfTheDay.pm 
+#  - LJ/Poll.pm
+#  - htdocs/poll/index.bml
+#  - htdocs/community/election.bml
+#
 sub render {
     my ($self, %opts) = @_;
 
@@ -1803,21 +1810,22 @@
         $posted = '';
 
         my $type  = $q->type;
-        my $items = $q->get_items(do_form => $do_form);
+        my $items = $q->get_items(
+            do_form => $do_form, 
+            widget => $opts{widget}
+        );
 
         $type    = $items->[0]{type}
             if $items->[0] && $items->[0]{type};
 
-        my %stats = %{$q->stats()};
-
         push @questions, {
             text    => $text,
             type    => $type,
             qid     => $qid,
             posterid=> $self->posterid,
             pagesize=> $pagesize,
-            items   => $items,
-            %stats
+            items   => $items,  
+            %{$q->stats()}
         };    
 
     }
@@ -2028,7 +2036,7 @@
         my $poll = LJ::Poll->new($pollid);
         return "[Error: Invalid poll ID $pollid]" unless $poll && $poll->valid;
 
-        return ($viewpoll ? $poll->get_poll_xml(viewer => $opts{viewer}) : $poll->render);
+        return ($viewpoll ? $poll->get_poll_xml(viewer => $opts{viewer}) : $poll->render_new);
     };
 
     $$entryref =~ s/<lj-poll-(\d+)>/$expand->($1, $getpolls)/eg;

Modified: trunk/htdocs/poll/index.bml
===================================================================
--- trunk/htdocs/poll/index.bml	2011-11-09 08:50:03 UTC (rev 20501)
+++ trunk/htdocs/poll/index.bml	2011-11-09 09:06:07 UTC (rev 20502)
@@ -136,7 +136,7 @@
         return BML::redirect($entry->url);
     }
 
-    $body .= $poll->render(mode => $mode, qid => $FORM{qid},
+    $body .= $poll->render_new(mode => $mode, qid => $FORM{qid},
                 page => $FORM{page}, pagesize => $FORM{pagesize});
     return;
 }

Tags: 2heoh, bml, livejournal, pm, slobin
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