Committer: afedorov
OPSC-305: Create "My games" link in user menu for non-cyr usersU trunk/cgi-bin/LJ/S2/DayPage.pm U trunk/cgi-bin/LJ/S2/EntryPage.pm U trunk/cgi-bin/LJ/S2/FriendsPage.pm U trunk/cgi-bin/LJ/S2/MonthPage.pm U trunk/cgi-bin/LJ/S2/RecentPage.pm U trunk/cgi-bin/LJ/S2/ReplyPage.pm U trunk/cgi-bin/LJ/S2/TagsPage.pm U trunk/cgi-bin/LJ/S2/YearPage.pm
Modified: trunk/cgi-bin/LJ/S2/DayPage.pm =================================================================== --- trunk/cgi-bin/LJ/S2/DayPage.pm 2011-03-02 10:10:05 UTC (rev 18434) +++ trunk/cgi-bin/LJ/S2/DayPage.pm 2011-03-02 10:16:52 UTC (rev 18435) @@ -5,6 +5,7 @@ package LJ::S2; use LJ::TimeUtil; +use LJ::UserApps; sub DayPage { @@ -15,6 +16,8 @@ $p->{'view'} = "day"; $p->{'entries'} = []; + $p->{'view_my_games'} = $remote && $remote->equals($u) && !LJ::SUP->is_remote_sup() && LJ::UserApps->user_games_count($remote); + my $user = $u->{'user'}; my $journalbase = LJ::journal_base($user, $opts->{'vhost'}); Modified: trunk/cgi-bin/LJ/S2/EntryPage.pm =================================================================== --- trunk/cgi-bin/LJ/S2/EntryPage.pm 2011-03-02 10:10:05 UTC (rev 18434) +++ trunk/cgi-bin/LJ/S2/EntryPage.pm 2011-03-02 10:16:52 UTC (rev 18435) @@ -5,6 +5,7 @@ package LJ::S2; use LJ::TimeUtil; +use LJ::UserApps; sub EntryPage { @@ -18,6 +19,8 @@ $p->{'comments'} = []; $p->{'comment_pages'} = undef; + $p->{'view_my_games'} = $remote && $remote->equals($u) && !LJ::SUP->is_remote_sup() && LJ::UserApps->user_games_count($remote); + # setup viewall options my ($viewall, $viewsome) = (0, 0); if ($get->{viewall} && LJ::check_priv($remote, 'canview', 'suspended')) { Modified: trunk/cgi-bin/LJ/S2/FriendsPage.pm =================================================================== --- trunk/cgi-bin/LJ/S2/FriendsPage.pm 2011-03-02 10:10:05 UTC (rev 18434) +++ trunk/cgi-bin/LJ/S2/FriendsPage.pm 2011-03-02 10:16:52 UTC (rev 18435) @@ -6,6 +6,7 @@ use Class::Autouse qw/LJ::ContentFlag/; use LJ::Request; use LJ::TimeUtil; +use LJ::UserApps; sub FriendsPage { @@ -24,6 +25,8 @@ $p->{'filter_active'} = 0; $p->{'filter_name'} = ""; + $p->{'view_my_games'} = $remote && $remote->equals($u) && !LJ::SUP->is_remote_sup() && LJ::UserApps->user_games_count($remote); + # Add a friends-specific XRDS reference $p->{'head_content'} .= qq{<meta http-equiv="X-XRDS-Location" content="}.LJ::ehtml($u->journal_base).qq{/data/yadis/friends" />\n}; Modified: trunk/cgi-bin/LJ/S2/MonthPage.pm =================================================================== --- trunk/cgi-bin/LJ/S2/MonthPage.pm 2011-03-02 10:10:05 UTC (rev 18434) +++ trunk/cgi-bin/LJ/S2/MonthPage.pm 2011-03-02 10:16:52 UTC (rev 18435) @@ -5,6 +5,7 @@ package LJ::S2; use LJ::TimeUtil; +use LJ::UserApps; sub MonthPage { @@ -17,6 +18,8 @@ $p->{'view'} = "month"; $p->{'days'} = []; + $p->{'view_my_games'} = $remote && $remote->equals($u) && !LJ::SUP->is_remote_sup() && LJ::UserApps->user_games_count($remote); + my $ctx = $opts->{'ctx'}; my $dbcr = LJ::get_cluster_reader($u); Modified: trunk/cgi-bin/LJ/S2/RecentPage.pm =================================================================== --- trunk/cgi-bin/LJ/S2/RecentPage.pm 2011-03-02 10:10:05 UTC (rev 18434) +++ trunk/cgi-bin/LJ/S2/RecentPage.pm 2011-03-02 10:16:52 UTC (rev 18435) @@ -1,6 +1,8 @@ use strict; package LJ::S2; +use LJ::UserApps; + sub RecentPage { my ($u, $remote, $opts) = @_; @@ -27,6 +29,8 @@ my $friendsurl = $u->journal_base."/friends"; # We want the canonical form here, not the vhost form $p->{head_content} .= '<link rel="'.$rel.'" title="'.LJ::ehtml($friendstitle).'" href="'.LJ::ehtml($friendsurl)."\" />\n"; } + + $p->{'view_my_games'} = $remote && $remote->equals($u) && !LJ::SUP->is_remote_sup() && LJ::UserApps->user_games_count($remote); my $user = $u->{'user'}; my $journalbase = LJ::journal_base($user, $opts->{'vhost'}); Modified: trunk/cgi-bin/LJ/S2/ReplyPage.pm =================================================================== --- trunk/cgi-bin/LJ/S2/ReplyPage.pm 2011-03-02 10:10:05 UTC (rev 18434) +++ trunk/cgi-bin/LJ/S2/ReplyPage.pm 2011-03-02 10:16:52 UTC (rev 18435) @@ -4,6 +4,7 @@ use strict; package LJ::S2; use LJ::TimeUtil; +use LJ::UserApps; sub ReplyPage { @@ -17,6 +18,8 @@ $p->{'_type'} = "ReplyPage"; $p->{'view'} = "reply"; + $p->{'view_my_games'} = $remote && $remote->equals($u) && !LJ::SUP->is_remote_sup() && LJ::UserApps->user_games_count($remote); + my $get = $opts->{'getargs'}; my ($entry, $s2entry) = EntryPage_entry($u, $remote, $opts); Modified: trunk/cgi-bin/LJ/S2/TagsPage.pm =================================================================== --- trunk/cgi-bin/LJ/S2/TagsPage.pm 2011-03-02 10:10:05 UTC (rev 18434) +++ trunk/cgi-bin/LJ/S2/TagsPage.pm 2011-03-02 10:16:52 UTC (rev 18435) @@ -1,6 +1,8 @@ use strict; package LJ::S2; +use LJ::UserApps; + sub TagsPage { my ($u, $remote, $opts) = @_; @@ -10,6 +12,8 @@ $p->{'view'} = "tags"; $p->{'tags'} = []; + $p->{'view_my_games'} = $remote && $remote->equals($u) && !LJ::SUP->is_remote_sup() && LJ::UserApps->user_games_count($remote); + my $user = $u->{'user'}; my $journalbase = LJ::journal_base($user, $opts->{'vhost'}); Modified: trunk/cgi-bin/LJ/S2/YearPage.pm =================================================================== --- trunk/cgi-bin/LJ/S2/YearPage.pm 2011-03-02 10:10:05 UTC (rev 18434) +++ trunk/cgi-bin/LJ/S2/YearPage.pm 2011-03-02 10:16:52 UTC (rev 18435) @@ -5,6 +5,7 @@ package LJ::S2; use LJ::TimeUtil; +use LJ::UserApps; sub YearPage { @@ -14,6 +15,8 @@ $p->{'_type'} = "YearPage"; $p->{'view'} = "archive"; + $p->{'view_my_games'} = $remote && $remote->equals($u) && !LJ::SUP->is_remote_sup() && LJ::UserApps->user_games_count($remote); + my $user = $u->{'user'}; if ($u->should_block_robots) {