alf (red_alf) wrote in changelog,
alf
red_alf
changelog

[ljcom] r9891: LJSUP-7686: Add template for htdocs/inde...

Committer: afedorov
LJSUP-7686: Add template for htdocs/index.bml

A   trunk/cgi-bin/LJ/Widget/HomepageEN.pm
U   trunk/htdocs/index.bml
A   trunk/templates/Homepage/
A   trunk/templates/Homepage/index_en.tmpl
Added: trunk/cgi-bin/LJ/Widget/HomepageEN.pm
===================================================================
--- trunk/cgi-bin/LJ/Widget/HomepageEN.pm	                        (rev 0)
+++ trunk/cgi-bin/LJ/Widget/HomepageEN.pm	2010-12-30 05:01:05 UTC (rev 9891)
@@ -0,0 +1,169 @@
+package LJ::Widget::HomepageEN;
+
+use strict;
+use base qw(LJ::Widget);
+use Carp qw(croak);
+
+use LJ::PersonalStats;
+use LJ::TimeUtil;
+
+sub get_page_params {
+    my $class = shift;
+    my %opts = @_;
+
+    my $GET = $opts{GET};
+
+    LJ::need_res('stc/lj_base.css', 'stc/home.css');
+    LJ::need_res('stc/home-halloween08.css') if LJ::is_enabled("halloween08_display");
+    LJ::need_res('stc/statistics/statistics.css') if LJ::is_enabled('personal_stats_ratings');
+    LJ::need_res('js/stats.js') if LJ::is_enabled('personal_stats_ratings');
+    LJ::need_res({condition => 'IE'}, 'stc/statistics/ie.css') if LJ::is_enabled('personal_stats_ratings');
+    LJ::need_res('stc/widgets/index-stats.css') unless LJ::is_enabled('personal_stats_ratings');
+
+    my %result = (
+        domain        => $LJ::DOMAIN,
+        siteroot      => $LJ::SITEROOT,
+        sitenameshort => $LJ::SITENAMESHORT,
+    );
+    
+    ## Remote user
+    my $remote = LJ::get_remote();
+    if ( $remote ) {
+        $result{remote} = 1;
+        $result{remote_display_username} = $remote->display_username;
+        
+        ## Get the last updated time of $remote
+        my $secondsago = time() - $remote->timeupdate;
+        $result{lastupdated} = LJ::TimeUtil->ago_text($secondsago);
+    }
+    
+    ## Error Bar
+    if ($GET->{returnto} || $GET->{errmsg}) {
+        $result{errorbar} = '';
+        $result{errorbar} .= BML::ml('.loggedout.' . LJ::ehtml($GET->{errmsg})) . ' '
+            if $GET->{errmsg};
+        $result{errorbar} .= BML::ml('.loggedout.loginnote') 
+            if $GET->{returnto};
+    }
+
+    ## Meta tags
+    $result{meta} = '
+        <meta name="description" content="' . LJ::ehtml(BML::ml('.meta.desc')) . '" />
+        <meta name="keywords" content="' . LJ::ehtml(BML::ml('.meta.keywords')) . '" />
+        <meta name="rating" content="General" />
+        <meta name="ROBOTS" content="All" />
+        <meta name="revisit-after" content="14 days" />
+    ';
+
+    ## Window Title
+    $result{windowtitle} = $remote ?
+        BML::ml('.windowtitle.loggedin', {'sitename' => $LJ::SITENAME}) :
+        BML::ml('.windowtitle', {'sitename' => $LJ::SITENAME});
+
+    ## Title
+    $result{title} = $remote ? 
+                     BML::ml('.loggedin.heading2', {'user' => $remote->display_username}) :
+                     '';
+
+    ## ADS
+    $result{adt} = LJ::get_ads({ location => 'bml.homepage.top', nowrap => 1 });
+    $result{ad}  = LJ::get_ads({ location => 'bml.homepage', ljadwrapper => 1 }) .
+                   LJ::get_ads({ location => 'bml.homepage.test.top', nowrap => 1 })
+                    if !$remote || !$remote->in_class('paid') || $remote->in_class('force_ads');
+
+    ## News
+    my $news = LJ::load_user('news');
+    if ($news) {
+        $result{news} = 1;
+        $result{news_journal_base} = $news->journal_base;
+        $result{news_href} = 'href="'.$news->journal_base.'/"';
+        $result{news_ljuser_display} = $news->ljuser_display;
+    }
+    
+    ## Country blocks
+    $result{country} = LJ::GeoLocation->get_country_info_by_ip;
+    $result{uk_block} = 
+        (    
+            ## viewer is from UK
+            ($result{country} eq 'UK' || $result{country} eq 'GB') && 
+            ## and viewer is either anonymous, or plus (non-paid/perm/sponsored and non-basic) account
+            (!$remote || $remote->in_class('force_ads') || !$remote->get_cap('paid') && $remote->in_class('plus'))
+        ) ? 
+        LJ::Widget::ExtBlock->render(id=>'homepage.uk') : '';
+
+    ## Info box
+    $result{info_box} = 
+        (
+            LJ::SUP->is_sup_ip_class && 
+            !($remote and $remote->get_cap('paid'))
+        ) ?
+        LJ::Widget::ExtBlock->render(id=>'homepage.gazeta') : '';
+
+    ## Widget SUP1MillionPromo
+    $result{widget_sup1millionpromo} = LJ::Widget::SUP1MillionPromo->render;
+    
+    ## Widget TopEntries (spotlight and ontd)
+    $result{widget_topentries_hmp_spotlight} = LJ::Widget::TopEntries->render(domain => 'hmp_spotlight');
+    $result{widget_topentries_hmp_ontd} = LJ::Widget::TopEntries->render(domain => 'hmp_ontd');
+    
+    ## Widget QotD
+    
+    $result{widget_qotd} = $remote ? 
+        LJ::Widget::QotD->render( domain => "homepage" ) :
+        LJ::Widget::QotD->render( stylesheet => "stc/widgets/qotd-loggedout.css", domain => "homepage" );
+
+    ## Widget GameList
+    $result{widget_gamelist} = LJ::Widget::GameList->render 
+        unless $LJ::DISABLED{'userapps'};
+
+    ## Widget PromoText
+    $result{widget_promotext} = LJ::Widget::PromoText->render( domain => "mini" );
+
+    ## Widget JournalSpotlight
+    $result{widget_journalspotlight} = $remote ? 
+        LJ::Widget::JournalSpotlight->render( stylesheet_override => 'stc/widgets/journalspotlight-home.css' ) :
+        LJ::Widget::JournalSpotlight->render( stylesheet_override => 'stc/widgets/journalspotlight.css', spotlight_comm_in_header => 0 );
+
+    ## Widget RecentComments
+    $result{widget_recentcomments} = LJ::Widget::RecentComments->render;
+
+    ## Widget SearchJournals
+    $result{widget_searchjournals} = LJ::Widget::SearchJournals->render;
+    
+    ## Widget News
+    $result{widget_news} = LJ::Widget::News->render();
+    
+    ## Widget MarqueeFeatures
+    $result{widget_marqueefeatures} = LJ::Widget::MarqueeFeatures->render();
+
+    ## Widget Photos2Homepage
+    $result{widget_photos2homepage} = LJ::Widget::Photos2Homepage->render();
+    
+    ## Widget PollOfTheDay
+    $result{widget_polloftheday} = LJ::Widget::PollOfTheDay->render;
+
+    ## Widget VGifts
+    $result{widget_vgifts} = LJ::Widget::VGifts->render(get => $GET);
+    $result{vgift_on_homepage_unlogged_nonsup} = LJ::is_enabled('vgift_on_homepage_unlogged_nonsup');
+
+    ## Widget UpdatesForUser
+    $result{widget_updatesforuser} = LJ::Widget::UpdatesForUser->render;
+
+    ## Widget FeaturedStyles
+    $result{widget_featuredstyles} = LJ::Widget::FeaturedStyles->render(get => $GET) 
+        unless $LJ::DISABLED{'featured_styles'};
+
+    ## Widget SettingProdDisplay
+    $result{widget_settingproddisplay} = LJ::Widget::SettingProdDisplay->render;
+
+    ## Widget PublicStats
+    $result{widget_publicstats} = LJ::Widget::PublicStats->render( show_latest_posts => 0, short_numbers => 1 );
+
+    ## Strings
+    $result{string_loggedout_facts_open} = BML::ml('.loggedout.facts.open', { aopts => "href='http://www.livejournal.org/'" });
+    $result{string_loggedout_facts_volunteer} = BML::ml('.loggedout.facts.volunteer', { aopts => "href='$LJ::HELPURL{how_to_help}'", sitename => $LJ::SITENAMEABBREV });
+
+    return %result;
+}
+
+1;

