Committer: nnikulochkina
LJSUP-13769: S2 styles Journal Promo blockU trunk/bin/upgrading/s2layers/sup/layout.s2
Modified: trunk/bin/upgrading/s2layers/sup/layout.s2 =================================================================== --- trunk/bin/upgrading/s2layers/sup/layout.s2 2012-09-25 12:59:31 UTC (rev 12688) +++ trunk/bin/upgrading/s2layers/sup/layout.s2 2012-09-25 14:06:21 UTC (rev 12689) @@ -344,7 +344,15 @@ return $user->ljuser({"in_journal" => $journal_name}); } +function _journalpromo { + var Page p = get_page(); + $p->render_journalpromo(); + """ + <div class="hr"><hr /></div> + """; +} + function _print_entry(Entry e) { var Page p = get_page(); var string entrydate = _dateTime($e.time); @@ -490,7 +498,6 @@ """; } - function _calendar(YearMonth mon, string place) { ### $place eq "sidebar" or "page" var string month = $mon->month_format("%%month%%"); var string year = $mon->month_format("%%yyyy%%"); @@ -760,6 +767,7 @@ print ($e.subject != "") ? striphtml($e.subject) : $*text_nosubject; """</a>"""; print ($e.comments.count > 0 ? """ <span class="emdash">—</span> <a class="summary-comments" href="$e.permalink_url">""" + get_plural_phrase($e.comments.count, "text_read_comments") + "</a>":""); + """</li>"""; } """ @@ -835,7 +843,7 @@ $p->need_res(["js/jquery/jquery.lj.inlineCalendar.js", "js/jquery/jquery.calendarEvents.js", "js/s2.js"]); $p->init_appviews(); - + $p->print_head(); if ((not $*old_s1) or ($*old_s1 and $p.view!="entry" and $p.view!="reply")) { @@ -1080,6 +1088,8 @@ $comments_count = ""; } _print_entry($e); + _journalpromo(); + if ($.entry.comments.enabled) { if ($*old_s1) { """ @@ -1432,8 +1442,16 @@ } + + var bool promo = true; + foreach var Entry e ($.entries) { _print_entry($e); + + if ($promo) { + _journalpromo(); + $promo = false; + } } if ($.nav.backward_url != "" or $.nav.forward_url != "") { """