Oracle (ex_ioracle) wrote in changelog,
Oracle
ex_ioracle
changelog

[livejournal] r20003: LJSUP-9307: Delayed entries and sticky p...

Committer: skomarov
LJSUP-9307: Delayed entries and sticky posts
U   branches/delayed_entries/cgi-bin/LJ/Widget/EntryForm.pm
U   branches/delayed_entries/htdocs/editjournal.bml
U   branches/delayed_entries/htdocs/stc/entry.css
U   branches/delayed_entries/htdocs/update.bml
Modified: branches/delayed_entries/cgi-bin/LJ/Widget/EntryForm.pm
===================================================================
--- branches/delayed_entries/cgi-bin/LJ/Widget/EntryForm.pm	2011-09-08 09:15:21 UTC (rev 20002)
+++ branches/delayed_entries/cgi-bin/LJ/Widget/EntryForm.pm	2011-09-08 09:23:39 UTC (rev 20003)
@@ -379,14 +379,14 @@
     my $errors = $self->errors;
     my $onload = $self->onload;
 
-    $out .= "<div id='metainfo'>";
+    $out .= "<ul id='metainfo'>";
     # login info
     $out .= $opts->{'auth'};
     if ($opts->{'mode'} eq "update") {
         # communities the user can post in
         my $usejournal = $opts->{'usejournal'};
         if ($usejournal) {
-            $out .= "<p id='usejournal_single' class='pkg'>\n";
+            $out .= "<li id='usejournal_single' class='pkg'>\n";
             $out .= "<label for='usejournal' class='left'>" .
                 BML::ml('entryform.postto') . "</label>\n";
 
@@ -398,11 +398,11 @@
             });
 
             $out .= LJ::html_hidden( usejournal_set => 'true' );
-            $out .= "</p>";
+            $out .= "</li>";
         } elsif ($login_data && ref $login_data->{'usejournals'} eq 'ARRAY') {
             my $submitprefix = BML::ml('entryform.update3');
-            $out .= "<p id='usejournal_list' class='pkg'>\n";
-            $out .= "<label for='usejournal' class='left'>" .
+            $out .= "<li id='usejournal_list' class='pkg'>\n";
+            $out .= "<label for='usejournal' class='title'>" .
                 BML::ml('entryform.postto') . "</label>\n";
 
             my @choices;
@@ -415,7 +415,8 @@
             }
 
             push @choices, map { $_ => $_ } @{ $login_data->{'usejournals'} };
-
+            
+            $out .= "<span class='wrap'>";
             $out .= LJ::html_select(
                 {
                     'name' => 'usejournal',
@@ -429,12 +430,12 @@
                 },
                 @choices,
             );
-            $out .= "</p>\n";
+            $out .= "</span></li>\n";
         }
     }
 
     # Authentication box
-    $out .= "<p class='update-errors'><?inerr $errors->{'auth'} inerr?></p>\n"
+    $out .= "<li class='update-errors'><?inerr $errors->{'auth'} inerr?></li>\n"
         if $errors->{'auth'};
 
     # Date / Time
@@ -484,30 +485,34 @@
     my $help_icon = LJ::help_icon("24hourshelp");
 
     $out .= qq{
-        <p class='pkg'>
-            <label for='modifydate' class='left'>
-                $BML::ML{'entryform.date'}
-            </label>
-            <span id='currentdate' class='float-left'>
-                <span id='currentdate-date'>
-                    $monthlong $mday, $year, $hour:$min
+        <li class='pkg'>
+            <span id='currentdate'>
+                <label class='title'>$BML::ML{'entryform.post'}</label>
+                <span class='wrap'>
+                    $BML::ML{'entryform.post.right.now'}
+                    <a href='javascript:void(0)' onclick='editdate();' id='currentdate-edit'>$BML::ML{'entryform.date.edit'}</a>
+                    $help_icon
                 </span>
-                <a href='javascript:void(0)' onclick='editdate();'
-                    id='currentdate-edit'>$BML::ML{'entryform.date.edit'}</a>
-                $help_icon
             </span>
-            <span id='modifydate'>$datetime
-                <?de $BML::ML{'entryform.date.24hournote'} de?>
-                
-            <br />
-            $timeZones
-            </span><!-- end #modifydate -->
-        </p>
+            <span id='modifydate'>
+                <label class='title'>$BML::ML{'entryform.postponed.until'}</label>
+                <span class='wrap'>
+                    <a href="#">$monthlong $mday, $year</a><i class='i-calendar'></i>
+                    <span class='datetime'>
+                        <input type='text' value='$hour' class='input-num' /> : <input type='text' value='$min' class='input-num' />
+                        <?de $BML::ML{'entryform.date.24hournote'} de?>
+                    </span>
+                    <span class='timezone'>$timeZones</span>
+                </span>
+            </span>
+        </li>
+        <li>
         <noscript>
             <p id='time-correct' class='small'>
                 $BML::ML{'entryform.nojstime.note'}
             </p>
         </noscript>
+        </li>
     };
 
     $$onload .= " defaultDate();";
