Committer: akanashin
LJSUP-12319: We need to display social capital for users which turn off RatingsU trunk/htdocs/tools/endpoints/ctxpopup.bml U trunk/htdocs/userinfo.bml
Modified: trunk/htdocs/tools/endpoints/ctxpopup.bml =================================================================== --- trunk/htdocs/tools/endpoints/ctxpopup.bml 2012-05-28 10:58:31 UTC (rev 22075) +++ trunk/htdocs/tools/endpoints/ctxpopup.bml 2012-05-28 11:28:42 UTC (rev 22076) @@ -138,12 +138,14 @@ if (ref $position eq 'HASH' && ( $u->journaltype eq 'C' || LJ::SUP->is_sup_enabled($u) )) { $first = $position->{result}->{position}!=0 ? 0 : 1; - $soc_capital = int($soc_capital->{result}->{authority}/1000); - $soc_capital = $soc_capital < 10 ? BML::ml('.social_capital_less_that') : LJ::commafy($soc_capital); + } - $ret{first} = $first; - $ret{value} = $soc_capital; - } + $soc_capital = int($soc_capital->{result}->{authority}/1000); + $soc_capital = $soc_capital < 10 ? BML::ml('.social_capital_less_that') : LJ::commafy($soc_capital); + + $ret{first} = $first; + $ret{value} = $soc_capital; + } if ( $remote ) { Modified: trunk/htdocs/userinfo.bml =================================================================== --- trunk/htdocs/userinfo.bml 2012-05-28 10:58:31 UTC (rev 22075) +++ trunk/htdocs/userinfo.bml 2012-05-28 11:28:42 UTC (rev 22076) @@ -694,9 +694,6 @@ if (ref $position eq 'HASH' && ( $u->journaltype eq 'C' || LJ::SUP->is_sup_enabled($u) )) { $soc_image = "<img src='$LJ::IMGPREFIX/profile_icons/" . ($position->{result}->{position}!=0 ? 'social-capital.png?v=17298' : 'korona.png?v=17319') . "'/>"; - $soc_capital = LJ::PersonalStats::DB->fetch_raw('ratings', {func => 'get_authority', journal_id => $u->userid}); - $soc_capital = int($soc_capital->{result}->{authority}/1000); - $soc_capital = $soc_capital < 10 ? ' <10 ' : LJ::commafy($soc_capital); my $country = LJ::SUP->is_sup_enabled($u) ? 'cyr' : 'noncyr'; $body .= "<li class='rating-place'>" . $diagram_image . @@ -707,9 +704,6 @@ } if (ref $ua_position eq 'HASH') { $soc_image = "<img src='$LJ::IMGPREFIX/profile_icons/" . ($ua_position->{result}->{position}!=0 ? 'social-capital.png?v=17298' : 'korona.png?v=17319') . "'/>"; - $soc_capital = LJ::PersonalStats::DB->fetch_raw('ratings', {func => 'get_authority', journal_id => $u->userid}); - $soc_capital = int($soc_capital->{result}->{authority}/1000); - $soc_capital = $soc_capital < 10 ? ' <10 ' : LJ::commafy($soc_capital); $body .= "<li class='rating-place'>" . $diagram_image . LJ::Lang::ml($ua_href_rating, {rating_place => LJ::commafy($ua_position->{result}->{position}+1), @@ -717,6 +711,11 @@ "?country=ua&askname=" . $u->username . "#ask_position"}) . "</li>"; } + + $soc_capital = LJ::PersonalStats::DB->fetch_raw('ratings', {func => 'get_authority', journal_id => $u->userid}); + $soc_capital = int($soc_capital->{result}->{authority}/1000); + $soc_capital = $soc_capital < 10 ? ' <10 ' : LJ::commafy($soc_capital); + if ((ref $ua_position eq 'HASH') || (ref $position eq 'HASH' && ( $u->journaltype eq 'C' || LJ::SUP->is_sup_enabled($u)))) { $body .= "<li class='rating-social-capital'>" . $soc_image .