Modified: trunk/htdocs/index.bml
===================================================================
--- trunk/htdocs/index.bml	2010-12-24 11:25:41 UTC (rev 9890)
+++ trunk/htdocs/index.bml	2010-12-30 05:01:05 UTC (rev 9891)
@@ -3,397 +3,28 @@
 <?_code
 {
     use strict;
-    use vars qw(%GET %POST $title $headextra $meta @errors @warnings);
+    use LJ::HTML::Template;
 
-    use LJ::PersonalStats;
-    use LJ::TimeUtil;
+    use vars qw(%GET %POST %result);
 
-    LJ::need_res('stc/lj_base.css', 'stc/home.css');
-    LJ::need_res('stc/widgets/index-stats.css') unless LJ::is_enabled('personal_stats_ratings');
-    LJ::need_res('stc/statistics/statistics.css') if LJ::is_enabled('personal_stats_ratings');
-    LJ::need_res('js/stats.js') if LJ::is_enabled('personal_stats_ratings');
-    LJ::need_res('stc/home-halloween08.css') if LJ::is_enabled("halloween08_display");
-    $meta .= qq{
-    <meta name="description" content="$ML{'.meta.desc'}" />
-    <meta name="keywords" content="$ML{'.meta.keywords'}" />
-    <meta name="rating" content="General" />
-    <meta name="ROBOTS" content="All" />
-    <meta name="revisit-after" content="14 days" />
-    };
-    LJ::need_res({condition => 'IE'}, 'stc/statistics/ie.css') if LJ::is_enabled('personal_stats_ratings');
+    %result = LJ::Widget::HomepageEN->get_page_params( GET => \%GET );
+    
+    my $template = LJ::HTML::Template->new(
+	{ use_expr => 1 }, # force HTML::Template::Pro with Expr support
+        filename => "$ENV{'LJHOME'}/templates/Homepage/index_en.tmpl",
+        die_on_bad_params => 0,
+        case_sensitive    => 1,
+    ) or die "Can't open template: $!";
 
-    my $remote = LJ::get_remote();
-    my $ad = LJ::get_ads({ location => 'bml.homepage', ljadwrapper => 1 }) .
-             LJ::get_ads({ location => 'bml.homepage.test.top', nowrap => 1 });
-    my $adt = LJ::get_ads({ location => 'bml.homepage.top', nowrap => 1 }); 
-    my $goat_img = $GET{'frank'} eq "urinate" ? "pee" : "hover";
-    my $news = LJ::load_user('news');
-    my $ret = "";
-
-    my $country = LJ::GeoLocation->get_country_info_by_ip;
-    my $uk_block = 
-        (    
-            ## viewer is from UK
-            ($country eq 'UK' || $country eq 'GB') && 
-            ## and viewer is either anonymous, or plus (non-paid/perm/sponsored and non-basic) account
-            (!$remote || $remote->in_class('force_ads') || !$remote->get_cap('paid') && $remote->in_class('plus'))
-        ) ? 
-        LJ::Widget::ExtBlock->render(id=>'homepage.uk') : '';
-    my $info_box = 
-        (
-            LJ::SUP->is_sup_ip_class && 
-            !($remote and $remote->get_cap('paid'))
-        ) ?
-        LJ::Widget::ExtBlock->render(id=>'homepage.gazeta') : '';
- 
-    if ($country eq 'US') {
-        $ret .= "<div id='adnectar_container'></div>
-<script type='text/javascript' src='http://goods.adnectar.com/analytics/get_avia_js?api_version=3.0.0&site_key=a9aa425c93ef5dff380c&avia_version=0.8.16'></script>";
-    }
-
-    ### Logged-in Homepage ###
-    if ($remote) {
-        $ret .= $adt;
-        $ret .= "<div class='homepage-loggedin pkg' style='padding-right: 320px;'>";
-        $ret .= "<div style='float: left; position: relative; width: 100%'>";
-        $ret .= LJ::Widget::SUP1MillionPromo->render;
-        $title = BML::ml('.loggedin.heading2', {'user' => $remote->display_username});
-        # get the last updated time of $remote
-        my $secondsago = time() - $remote->timeupdate;
-        my $lastupdated = LJ::TimeUtil->ago_text($secondsago);
-
-
-
-        # $ret .= "<div class='l-wrap l-col2-50'>";
-        # $ret .= "<div class='l-col-1'>";
-        # $ret .= LJ::Widget::TopEntries->render(domain => 'hmp_spotlight');
-        # $ret .= "</div>";
-        # $ret .= "<div class='l-col-2'>";
-        # $ret .= LJ::Widget::TopEntries->render(domain => 'hmp_ontd');
-        # $ret .= "</div>";
-        # $ret .= "</div>";
-        
-        $ret .= "<div class='homepage-account appwidget pkg b-qotd'>";
-        $ret .= "<h2><span>" . BML::ml('.loggedin.qotd.title') . "</span></h2>";
-		$ret .= qq[<ul class="i-qotd-menu"><li><a href="$LJ::SITEROOT/misc/qotdarchive.bml">$ML{'widget.qotd.archivelink'}</a></li><li><a href="$LJ::SITEROOT/misc/suggest_qotd.bml">$ML{'widget.qotd.suggestions'}</a></li><li><a href="$LJ::SITEROOT/friends/add.bml?user=writersblock">$ML{'widget.qotd.subscribe'}</a></li><li><a href="http://community.livejournal.com/wb_unplugged/">$ML{'widget.qotd.unplugged'}</a></li></ul>];
-        #$ret .= "<a href='http://community.livejournal.com/".(LJ::Widget::QotD2->community_name($remote))."/' class='more-link'>" . BML::ml('.loggedin.qotd.journal') . "</a>";
-
-        #Quick links were removed and QOTD became larger
-#        $ret .= "<div class='homepage-account-inner pkg'>";
-#        $ret .= "<div class='homepage-account-left'>";
-#        $ret .= "<ul class='nostyle'>";
-#        $ret .= "<li class='post'><a href='$LJ::SITEROOT/update.bml'>$ML{'.loggedin.greeting.post'}</a>";
-#        $ret .= "<br /><span class='detail'>";
-#        $ret .= $remote->timeupdate ?
-#                BML::ml('.loggedin.greeting.lastupdated', {'timeago' => $lastupdated}) :
-#                $ML{'.loggedin.greeting.neverupdated'};
-#        $ret .= "</span></li>";
-#        $ret .= "<li class='inbox'><a href='$LJ::SITEROOT/inbox/'>$ML{'.loggedin.greeting.inbox'}</a>";
-#        my $inbox = $remote->notification_inbox;
-#        $ret .= "<br /><span class='detail'>" . BML::ml('.loggedin.greeting.inboxcount', {'num' => $inbox->unread_count}) . "</span>"
-#            if $inbox && $inbox->unread_count;
-#        $ret .= "</li>";
-#        $ret .= "<li class='friends'><a href='" . $remote->journal_base . "/friends/'>$ML{'.loggedin.greeting.friendspage'}</a></li>";
-         # display an alert if there was a post to news in the past three days
-#        if ($news) {
-#            my $delta = time() - $news->timeupdate;
-#            if ($delta < 86400 * 3) {
-#                $ret .= "<li class='news'>" . BML::ml('.loggedin.greeting.alert', {'user' => $news->ljuser_display}) . "</li>";
-#            }
-#        }
-#        $ret .= "</ul>";
-#        $ret .= "</div><!-- end .homepage-account-left -->";
-        $ret .= "<div class='homepage-account-right'>";
-
-        $ret .= LJ::Widget::QotD->render(domain => "homepage");
-        
-        $ret .= LJ::Widget::GameList->render unless $LJ::DISABLED{'userapps'};
-
-        $ret .= "</div><!-- end .homepage-account-right -->\n";
-#        $ret .= "</div><!-- end .homepage-account-inner -->\n";
-        $ret .= "</div><!-- end .homepage-account -->\n";
-
-        $ret .= "<div class='homepage-minipromo pkg'>";
-        $ret .= LJ::Widget::PromoText->render( domain => "mini" );
-        $ret .= "</div>";
-
-        #Old Spotlight
-        $ret .= LJ::Widget::JournalSpotlight->render( stylesheet_override => 'stc/widgets/journalspotlight-home.css' );
-
-        $ret .= LJ::Widget::RecentComments->render;
-
-   	    $ret .= LJ::Widget::SearchJournals->render;
-
-        #New & Cool features widgets
-        $ret .= "<div class='l-wrap l-col2-50'>";
-        $ret .= "<div class='l-col-1'>";
-        $ret .= LJ::Widget::News->render();
-        $ret .= "</div>";
-        $ret .= "<div class='l-col-2'>";
-        $ret .= LJ::Widget::MarqueeFeatures->render();
-        $ret .= "</div>";
-        $ret .= "</div>";
-
-        #Photos2Homepage & PollOfTheDay
-        $ret .= "<div class='l-wrap l-col2-50'>";
-        $ret .= "<div class='l-col-1'>";
-        $ret .= LJ::Widget::Photos2Homepage->render();
-        $ret .= "</div>";
-        $ret .= "<div class='l-col-2'>";
-        $ret .= LJ::Widget::PollOfTheDay->render;
-        $ret .= "</div>";
-        $ret .= "</div>";        
-        
-#         $ret .= "<div class='homepage-promo pkg'>";
-#         $ret .= "<h2><span>" . BML::ml('.loggedout.promos', {'sitename' => $LJ::SITENAMESHORT}) . "</span></h2>";
-#         $ret .= LJ::Widget::PromoText->render( domain => "main", small_version => 1 );
-#         $ret .= "</div>";
-
-        $ret .= "</div>";
-        $ret .= "<div style='float: left; position: relative; width: 300px; padding-left: 20px; margin-right: -320px;'>";
-
-        # if (!$remote->in_class('paid') || $remote->in_class('force_ads')) {
-        #     my $uaw = $LJ::DISABLED{'upgrade_account'} ? '' : LJ::Widget::UpgradeAccount->render;
-        #     $ret .= (LJ::GeoLocation->ip_class() eq 'russia') ? ( $uaw . $ad ) : ( $ad . $uaw );
-        # }
-
-        $ret .= $ad if !$remote->in_class('paid') || $remote->in_class('force_ads');
-
-	   	$ret .= $uk_block;
-        
-        $ret .= $info_box;
-
-        #$ret .= LJ::Widget::FriendBirthdays->render(get => \%GET);
-
-        $ret .= LJ::Widget::VGifts->render(get => \%GET);
-
-        $ret .= LJ::Widget::UpdatesForUser->render;
-
-        $ret .= LJ::Widget::FeaturedStyles->render(get => \%GET) unless $LJ::DISABLED{'featured_styles'};
-
-        #$ret .= LJ::Widget::FriendUpdates->render;
-
-        #$ret .= LJ::Widget::GettingStarted->render( stylesheet_override => 'stc/widgets/gettingstarted-home.css' );
-
-        #$ret .= LJ::Widget::OfficialJournals->render;
-
-        #$ret .= LJ::Widget::RatingTop10->render;
-        
-        #$ret .= LJ::CProd->full_box_for($remote, width => 300);
-
-        
-
-        $ret .= "</div>";
-        $ret .= "</div><!-- end .homepage-loggedin  -->";
-        # $ret .= "<div class='homepage-loggedin-frank'>";
-        # $ret .= LJ::Widget::Frank->render( image => $goat_img );
-        # $ret .= "</div><!-- end .homepage-loggedin-frank -->";
-
-	    $ret .= LJ::Widget::SettingProdDisplay->render;
-
-    ### Logged-out Homepage ##
-    } else {
-        $ret .= "<div class='homepage-loggedout'>\n";
-        if ($GET{returnto} || $GET{errmsg}) {
-            $ret .= "<div style='margin-bottom: 10px;'><?errorbar <strong>";
-            $ret .= "$ML{'.loggedout.'.LJ::ehtml($GET{errmsg})} " if $GET{errmsg};
-            $ret .= "$ML{'.loggedout.loginnote'}" if $GET{returnto};
-            $ret .= "</strong> errorbar?></div>";
-        }
-        
-        
-#        $ret .= "<div id='homepage-features' class='columns-2 pkg'>\n";
-#        $ret .= "<div class='columns-2-left'>\n";
-#        $ret .= "<p class='intro'><strong>" . BML::ml('.loggedout.whatislj2', { sitename => $LJ::SITENAMESHORT }) . "</strong></p>\n";
-#        $ret .= "<p class='intro detail'>" . BML::ml('.loggedout.whatislj.more', { sitename => $LJ::SITENAMESHORT }) . "</p>\n";
-#        $ret .= "<a href='$LJ::SITEROOT/tour/'><img src='$LJ::IMGPREFIX/homepage-tour-icons.gif' border='0' alt=\"$ML{'.loggedout.whatislj.imgalt'}\" /></a>";
-#        $ret .= "</div><!-- end columns-2-left -->\n";
-#        $ret .= "<div class='columns-2-right join'>\n";
-
-#        $ret .= "<div>\n";
-#        $ret .= "<p class='joindetail'>" . BML::ml('.loggedout.free', { sitename => $LJ::SITENAMESHORT }) . "</p>\n";
-#        $ret .= "<form action='$LJ::SITEROOT/create.bml' method='get' class='getstarted-home'>";
-#        $ret .= "<p class='joinlabel'>$ML{'.loggedout.jointext'} ";
-#        $ret .= LJ::html_text({ name => "user", size => 20, maxlength => 16 });
-#        $ret .= LJ::html_submit( submit => $ML{'.loggedout.button2'}, { class => "start"});
-#        $ret .= "</form>\n";
-#        $ret .= "<p class='member'><a href='$LJ::SITEROOT/login.bml'>$ML{'.loggedout.joinmember'}</a></p>";
-#        $ret .= "</div>\n";
-#
-#        $ret .= "</div><!-- end .columns-2-right -->\n";
-#        $ret .= "<div style='clear: left;'></div>";
-#
-#        $ret .= "</div><!-- end .columns-2 -->\n\n";
-
-        
-        if ($adt) {
-            $ret .= $adt;
-        }
-
-        # The new layout for Logged-out Homepage
-        
-        $ret .= "<div class='l-body'>";
-        $ret .= "<div class='l-content'>";
-
-        #ONTD & Spotlight widget
-        # $ret .= "<div class='l-wrap l-col2-50'>";
-        # $ret .= "<div class='l-col-1'>";
-        # $ret .= LJ::Widget::TopEntries->render(domain => 'hmp_spotlight');
-        # $ret .= "</div>";
-        # $ret .= "<div class='l-col-2'>";
-        # $ret .= LJ::Widget::TopEntries->render(domain => 'hmp_ontd');
-        # $ret .= "</div>";
-        # $ret .= "</div>";
-        
-        
-        #QOTD
-        $ret .= "<div class='b-qotd'>";
-        $ret .= "<h2><span>" . BML::ml('.loggedin.qotd.title') . "</span></h2>";
- 		$ret .= qq[<ul class="i-qotd-menu"><li><a href="$LJ::SITEROOT/misc/qotdarchive.bml">$ML{'widget.qotd.archivelink'}</a></li><li><a href="$LJ::SITEROOT/misc/suggest_qotd.bml">$ML{'widget.qotd.suggestions'}</a></li><li><a href="$LJ::SITEROOT/friends/add.bml?user=writersblock">$ML{'widget.qotd.subscribe'}</a></li><li><a href="http://community.livejournal.com/wb_unplugged/">$ML{'widget.qotd.unplugged'}</a></li></ul>];
-        $ret .= LJ::Widget::QotD->render( stylesheet => "stc/widgets/qotd-loggedout.css", domain => "homepage" );
-        $ret .= "</div>";
-        # if (LJ::Widget::PromoText->promos_exist_for_user( domain => "mini" )) {
-        #       $ret .= "<div class='homepage-qotdandpromo pkg'>";
-        #       $ret .= "<div class='homepage-minipromowithqotd'>";
-        #       $ret .= LJ::Widget::PromoText->render( domain => "mini" );
-        #       $ret .= "</div>";
-        #       $ret .= "</div>";
-        #          }
-
-        $ret .= LJ::Widget::GameList->render unless $LJ::DISABLED{'userapps'};
-
-        #Sign UP button
-        $ret .= '<p class="b-signup"><a href="'.$LJ::SITEROOT.'/create.bml"><span>'.BML::ml('.loggedout.signup').'</span></a></p>';
-
-        #Old spotlight
-        $ret .= LJ::Widget::JournalSpotlight->render( stylesheet_override => 'stc/widgets/journalspotlight.css', spotlight_comm_in_header => 0 );
-        
-        #Search Journals widget
-    	$ret .= LJ::Widget::SearchJournals->render;
-
-        #New & Cool features widgets
-        $ret .= "<div class='l-wrap l-col2-50'>";
-        $ret .= "<div class='l-col-1'>";
-        $ret .= LJ::Widget::News->render();
-        $ret .= "</div>";
-        $ret .= "<div class='l-col-2'>";
-        $ret .= LJ::Widget::MarqueeFeatures->render();
-        $ret .= "</div>";
-        $ret .= "</div>";
-
-        $ret .= "</div><!-- end .l-content -->";
-        
-        $ret .= "<div class='l-sidebar'>";
-        
-        #AD 300*250
-        if ($ad) {
-            $ret .= "<div class='homepage-ad'>";
-            $ret .= $ad;
-           $ret .= "</div>";
-        }
-        
-#============= start UK
-			if ($uk_block) {
-		        $ret .= "<div class='homepage-ad' style='clear: right;'>";
-		   		$ret .= "$uk_block";
-		        $ret .= "</div>";
-			}
-#============= end UK
-
-        $ret .= LJ::Widget::VGifts->render(get => \%GET) if LJ::is_enabled('vgift_on_homepage_unlogged_nonsup');
-  
-        #The block About
-        $ret .= "<div class='homepage-stats'>";
-        $ret .= "<div class='b-box-container'>";
-        $ret .= "<p class='header'>" . BML::ml('.loggedout.stats.header', { sitename => $LJ::SITENAMESHORT }) . "</p>";
-        $ret .= LJ::Widget::PublicStats->render( show_latest_posts => 0, short_numbers => 1 );
-        $ret .= "<p>" . BML::ml('.loggedout.facts.open', { aopts => "href='http://www.livejournal.org/'" }) . "</p>";
-        $ret .= "<p>" . BML::ml('.loggedout.facts.volunteer', { aopts => "href='$LJ::HELPURL{how_to_help}'", sitename => $LJ::SITENAMEABBREV }) ."</p>";
-        $ret .= "<p style='margin-top: 15px;'>" . BML::ml('.loggedout.facts.news', { aopts => "href='" . $news->journal_base . "/'" }) . "</p>\n"
-            if $news;
-        $ret .= "</div>";
-        $ret .= "</div><!-- end .homepage-stats -->\n";
-        
-        $ret .= LJ::Widget::Photos2Homepage->render();
- 
-        $ret .= LJ::Widget::PollOfTheDay->render;
-        
-        $ret .= "</div><!-- end .l-sidebar -->";
-        
-        $ret .= "</div><!-- end .l-body -->\n\n"; 
-        
-
-
-
-
-# LJSUP-5839: Remove widget top10 from the non-cyr main page
-#        if (LJ::is_enabled('personal_stats_ratings')) {
-#			$ret .= "<div class='homepage-top10'>";
-#        	$ret .= "<div class='rounded-box'><div class='rounded-box-tr'><div class='rounded-box-bl'><div class='rounded-box-br'>";
-#        	$ret .= "<div class='rounded-box'><div class='rounded-box-tr'><div class='rounded-box-bl'><div class='rounded-box-br'>";
-
-#        	$ret .= "<div class='rounded-box-content'>";		
-#        	$ret .= LJ::Widget::RatingTop10->render;
-#			$ret .= "</div>";
-		
-#        	$ret .= "</div></div></div></div>";
-#        	$ret .= "</div></div></div></div>";
-# 			$ret .= "</div><!-- end top10 -->";
-#		}
-
-
-        # $ret .= "<div class='homepage-promo'>";
-        # $ret .= "<div class='b-box-container'>";
-        # $ret .= "<p class='header'>" . BML::ml('.loggedout.promo.header', { sitename => $LJ::SITENAMESHORT }) . "</p>";
-        # $ret .= LJ::Widget::PromoText->render( domain => "main", small_version => 1 );
-        # $ret .= "</div>";
-        # $ret .= "</div><!-- end .homepage-promo -->";
-
-
-
-# Don't show posts ratings for logged out users.
-# (This is under construction feature, it can be back in future)
-#		if (LJ::is_enabled('personal_stats_ratings')) {
-#		
-#			$ret .= "<div class='homepage-ratepost'>";
-#        	$ret .= "<div class='rounded-box'><div class='rounded-box-tr'><div class='rounded-box-bl'><div class='rounded-box-br'>";
-#        	$ret .= "<div class='rounded-box'><div class='rounded-box-tr'><div class='rounded-box-bl'><div class='rounded-box-br'>";
-#
-#      	    $ret .= "<div class='rounded-box-content'>";		
-#		    $ret .= LJ::PersonalStats->get_result_html($remote, { widget => 1 }, '/ratings/posts/');
-#		    $ret .= "</div>";
-#		
-#        	$ret .= "</div></div></div></div>";
-#        	$ret .= "</div></div></div></div>";
-#			$ret .= "</div><!-- end ratepost -->";
-#		}
-		
-
-        $ret .= "</div><!-- end .homepage-loggedout -->\n";
-
-    }
-
-    return $ret;
+    $template->param( %result );
+    
+    return $template->output;
 }
 _code?>
 <=body