@@ -534,20 +539,21 @@
         my $style = "display: $userpic_display;";
 
         $out .= qq{
-            <p id='userpic_select_wrapper' class='pkg' style='$style'>
-                <label for='prop_picture_keyword' class='left'>
+            <li id='userpic_select_wrapper' class='pkg' style='$style'>
+                <label for='prop_picture_keyword' class='title'>
                     $BML::ML{'entryform.userpic'}
                 </label>
-                $pickw_select
-                <a href='javascript:void(0);' id='lj_userpicselect'> </a>
-                $userpics_help
-            </p>
+                <span class='wrap'>
+                    $pickw_select
+                    $userpics_help
+                </span>
+            </li>
         };
 
         $$onload .= " insertViewThumbs();" if $self->should_show_userpicselect;
     }
 
-    $out .= "</div>";
+    $out .= "</ul>";
 }
 
 sub render_infobox_block {
@@ -718,7 +724,7 @@
 
     my $out = '';
 
-    $out .= "<div id='options' class='pkg'>";
+    $out .= "<ul id='options' class='pkg'>";
 
     my %blocks = (
         'sticky' => sub {
@@ -752,7 +758,7 @@
             my $sticky_exists = $journalu->has_sticky_entry && !$selected;
             my $sticky_text = $sticky_exists ? $BML::ML{'entryform.sticky_replace.edit'} :
                                                $BML::ML{'entryform.sticky.edit'};
-            return qq{$sticky_check <label for='prop_sticky' class='right options'>
+            return qq{$sticky_check <label for='sticky_type' class='right options'>
                    $sticky_text
                 </label>};
         },
@@ -778,7 +784,7 @@
             }
 
             return qq{
-                <label for='prop_taglist' class='left options'>
+                <label for='prop_taglist' class='title options'>
                     $BML::ML{'entryform.tags'}
                 </label>
                 $field
@@ -850,7 +856,7 @@
             });
 
             return qq{
-                <label for='prop_current_moodid' class='left options'>
+                <label for='prop_current_moodid' class='title options'>
                     $BML::ML{'entryform.mood'}
                 </label>
                 $dropdown
@@ -861,7 +867,7 @@
         'comment_settings' => sub {
             my $out = '';
 
-            $out .= "<label for='comment_settings' class='left options'>" .
+            $out .= "<label for='comment_settings' class='title options'>" .
                 BML::ml('entryform.comment.settings2') . "</label>\n";
 
             my $comment_settings_selected = sub {
@@ -917,7 +923,7 @@
             });
 
             $out .= qq{
-                <label for='prop_current_location' class='left options'>
+                <label for='prop_current_location' class='title options'>
                     $BML::ML{'entryform.location'}
                 </label>
                 $textbox
@@ -943,7 +949,7 @@
         'comment_screening' => sub {
             my $out = '';
 
-            $out .= "<label for='prop_opt_screening' class='left options'>" .
+            $out .= "<label for='prop_opt_screening' class='title options'>" .
                 BML::ml('entryform.comment.screening2') . "</label>\n";
 
             my @levels = (
@@ -971,7 +977,7 @@
         'music' => sub {
             my $out = '';
 
-            $out .= "<label for='prop_current_music' class='left options'>" .
+            $out .= "<label for='prop_current_music' class='title options'>" .
                 BML::ml('entryform.music') . "</label>\n";
 
             $out .= LJ::html_text({
@@ -1022,7 +1028,7 @@
                 explicit => BML::ml('entryform.adultcontent.explicit'),
             );
 
-            $out .= "<label for='prop_adult_content' class='left options'>" .
+            $out .= "<label for='prop_adult_content' class='title options'>" .
                 BML::ml('entryform.adultcontent') . "</label>\n";
 
             $out .= LJ::html_select({
@@ -1046,7 +1052,7 @@
                 "disable" => BML::ml('entryform.give.disable'),
             );
 
-            $out .= "<label for='prop_give_features' class='left options'>" .
+            $out .= "<label for='prop_give_features' class='title options'>" .
                 BML::ml('entryform.give') . "</label>\n";
 
             my $is_enabled;
@@ -1094,7 +1100,7 @@
                 ) . "&nbsp;";
             }
             
-            return qq{<label for='prop_sticky' class='right options'>
+            return qq{<label for='sticky_type' class='title options'>
                 $BML::ML{'entryform.spellcheck'}
                 </label> $out};
         },
@@ -1113,7 +1119,7 @@
     unless ($opts->{'disabled_save'}) {
         foreach my $row (@schema) {
             if (ref $row eq 'ARRAY') {
-                $out .= "<p class='pkg'>";
+                $out .= "<li class='pkg'>";
                 
                 my ($l, $r) = @$row;
                 
@@ -1138,7 +1144,7 @@
                             class='inputgroup-right'>$block_right</span>
                     };
                 }
-                $out .= '</p>';
+                $out .= '</li>';
             } elsif ($row eq 'extra') {
                 $out .= LJ::run_hook('add_extra_entryform_fields', {
                     opts => $opts,
@@ -1148,7 +1154,7 @@
         }
     }
 
-    $out .= "</div><!-- end #options -->\n\n";
+    $out .= "</ul>";
 
     return $out;
 }
@@ -1215,34 +1221,6 @@
         @secopts
     }, @secs) . "\n";
 
-    # if custom security groups available, show them in a hideable div
-    if ($self->should_show_friendgroups) {
-        my $display = $opts->{'security'} eq "custom" ? "block" : "none";
-
-        my $help_icon = LJ::help_icon("security",
-            "<span id='security-help'>\n", "\n</span>\n");
-        $out .= $help_icon;
-
-        $out .= "<div id='custom_boxes' class='pkg' style='display: $display;'>";
-        $out .= "<ul id='custom_boxes_list'>";
-        foreach my $fg (@{$login_data->{'friendgroups'}}) {
-            $out .= "<li>";
-            $out .= LJ::html_check({
-                'name' => "custom_bit_$fg->{'id'}",
-                'id' => "custom_bit_$fg->{'id'}",
-                'selected' => $opts->{"custom_bit_$fg->{'id'}"} ||
-                    ($opts->{'security_mask'}+0) & (1 << $fg->{'id'}),
-            }) . " ";
-
-            $out .= "<label for='custom_bit_$fg->{'id'}'>" .
-                LJ::ehtml($fg->{'name'}) . "</label>\n";
-
-            $out .= "</li>";
-        }
-        $out .= "</ul>";
-        $out .= "</div><!-- end #custom_boxes -->\n";
-    }
-
     return $out;
 }
 
@@ -1256,8 +1234,8 @@
     my $out = '';
 
     $out .= "<div id='submitbar' class='pkg'>\n\n";
-
     $out .= "<div id='security_container'>\n";
+    $out .= "<div class='security-options'>\n";
     $out .= "<label for='security'>" . BML::ml('entryform.security2') . " </label>\n";
     
     # preview button 
@@ -1283,6 +1261,8 @@
         tabindex="$preview_tabindex"
         />
     };
+
+    
     $preview =~ s/\s+/ /sg; # JS doesn't like newlines in string
     # literals
         
@@ -1301,21 +1281,27 @@
     if ($opts->{'mode'} eq "update") {
         my $onclick = "";
         $onclick .= "return sendForm('updateForm');" if ! $LJ::IS_SSL;
-
+        
+        my $help_icon = LJ::help_icon("security",
+            "<span id='security-help'>\n", "\n</span>\n");
+        $out .= $help_icon;
+        
         my $defaultjournal;
         if ($opts->{'usejournal'}) {
             $defaultjournal = $opts->{'usejournal'};
         } elsif ($remote && $opts->{auth_as_remote}) {
             $defaultjournal = $remote->user;
         }
-
-        $out .= qq{ <div id="entryform-update-and-edit"> };
+        
+        $out .= qq{ </div> };
+        $out .= qq{ <div class="submit-options"> };
+        $out .= qq{ <span id="entryform-update-and-edit"> };
         if ($defaultjournal) {
             $$onload .= " changeSubmit('$BML::ML{'entryform.update3'}', '$defaultjournal', '$BML::ML{'entryform.update4'}');";
             $$onload .= " changeSecurityOptions('$defaultjournal');";
         }
-        $out .= qq{</div>};
-
+        $out .= qq{</span>};
+        
         my $disabled = $remote && $remote->is_identity && !$self->usejournal;
 
         $out .= LJ::html_submit(
@@ -1329,11 +1315,16 @@
                 'disabled' => $disabled,
             }
         ) . "&nbsp;\n";
+        
+        $out .= qq{</div>};
+        
     }
-
+    
+    $out .= qq{</div>};
+    
     if ($opts->{'mode'} eq "edit") {
         my $onclick = $LJ::IS_SSL ? '' : 'return true;';
-        $out .= qq{ <div id="entryform-update-and-edit"> };
+        $out .= qq{ <div id="entryform-update-and-edit" class="submit-options"> };
         $out .= LJ::html_submit(
             'action:save',
             BML::ml('entryform.save'),
@@ -1381,8 +1372,33 @@
         $out .= qq{</div>};
     }
 
+    $out .= "</div><!-- end #security_container -->\n\n";
+    
+    my $login_data = $self->login_data;
+    # if custom security groups available, show them in a hideable div
+    if ($self->should_show_friendgroups) {
+        my $display = $opts->{'security'} eq "custom" ? "block" : "none";
 
-    $out .= "</div><!-- end #security_container -->\n\n";
+        $out .= "<div id='custom_boxes' class='pkg' style='display: $display;'>";
+        $out .= "<ul id='custom_boxes_list'>";
+        foreach my $fg (@{$login_data->{'friendgroups'}}) {
+            $out .= "<li>";
+            $out .= LJ::html_check({
+                'name' => "custom_bit_$fg->{'id'}",
+                'id' => "custom_bit_$fg->{'id'}",
+                'selected' => $opts->{"custom_bit_$fg->{'id'}"} ||
+                    ($opts->{'security_mask'}+0) & (1 << $fg->{'id'}),
+            }) . " ";
+
+            $out .= "<label for='custom_bit_$fg->{'id'}'>" .
+                LJ::ehtml($fg->{'name'}) . "</label>\n";
+
+            $out .= "</li>";
+        }
+        $out .= "</ul>";
+        $out .= "</div><!-- end #custom_boxes -->\n";
+    }
+    
     $out .= "</div><!-- end #submitbar -->\n\n";
 
     return $out;
@@ -1580,6 +1596,7 @@
     my $ret = LJ::html_select({
         name => "delayed_timezone",
         selected => $timezone,
+        class => "select select-timezone",
     }, @options);
     
     $ret .= "<br />";

Modified: branches/delayed_entries/htdocs/editjournal.bml
===================================================================
--- branches/delayed_entries/htdocs/editjournal.bml	2011-09-08 09:15:21 UTC (rev 20002)
+++ branches/delayed_entries/htdocs/editjournal.bml	2011-09-08 09:23:39 UTC (rev 20003)
@@ -381,12 +381,12 @@
             ### SHOW EDIT FORM
             ###
 
-            my $auth = "<p class='pkg'><label for='' class='left'>$ML{'.auth.poster'}</label>";
-            $auth   .= "<span id='poster' class='float-left'>";
+            my $auth = "<li class='pkg'><label for='' class='title'>$ML{'.auth.poster'}</label>";
+            $auth   .= "<span class='wrap'><span id='poster' class='float-left'>";
             $auth   .= $usejournal ? LJ::ljuser($res{'events_1_poster'}) . " in community " . LJ::ljuser($usejournal)
                                    :  LJ::ljuser($remote);
             $auth .= LJ::html_hidden("usejournal", $usejournal);
-            $auth   .= "</span></p>";
+            $auth   .= "</span></span></li>";
 
             # Tags
             my @tag_names;

Modified: branches/delayed_entries/htdocs/stc/entry.css
===================================================================
--- branches/delayed_entries/htdocs/stc/entry.css	2011-09-08 09:15:21 UTC (rev 20002)
+++ branches/delayed_entries/htdocs/stc/entry.css	2011-09-08 09:23:39 UTC (rev 20003)
@@ -29,13 +29,10 @@
 }
 #updateForm label.left {
     width: auto;
-    min-width: 6.5em;
-    line-height: 1.8em;
+	padding-right: 10px;
+    line-height: 1.6em;
     font-size: 14px;
 }
