[ljcom] r10956: LJSUP-9307: Delayed entries and sticky p...
Committer: esavintcev
LJSUP-9307: Delayed entries and sticky postsU branches/delayed_entries/bin/upgrading/s2layers/smoothsailing/layout.s2
Modified: branches/delayed_entries/bin/upgrading/s2layers/smoothsailing/layout.s2
===================================================================
--- branches/delayed_entries/bin/upgrading/s2layers/smoothsailing/layout.s2 2011-09-02 09:02:10 UTC (rev 10955)
+++ branches/delayed_entries/bin/upgrading/s2layers/smoothsailing/layout.s2 2011-09-02 09:38:10 UTC (rev 10956)
@@ -1394,11 +1394,11 @@
function EntryPage::lay_get_previous_url():string {
var Link prev = $.entry->get_link("nav_prev");
- if (defined $prev and $.entry.itemid!=int($*layout_guestbook_entryid)) { return $prev.url; } else { return ""; }
+ if (defined $prev and (($.entry.delayed) or ($.entry.itemid!=int($*layout_guestbook_entryid)))) { return $prev.url; } else { return ""; }
}
function EntryPage::lay_get_next_url():string {
var Link next= $.entry->get_link("nav_next");
- if (defined $next and $.entry.itemid!=int($*layout_guestbook_entryid)) { return $next.url; } else { return ""; }
+ if (defined $next and (($.entry.delayed) or ($.entry.itemid!=int($*layout_guestbook_entryid)))) { return $next.url; } else { return ""; }
}
function EntryPage::lay_get_previous_title():string { return "$*text_nav_prev_entrypage"; }
function EntryPage::lay_get_next_title():string { return "$*text_nav_next_entrypage"; }
@@ -1629,7 +1629,7 @@
function Entry::lay_print_subjectline(Color bg, Color fg, bool usecolour) {
var Page p = get_page();
- if ($.itemid!=int($*layout_guestbook_entryid)) {
+ if (($.itemid!=int($*layout_guestbook_entryid) or ($.delayed))) {
"""<div class='entryHeader'""";
if ($usecolour and $*layout_friends_colours=="subject") { print " style='color:$fg;background:$bg;'"; }
"""><span class="entryHeaderDate">""";
@@ -1645,9 +1645,15 @@
}
"""</span><span class="entryHeaderSubject">""";
if ($p.view=="entry") {
- print (defined $.security_icon?" - $.security_icon":"");
+ if ($.delayed) { " - $.delayed_icon"; }
+ if ($.sticky) { " - $.sticky_icon"; }
+ if (defined $.security_icon) { " - $.security_icon"; }
}else{
- print (defined $.security_icon or $.subject!=""?" - ":"")+(defined $.security_icon?"$.security_icon ":"")+$this->formatted_subject({"class"=>"subj-link"});
+ print (defined $.security_icon or $.sticky or $.delayed or $.subject!="" ? " - " : "");
+ if ($.delayed) { "$.delayed_icon "; }
+ if ($.sticky) { "$.sticky_icon "; }
+ if (defined $.security_icon) { "$.security_icon "; }
+ print $this->formatted_subject({"class"=>"subj-link"});
}
"""</span>""";
if ((size $.tags>0)and($*layout_position_entrytags=="subject")) {
@@ -1660,7 +1666,13 @@
"""</div>""";
}else{
"""<div class="entryHeader">""";
- print (defined $.security_icon?""+$.security_icon:" ");
+ if (defined $.security_icon or $.sticky or $.delayed) {
+ if ($.delayed) { "$.delayed_icon "; }
+ if ($.sticky) { " $.sticky_icon "; }
+ if (defined $.security_icon) { " $.security_icon"; }
+ } else {
+ " ";
+ }
"""</div>""";
}
}
@@ -1701,7 +1713,7 @@
}
}
if ($.comments.enabled) {
- if ($.itemid==int($*layout_guestbook_entryid)) {
+ if (($.itemid==int($*layout_guestbook_entryid) and (not $.delayed))) {
print safe """<li><a href="$.comments.post_url">$*text_post_comment_guestbook</a></li>""";
print safe """$comments_showspam""";
} else {
@@ -1750,7 +1762,9 @@
}
function Entry::lay_print(Page p, Color bg, Color fg, bool usecolour) {
- if ( $.itemid==int($*layout_guestbook_entryid) and ($p.view=="recent" or $p.view=="day" )) { return; }
+ if (not $.delayed) {
+ if ( $.itemid==int($*layout_guestbook_entryid) and ($p.view=="recent" or $p.view=="day" )) { return; }
+ }
if ( $p.args{"noshow"}==$.journal.username ) { return; }
"""
<a name="$.journal.username$.itemid"></a>
@@ -1925,7 +1939,7 @@
}
function ReplyPage::lay_print_bodytop() {
- if ($.entry.itemid==int($*layout_guestbook_entryid) and $.replyto.depth==0) {
+ if ($.entry.itemid==int($*layout_guestbook_entryid) and (not $.entry.delayed) and $.replyto.depth==0) {
$this->lay_print_bodytitlebox($*text_signing_guestbook,"title");
}elseif ($.replyto.depth==0) {
$this->lay_print_bodytitlebox($*text_comment_to,"title");
@@ -2021,7 +2035,11 @@
}else{
#nothing
}
- if (defined $.security_icon) { """$.security_icon """; }
+
+ if ($.delayed) { "$.delayed_icon "; }
+ if ($.sticky) { "$.sticky_icon "; }
+ if (defined $.security_icon) { "$.security_icon "; }
+
"""<a href="#$.journal.username$.itemid">""";
if ($.subject!="") { print $this->plain_subject(); } else { print safe """<i>$*text_nosubject</i>"""; }
"""</a>""";
@@ -2060,7 +2078,7 @@
if ($i<0) { """</div> <!--sidebox-summary -->"""; return; }
foreach var int pos (0..$i) {
var Entry e = $.entries[$pos];
- if ($e.itemid!=int($*layout_guestbook_entryid)) {$e->lay_print_summaryline($this);}
+ if ($e.itemid!=int($*layout_guestbook_entryid) or ($e.delayed)) {$e->lay_print_summaryline($this);}
}
"""</div> <!--sidebox-summary -->""";
$this->lay_print_sidebox_bottom();
@@ -2087,7 +2105,7 @@
if ($i<0) { """</div> <!--sidebox-summary -->"""; return; }
foreach var int pos (0..$i) {
var Entry e = $.entries[($*layout_day_sortorder=="newest"?$i-$pos:$pos)];
- if ($e.itemid!=int($*layout_guestbook_entryid)) {$e->lay_print_summaryline($this);}
+ if ($e.itemid!=int($*layout_guestbook_entryid) or $e.delayed ) {$e->lay_print_summaryline($this);}
}
"""</div> <!--sidebox-summary -->""";
$this->lay_print_sidebox_bottom();
@@ -2345,7 +2363,7 @@
}else{
$.replyto->lay_print();
}
- if ($.entry.itemid==int($*layout_guestbook_entryid) and $.replyto.depth==0) {
+ if ($.entry.itemid==int($*layout_guestbook_entryid) and (not $.entry.delayed) and $.replyto.depth==0) {
$this->lay_print_bodytitlebox($*text_signing_form,"midtitle");
}elseif ($.replyto.depth==0) {
$this->lay_print_bodytitlebox($*text_comment_form,"midtitle");
@@ -2355,7 +2373,7 @@
print_ebox($.entry);
"""
<a name="replyform"></a>""";
- if ($.replyto.depth==0 and int($*layout_guestbook_entryid)!=0 and $.entry.itemid!=int($*layout_guestbook_entryid) and $*text_replypage_warning!="") {
+ if ($.replyto.depth==0 and int($*layout_guestbook_entryid)!=0 and (not $.entry.delayed) and $.entry.itemid!=int($*layout_guestbook_entryid) and $*text_replypage_warning!="") {
print safe $*text_replypage_warning;
}
@@ -2370,7 +2388,7 @@
print_ebox($.entry);
if (size $.comments >0) {
- if ($.entry.itemid!=int($*layout_guestbook_entryid)) {
+ if (($.entry.itemid!=int($*layout_guestbook_entryid)) or ($.entry.delayed)) {
$this->lay_print_bodytitlebox($*text_comment_seperator,"midtitle");
}else {
$this->lay_print_bodytitlebox($*text_signature_seperator,"midtitle");
@@ -2387,7 +2405,7 @@
$this->print_multiform_actionline();
$this->print_multiform_end();
}else{
- if ($.entry.itemid!=int($*layout_guestbook_entryid)) {
+ if (($.entry.itemid!=int($*layout_guestbook_entryid)) or ($.entry.delayed)) {
print safe """<b><a href="$.entry.comments.post_url">$*text_post_comment_entrypage</a></b>""";
}else{
print safe """<b><a href="$.entry.comments.post_url">$*text_post_comment_guestbook</a></b>""";
@@ -2399,10 +2417,15 @@
function MonthDay::print_subjectlist() {
foreach var Entry e ($.entries) {
- if ($e.itemid!=int($*layout_guestbook_entryid)) {
+ if (($e.itemid!=int($*layout_guestbook_entryid)) or ($e.delayed)) {
print $e.time->time_format();
if ($e.journal.username!=$e.poster.username) { """ - $e.poster"""; }
- print " - "+(defined $e.security_icon?"$e.security_icon ":"");
+ print " - ";
+
+ if ($e.delayed) { "$e.delayed_icon "; }
+ if ($e.sticky) { " $e.sticky_icon "; }
+ if ($e.security) { " $e.security_icon"; }
+
"""<a href="$e.permalink_url">""";
print ($e.subject==""?"<i>(no subject)</i>":$e->plain_subject());
"""</a>""";
