[livejournal] r20409: LJSUP-9841: There are no icons for stick...
Committer: sbelyaev
LJSUP-9841: There are no icons for sticky&delayed posts on preview pageU trunk/cgi-bin/LJ/S2.pm U trunk/htdocs/preview/entry.bml
Modified: trunk/cgi-bin/LJ/S2.pm
===================================================================
--- trunk/cgi-bin/LJ/S2.pm 2011-10-23 17:27:44 UTC (rev 20408)
+++ trunk/cgi-bin/LJ/S2.pm 2011-10-24 04:55:33 UTC (rev 20409)
@@ -1861,6 +1861,7 @@
'link_keyseq' => [ 'edit_entry', 'edit_tags' ],
'metadata' => {},
};
+
foreach (qw(subject text journal poster new_day end_day
comments userpic permalink_url itemid tags delayedid )) {
$e->{$_} = $arg->{$_};
@@ -1959,6 +1960,11 @@
}
}
+ if ($arg->{'delayed'}) {
+ $e->{'delayed'} = 1;
+ $e->{'delayed_icon'} = Image_std("delayed-entry");
+ }
+
if (!$e->{delayedid}) {
# custom friend groups
my $entry = LJ::Entry->new($e->{journal}->{_u}, ditemid => $e->{itemid});
@@ -1971,14 +1977,16 @@
# untrusted layers.
$e->{text_must_print_trusted} = 1 if $e->{text} =~ m!<(script|object|applet|embed|iframe)\b!i;
- if ($entry->is_sticky()) {
+ if ($entry->is_sticky() || $arg->{'sticky_type'} ) {
$e->{'sticky'} = 1;
$e->{'sticky_icon'} = Image_std("sticky-entry");
}
- } else {
+
+ } else {
my $entry = LJ::DelayedEntry->get_entry_by_id( $e->{journal}->{_u},
$e->{delayedid} );
- if ( $entry->is_sticky) {
+
+ if ( $entry->is_sticky || $arg->{'sticky_type'}) {
$e->{'sticky'} = 1;
$e->{'sticky_icon'} = Image_std("sticky-entry");
}
Modified: trunk/htdocs/preview/entry.bml
===================================================================
--- trunk/htdocs/preview/entry.bml 2011-10-23 17:27:44 UTC (rev 20408)
+++ trunk/htdocs/preview/entry.bml 2011-10-24 04:55:33 UTC (rev 20409)
@@ -263,6 +263,10 @@
# format it
my $raw_subj = $req{'subject'};
+ my $custom_time = $POST{'custom_time'} || $GET{'custom_time'};
+ my $timezone = $POST{'timezone'} || $GET{'timezone'};
+ $req{'tz'} = sprintf("%+.4d", $timezone);
+
my $s2entry = LJ::S2::Entry($u, {
'subject' => $subject,
'text' => $event,
@@ -279,8 +283,10 @@
'tags' => \@taglist,
'userpic' => $userpic,
'permalink_url' => "#",
- });
-
+ 'sticky_type' => $POST{'sticky_type'} || $GET{'sticky_type'},
+ 'delayed' => $custom_time ? LJ::DelayedEntry::is_future_date(\%req) : 0,
+ });
+
$p->{'multiform_on'} = 0;
$p->{'entry'} = $s2entry;