-* html #updateForm label.left {
-    width: 6.5em;
-}
 #updateForm label.options {
     font-size: 11px;
 }
@@ -56,7 +53,7 @@
 #updateForm span.inputgroup-right {
     display: block; float: right; width: 49%;  position: relative;
 }
-#updateForm span.inputgroup-right label.left {
+#updateForm span.inputgroup-right label.title {
     width: 11em;
 }
 #updateForm a.helplink {
@@ -135,12 +132,100 @@
     font-size: 90%;
     line-height: 110%;
 }
-#metainfo {
-    float: left;
-    margin-right: 10px;
-    width: 55%;
-    margin-bottom: 20px;
-}
+
+/* Metainfo
+----------------------------------------------- */
+#updateForm #metainfo {
+	float: left;
+	width: 61%;
+	margin: -3px 10px 20px 0;
+	}
+	#updateForm #metainfo LI {
+		padding: 0;
+		margin: 0 0 10px 0;
+		list-style: none;
+		line-height: 22px;
+		}
+		#updateForm #metainfo LI .title {
+			float: left;
+			min-width: 8.5em;
+			padding: 3px 7px 0 0;
+			text-align: right;
+			line-height: 20px;
+		    font-size: 14px;
+			}
+		#updateForm #metainfo LI .wrap {
+			display: block;
+			overflow: hidden;
+			padding: 3px;
+			}
+		#updateForm #metainfo LI .current-username {
+			line-height: 20px;
+			font-size: 14px;
+			}
+		#updateForm #metainfo LI .select {
+			float: none;
+			display: inline-block;
+			vertical-align: top;
+			}
+		#updateForm #metainfo LI .select-timezone {
+			width: 133px;
+			font-size: 12px;
+			}
+		#updateForm #metainfo LI .helplink {
+			float: none;
+			display: inline-block;
+			margin: 4px 0 0 0;
+			vertical-align: top;
+			}
+		#updateForm #metainfo LI #modifydate .wrap {
+			padding-top: 1px;
+			}
+		#updateForm #metainfo LI .i-calendar {
+			display: inline-block;
+			width: 10px;
+			height: 10px;
+			margin-left: 5px;
+			background: url(/img/widget/wishlist/date-icon.gif?ver=1) no-repeat;
+			vertical-align: moddle;
+			cursor: pointer;
+			}
+		#updateForm #metainfo LI .datetime {
+			margin-left: 10px;
+			}
+			#updateForm #metainfo LI .datetime .input-num {
+				width: 22px;
+				padding: 2px 1px;
+				text-align: center;
+				}
+			#updateForm #metainfo LI .datetime .de {
+				font-size: 11px;
+				}
+		#updateForm #metainfo LI .timezone {
+			display: block;
+			padding-top: 5px;
+			}
+
+/* Options
+----------------------------------------------- */
+#updateForm #options {
+	padding: 10px;
+	margin: 0;
+	}
+	#updateForm #options LI {
+		padding: 0;
+		margin: 0 0 5px 0;
+		list-style: none;
+		}
+		#updateForm #options LI .title {
+			float: left;
+			min-width: 6em;
+			padding: 3px 7px 0 0;
+			}
+		#updateForm #options LI .i-prop-selecttags {
+			margin-top: 3px;
+			}
+
 #currentdate {
     display: none;
 }