-windowtitle<=
-<?_code
-{
-    if (LJ::get_remote()) {
-        return BML::ml('.windowtitle.loggedin', {'sitename' => $LJ::SITENAME});
-    } else {
-        return BML::ml('.windowtitle', {'sitename' => $LJ::SITENAME});
-    }
-}
-_code?>
-<=windowtitle
-title=><?_code return $title; _code?>
-head<=
-<?_code return $headextra; _code?>
-<=head
-meta<=
-<?_code return $meta; _code?>
-<=meta
+windowtitle=><?_code return $result{windowtitle}; _code?>
+title=><?_code return $result{title}; _code?>
+head=><?_code return $result{headextra}; _code?>
+meta=><?_code return $result{meta}; _code?>
 <=body
 page?>

Added: trunk/templates/Homepage/index_en.tmpl
===================================================================
--- trunk/templates/Homepage/index_en.tmpl	                        (rev 0)
+++ trunk/templates/Homepage/index_en.tmpl	2010-12-30 05:01:05 UTC (rev 9891)
@@ -0,0 +1,159 @@
+<tmpl_if expr="country eq 'US'">
+    <div id="adnectar_container"></div>
+    <script type="text/javascript" src="http://goods.adnectar.com/analytics/get_avia_js?api_version=3.0.0&site_key=a9aa425c93ef5dff380c&avia_version=0.8.16"></script>
+</tmpl_if>
+
+<tmpl_if remote>
+    
+    <!-- ### Logged-in Homepage ## -->
+    
+    <tmpl_var adt>
+    <div class="homepage-loggedin pkg" style="padding-right: 320px;">
+        <div style='float: left; position: relative; width: 100%'>
+            <tmpl_var widget_sup1millionpromo>
+            <div class='homepage-account appwidget pkg b-qotd'>
+                <h2><span><tmpl_var expr="ml('.loggedin.qotd.title')"></span></h2>
+        		<ul class="i-qotd-menu">
+        		    <li><a href="<tmpl_var siteroot>/misc/qotdarchive.bml"><tmpl_var expr="ml('widget.qotd.archivelink')"></a></li>
+        		    <li><a href="<tmpl_var siteroot>/misc/suggest_qotd.bml"><tmpl_var expr="ml('widget.qotd.suggestions')"></a></li>
+        		    <li><a href="<tmpl_var siteroot>/friends/add.bml?user=writersblock"><tmpl_var expr="ml('widget.qotd.subscribe')"></a></li>
+        		    <li><a href="http://community.livejournal.com/wb_unplugged/"><tmpl_var expr="ml('widget.qotd.unplugged')"></a></li>
+        		</ul>
+                <div class='homepage-account-right'>
+                    <tmpl_var widget_qotd>
+                    <tmpl_var widget_gamelist>
+                </div><!-- end .homepage-account-right -->
+            </div><!-- end .homepage-account -->
+            <div class='homepage-minipromo pkg'>
+                <tmpl_var widget_promotext>
+            </div>
+            <!-- #Old Spotlight -->
+            <tmpl_var widget_journalspotlight>
+            <tmpl_var widget_recentcomments>
+            <tmpl_var widget_searchjournals>
+
+            <!-- #New & Cool features widgets -->
+            <div class="l-wrap l-col2-50">
+                <div class="l-col-1">
+                    <tmpl_var widget_news>
+                </div>
+                <div class="l-col-2">
+                    <tmpl_var widget_marqueefeatures>
+                </div>
+            </div>
+
+            <!-- #Photos2Homepage & PollOfTheDay -->
+            <div class="l-wrap l-col2-50">
+                <div class="l-col-1">
+                    <tmpl_var widget_photos2homepage>
+                </div>
+                <div class="l-col-2">
+                    <tmpl_var widget_polloftheday>
+                </div>
+            </div>
+        </div>
+        
+        <div style="float: left; position: relative; width: 300px; padding-left: 20px; margin-right: -320px;">
+            <tmpl_var ad>
+            <tmpl_var uk_block>
+            <tmpl_var info_box>
+            <tmpl_var widget_vgifts>
+            <tmpl_var widget_updatesforuser>
+            <tmpl_var widget_featuredstyles>
+        </div>
+    </div><!-- end .homepage-loggedin  -->
+
+    <tmpl_var widget_settingproddisplay>
+
+<tmpl_else>
+
+    <!-- ### Logged-out Homepage ## -->
+    <div class="homepage-loggedout">
+        <tmpl_if errorbar>
+            <div style="margin-bottom: 10px;"><?errorbar <strong><tmpl_var errorbar></strong> errorbar?></div>
+        </tmpl_if>        
+
+        <tmpl_if adt>
+            <tmpl_var adt>
+        </tmpl_if>
+        
+        <!-- # The new layout for Logged-out Homepage -->
+        <div class="l-body">
+            <div class="l-content">
+                <!-- #QOTD -->
+                <div class="b-qotd">
+                    <h2><span><tmpl_var expr="ml('.loggedin.qotd.title')"></span></h2>
+                    <ul class="i-qotd-menu">
+                        <li><a href="<tmpl_var siteroot>/misc/qotdarchive.bml"><tmpl_var expr="ml('widget.qotd.archivelink')"></a></li>
+                        <li><a href="<tmpl_var siteroot>/misc/suggest_qotd.bml"><tmpl_var expr="ml('widget.qotd.suggestions')"></a></li>
+                        <li><a href="<tmpl_var siteroot>/friends/add.bml?user=writersblock"><tmpl_var expr="ml('widget.qotd.subscribe')"></a></li>
+                        <li><a href="http://community.livejournal.com/wb_unplugged/"><tmpl_var expr="ml('widget.qotd.unplugged')"></a></li>
+                    </ul>
+                    <tmpl_var widget_qotd>
+                </div>
+
+                <tmpl_var widget_gamelist>
+
+                <!-- #Sign UP button -->
+                <p class="b-signup"><a href="<tmpl_var siteroot>/create.bml"><span><tmpl_var expr="ml('.loggedout.signup')"></span></a></p>
+
+                <!-- #Old spotlight -->
+                <tmpl_var widget_journalspotlight>
+                
+                <!-- #Search Journals widget -->
+                <tmpl_var widget_searchjournals>
+
+                <!-- #New & Cool features widgets -->
+                <div class="l-wrap l-col2-50">
+                    <div class="l-col-1">
+                        <tmpl_var widget_news>
+                    </div>
+                    <div class="l-col-2">
+                        <tmpl_var widget_marqueefeatures>
+                    </div>
+                </div>
+            </div><!-- end .l-content -->
+        
+            <div class="l-sidebar">
+                <tmpl_if ad>
+                    <!-- #AD 300*250 -->
+                    <div class="homepage-ad">
+                        <tmpl_var ad>
+                    </div>
+                </tmpl_if>
+            
+	            <tmpl_if uk_block>
+                    <!-- start UK -->
+                    <div class="homepage-ad" style="clear: right;">
+                        <tmpl_var uk_block>
+                    </div>
+                    <!-- end UK -->
+                </tmpl_if>
+	    
+	            <tmpl_if vgift_on_homepage_unlogged_nonsup>
+                    <tmpl_var widget_vgifts>
+                </tmpl_if>
+  
+                <!-- #The block About -->
+                <div class="homepage-stats">
+                    <div class="b-box-container">
+                        <p class="header"><tmpl_var expr="ml('.loggedout.stats.header', 'sitename', sitenameshort)"></p>
+                        <tmpl_var widget_publicstats>
+                        <p><tmpl_var string_loggedout_facts_open></p>
+                        <p><tmpl_var string_loggedout_facts_volunteer></p>
+                        <tmpl_if news>
+                            <p style='margin-top: 15px;'><tmpl_var expr="ml('.loggedout.facts.news', 'aopts', news_href)"></p>
+                        </tmpl_if>
+                    </div>
+                </div><!-- end .homepage-stats -->
+        
+                <tmpl_var widget_photos2homepage>
+                <tmpl_var widget_polloftheday>
+
+            </div><!-- end .l-sidebar -->
+        
+        </div><!-- end .l-body -->
+        
+    </div><!-- end .homepage-loggedout -->
+
+</tmpl_if>

Tags: bml, ljcom, pm, red_alf, tmpl
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