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

[livejournal] r18317: LJSUP-7970. Link to the Owner Election

Committer: gprochaev
LJSUP-7970. Link to the Owner Election

U   trunk/bin/upgrading/en.dat
U   trunk/htdocs/community/members.bml
U   trunk/htdocs/userinfo.bml
Modified: trunk/bin/upgrading/en.dat
===================================================================
--- trunk/bin/upgrading/en.dat	2011-02-16 07:36:47 UTC (rev 18316)
+++ trunk/bin/upgrading/en.dat	2011-02-16 07:59:39 UTC (rev 18317)
@@ -49,6 +49,7 @@
 comment.ban.user=Ban %username% from commenting
 comment.mark.spam=Mark this comment as spam
  
+community.election.owner.election.link=The owner of the [[community]] community is not selected yet. You can <a [[href]]>vote for owner here</a>.
 
 contentflag.viewingconcepts|staleness=1
 contentflag.viewingconcepts=You are about to view content that may not be appropriate for minors.
@@ -4716,6 +4717,8 @@
 
 userpic.text=[[user]], this is what you currently look like to your friends: [[empty]]<br />Boooring. Be classy and upload a [[link]].
 
+userinfo.admins.owner.election.link=Not appointed yet. You can <a [[href]]>vote for owner here</a>.
+
 vertical.nav.explore.culture|staleness=1
 vertical.nav.explore.culture=Culture
 

Modified: trunk/htdocs/community/members.bml
===================================================================
--- trunk/htdocs/community/members.bml	2011-02-16 07:36:47 UTC (rev 18316)
+++ trunk/htdocs/community/members.bml	2011-02-16 07:59:39 UTC (rev 18317)
@@ -624,6 +624,24 @@
                 );
 
         $ret .= LJ::html_submit('select_as_sm', BML::ml('.set.user_to_supermaintainer')) . "<br/>";
+    } else {
+        my $poll_id = $c->prop('election_poll_id');
+        my $super_maintainers = LJ::load_rel_user_cache($c->userid, 'S') || [];
+        if ($poll_id && !scalar @$super_maintainers) {
+            my $show_owner = 0;
+            if ($poll_id) {
+                my $poll = LJ::Poll->new ($poll_id);
+                my @q = $poll->questions;
+                my @items = @q ? $q[0]->items : ();
+                foreach my $item (@items) {
+                    $show_owner = 1 if $item->{item} =~ m#<lj user='$remote->{user}'>#;
+                }
+            }
+            $ret .= "<br>" . LJ::Lang::ml('community.election.owner.election.link', { 
+                                    community   => LJ::ljuser($c), 
+                                    href        => "href='$LJ::SITEROOT/community/election.bml?authas=$c->{user}'"
+                            }) . "<br>";
+        }
     }
 
     # jump to user

Modified: trunk/htdocs/userinfo.bml
===================================================================
--- trunk/htdocs/userinfo.bml	2011-02-16 07:36:47 UTC (rev 18316)
+++ trunk/htdocs/userinfo.bml	2011-02-16 07:59:39 UTC (rev 18317)
@@ -1161,10 +1161,29 @@
             $body .= "</div>";
             $body .= "<div class='section_body'>";
 
-            if (scalar @$super_maintainers) {
+            my $poll_id = $u->prop('election_poll_id');
+            my $show_owner = 0;
+            if ($poll_id) {
+                my $poll = LJ::Poll->new ($poll_id);
+                my @q = $poll->questions;
+                my @items = @q ? $q[0]->items : ();
+                foreach my $item (@items) {
+                    $show_owner = 1 if $item->{item} =~ m#<lj user='$remote->{user}'>#;
+                }
+            }
+            $show_owner &&= $poll_id || scalar @$super_maintainers;
+            if ($show_owner) {
                 $body .= "<p class='inner_section_header first'><span class='expandcollapse on' id='smaints_header'>" . $arrowimg->("smaints") .
                          " $ML{'.label.super_maintainers'}:</span></p>";
-                $body .= "<div class='inner_section_body' id='smaints_body'>" . $listusers->([map { $userhash{$_} } @$super_maintainers], 'smaint') . "</div>";
+                $body .= "<div class='inner_section_body' id='smaints_body'>";
+                if (scalar @$super_maintainers) {
+                    $body .= $listusers->([map { $userhash{$_} } @$super_maintainers], 'smaint')
+                } else {
+                    $body .= LJ::Lang::ml('userinfo.admins.owner.election.link', {
+                                    href => "href='$LJ::SITEROOT/community/election.bml?authas=$u->{user}'" 
+                            });
+                }
+                $body .= "</div>";
             }
 
             $body .= "<p class='inner_section_header'><span class='expandcollapse on' id='maints_header'>" . $arrowimg->("maints") .

Tags: bml, dat, livejournal, 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