@@ -200,12 +285,6 @@
     font-weight: bold;
     padding-bottom: 9px;
 }
-#metainfo, #metainfo label, #metainfo input.text, #metainfo strong {
-    font-size: 14px;
-}
-#metainfo p, #metainfo label, #metainfo label.left {
-    line-height: 1.5em ;
-}
 #subject {
     width: 52%;
     /* width: 98%; */
@@ -476,13 +555,17 @@
     border: 1px solid #aaa;    
     padding: 7px 10px;
     margin-top: 10px;
-    text-align: center;
     position: relative;
 }
 #security_container {
-    width: 600px;
-    margin: 0 auto;
-}
+	overflow: hidden;
+	}
+	#security_container .security-options {
+	    float: left;
+		}
+	#security_container .submit-options {
+	    float: right;
+		}
 #security {
     float: none !important;
 }

Modified: branches/delayed_entries/htdocs/update.bml
===================================================================
--- branches/delayed_entries/htdocs/update.bml	2011-09-08 09:15:21 UTC (rev 20002)
+++ branches/delayed_entries/htdocs/update.bml	2011-09-08 09:23:39 UTC (rev 20003)
@@ -246,19 +246,18 @@
         my $auth = '';
 
         if ($altlogin_display eq 'none') {
-            $auth.= "<p id='remotelogin' class='pkg'>\n";
-            $auth .= "<label for='current_username' class='left'>" . BML::ml('entryform.postas') . "</label>\n";
-            $auth .= "<strong id='current_username'>" . $remote->display_name . "</strong> <a href='$LJ::SITEROOT/update.bml?altlogin=1' id='remotelogin_content' class='small'>$ML{'entryform.switchuser'}</a>\n";
-            $auth .= "</p>\n\n";
+            $auth.= "<li id='remotelogin' class='pkg'>\n";
+            $auth .= "<label for='current_username' class='title'>" . BML::ml('entryform.postas') . "</label>\n";
+            $auth .= "<span class='wrap'><strong id='current_username' class='current-username'>" . $remote->display_name . "</strong> <a href='$LJ::SITEROOT/update.bml?altlogin=1' id='remotelogin_content' class='small'>$ML{'entryform.switchuser'}</a></span>\n";
+            $auth .= "</li>\n\n";
         }
         # table with username/password fields
