Committer: dnikolaev
LJSUP-11266: Users should be able to adjust rating (disable users and entries)U trunk/cgi-bin/LJ/Widget/HomepageRU.pm
Modified: trunk/cgi-bin/LJ/Widget/HomepageRU.pm =================================================================== --- trunk/cgi-bin/LJ/Widget/HomepageRU.pm 2012-07-19 12:51:39 UTC (rev 12319) +++ trunk/cgi-bin/LJ/Widget/HomepageRU.pm 2012-07-19 13:02:57 UTC (rev 12320) @@ -128,9 +128,9 @@ my $rating_top_journals_sort = LJ::Request->cookie('rating_top_journals_sort'); $rating_top_journals_sort = 'visitors' unless defined $rating_top_journals_sort; - my $rating_use_custom = LJ::Request->cookie('rating_use_custom'); - $rating_use_custom = 1 unless defined $rating_use_custom; - $rating_use_custom = ( $rating_use_custom ? 1 : 0 ); + my $rating_show_custom = LJ::Request->cookie('rating_show_custom'); + $rating_show_custom = 1 unless defined $rating_show_custom; + $rating_show_custom = ( $rating_show_custom ? 1 : 0 ); if (defined $GET->{'rating'}) { my %get_rating = map { lc($_) => 1 } split /\s+/, $GET->{'rating'}; @@ -143,10 +143,10 @@ } if ($get_rating{'custom'}) { - $rating_use_custom = 1; + $rating_show_custom = 1; } elsif ($get_rating{'all'}) { - $rating_use_custom = 0; + $rating_show_custom = 0; } if ($get_rating{'authority'}) { @@ -164,7 +164,7 @@ 'filter_commpromo' => 1, 'filter_selfpromo' => 1, 'filter_featured' => 0, - 'filter_blacklist' => $rating_use_custom, + 'filter_blacklist' => $rating_show_custom, } ); $result{personalstats} = $entries_top->template_output( { @@ -178,18 +178,18 @@ 'what' => 'users', 'sort' => $rating_top_journals_sort, # 'country' => ???, # do not define 'country', use default value - 'filter_blacklist' => $rating_use_custom, + 'filter_blacklist' => $rating_show_custom, 'output' => $output, ); $result{widget_ratingtop10_comms} = LJ::Widget::RatingTopJournals->render( 'what' => 'communities', 'sort' => $rating_top_journals_sort, - 'filter_blacklist' => $rating_use_custom, + 'filter_blacklist' => $rating_show_custom, 'output' => $output, ); - LJ::Request->set_cookie('rating_use_custom' => $rating_use_custom, 'expires' => time + 60*60*24*180); + LJ::Request->set_cookie('rating_show_custom' => $rating_show_custom, 'expires' => time + 60*60*24*180); LJ::Request->set_cookie('rating_top_journals_sort' => $output->{'sort'}, 'expires' => time + 60*60*24*180); }