-        $auth .= "<div id='altlogin_wrapper' style='display: $altlogin_display;'>";
-        $auth .= "<p class='pkg'>\n";
+        $auth .= "<li id='altlogin_wrapper' class='pkg' style='display: $altlogin_display;'>\n";
         $auth .= "<label for='altlogin_username' class='left'>$ML{'.username'}</label>\n";
         $auth .=  LJ::html_text({ 'name' => 'user', 'id' => 'altlogin_username', 'class' => 'text', 'size' => '15', 
                 'maxlength' => '15', 'tabindex' => '5', 'value' => $POST{'user'} || $GET{'user'} }) . "\n";
-        $auth .= "</p>\n";
-        $auth .= "<p class='pkg'>\n";
+        $auth .= "</li>\n";
+        $auth .= "<li id='altlogin_wrapper' class='pkg' style='display: $altlogin_display;'>\n";
         $auth .= "<label for='altlogin_password' class='left'>$ML{'.password'}</label>\n";
         $auth .= LJ::html_text({ 'type' => 'password', 'id' => 'altlogin_password', 'class' => 'text',  
                 'name' => 'password', 'tabindex' => '6', 'size' => '15', 'maxlength' => '30' }) . "\n";
@@ -266,8 +265,7 @@
         if ($did_post && $auth_missing) {
             $auth .= "<br /><?inerr $ML{'.error.nopass'} inerr?>";
         }
-        $auth .= "</p>\n\n";
-        $auth .= "</div>";
+        $auth .= "</li>\n\n";
 
         # if they submit the form and are spellchecking, remember
         # their settings from the GET requests
@@ -460,8 +458,8 @@
                     'password'    => $POST{'password'},
                     'usejournal'  => ($usejournalu) ? $usejournalu->user : undef,
                     'tz'          => 'guess',
-                    'timezone'    => $POST{'timezone'} || $POST{'timezone'},
-                    'type'        => $POST{'type'} || $POST{'type'},
+                    'timezone'    => $POST{'delayed_timezone'} || $GET{'delayed_timezone'},
+                    'type'        => $POST{'type'} || $GET{'type'},
                     );
 
         LJ::entry_form_decode(\%req, \%POST);

Tags: bml, css, ioracle, livejournal, pm
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