Numerous Publish postbox tweaks, fixes, and flourishes. Still WIP

git-svn-id: http://svn.automattic.com/wordpress/trunk@9394 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
markjaquith 2008-10-29 06:00:22 +00:00
parent fd24df7b4a
commit 3eb1cd5ade
2 changed files with 52 additions and 34 deletions

View File

@ -70,47 +70,50 @@ function post_submit_meta_box($post) {
?> ?>
<div class="submitbox" id="submitpost"> <div class="submitbox" id="submitpost">
<!--<div class="inside-submitbox">-->
<div id="minor-publishing"> <div id="minor-publishing">
<div id="misc-publishing-actions"> <div id="misc-publishing-actions">
<?php // Hidden submit button early on so that the browser chooses the right button when form is submitted with Return key ?>
<div style="display:none;">
<input type="submit" name="save" value="<?php echo attribute_escape( __('Save') ); ?>" />
</div>
<?php if ( $can_publish && current_user_can( 'edit_others_posts' ) ) { ?> <?php if ( $can_publish && current_user_can( 'edit_others_posts' ) ) { ?>
<div class="misc-pub-section" id="sticky-checkbox"><input id="sticky" name="sticky" type="checkbox" value="sticky" <?php checked(is_sticky($post->ID), true); ?> tabindex="4" /> <label for="sticky" class="selectit"><?php _e('Stick to front page') ?></label></div> <div class="misc-pub-section" id="sticky-checkbox"><input id="sticky" name="sticky" type="checkbox" value="sticky" <?php checked(is_sticky($post->ID), true); ?> tabindex="4" /> <label for="sticky" class="selectit"><?php _e('Stick to front page') ?></label></div>
<?php } ?> <?php } ?>
<div class="misc-pub-section" id="visibility"> <div class="misc-pub-section" id="visibility">
<?php _e('Visibility:'); ?> <?php _e('Public'); // TODO: dropdown ?> <?php _e('Visibility:'); ?> <b><?php _e('Public'); // TODO: dropdown ?></b>
</div> </div>
<?php <?php
$datef = _c( 'M j, Y \a\t G:i|Publish box date format');
if ( 0 != $post->ID ) { if ( 0 != $post->ID ) {
if ( 'future' == $post->post_status ) { // scheduled for publishing at a future date if ( 'future' == $post->post_status ) { // scheduled for publishing at a future date
$stamp = __('Scheduled for: %1$s at %2$s'); $stamp = __('Scheduled for:<br />%1$s');
} else if ( 'publish' == $post->post_status ) { // already published } else if ( 'publish' == $post->post_status ) { // already published
$stamp = __('Published on: %1$s at %2$s'); $stamp = __('Published on:<br />%1$s');
} else if ( '0000-00-00 00:00:00' == $post->post_date_gmt ) { // draft, 1 or more saves, no date specified } else if ( '0000-00-00 00:00:00' == $post->post_date_gmt ) { // draft, 1 or more saves, no date specified
$stamp = __('Publish immediately'); $stamp = __('Publish immediately');
} else { // draft, 1 or more saves, date specified } else { // draft, 1 or more saves, date specified
$stamp = __('Publish on: %1$s at %2$s'); $stamp = __('Publish on:<br />%1$s');
} }
$date = mysql2date(get_option('date_format'), $post->post_date); $date = date_i18n( $datef, strtotime( $post->post_date ) );
$time = mysql2date(get_option('time_format'), $post->post_date);
} else { // draft (no saves, and thus no date specified) } else { // draft (no saves, and thus no date specified)
$stamp = __('Publish immediately'); $stamp = __('Publish immediately');
$date = mysql2date(get_option('date_format'), current_time('mysql')); $date = date_i18n( $datef, strtotime( current_time('mysql') ) );
$time = mysql2date(get_option('time_format'), current_time('mysql'));
} }
?> ?>
<?php if ( $can_publish ) : // Contributors don't get to choose the date of publish ?> <?php if ( $can_publish ) : // Contributors don't get to choose the date of publish ?>
<div class="misc-pub-section curtime"> <div class="misc-pub-section curtime">
<span id="timestamp"><?php printf($stamp, $date, $time); ?></span> <span id="timestamp"><?php printf($stamp, $date); ?></span>
&nbsp;<a href="#edit_timestamp" class="edit-timestamp hide-if-no-js" tabindex='4'><?php _e('Edit') ?></a> &nbsp;<a href="#edit_timestamp" class="edit-timestamp hide-if-no-js" tabindex='4'><?php _e('Edit') ?></a>
<div id="timestampdiv" class="hide-if-js"><?php touch_time(($action == 'edit'),1,4); ?></div> <div id="timestampdiv" class="hide-if-js"><?php touch_time(($action == 'edit'),1,4); ?></div>
</div> </div>
<?php endif; ?> <?php endif; ?>
<div class="misc-pub-section misc-pub-section-last"><label for="post_status"><?php _e('Status:') ?></label> <div class="misc-pub-section misc-pub-section-last"><label for="post_status"><?php _e('Status:') ?></label>
<strong><span id="post-status-display"> <b><span id="post-status-display">
<?php <?php
switch ( $post->post_status ) { switch ( $post->post_status ) {
case 'publish': case 'publish':
@ -128,7 +131,7 @@ switch ( $post->post_status ) {
break; break;
} }
?> ?>
</span></strong> </span></b>
<?php if ( 'publish' == $post->post_status || 'private' == $post->post_status ) { ?> <?php if ( 'publish' == $post->post_status || 'private' == $post->post_status ) { ?>
<a href="#post_status" class="edit-post-status hide-if-no-js" tabindex='4'><?php _e('Edit') ?></a> <a href="#post_status" class="edit-post-status hide-if-no-js" tabindex='4'><?php _e('Edit') ?></a>
@ -167,12 +170,10 @@ if ( $can_publish OR ( $post->post_status == 'publish' AND current_user_can('edi
</div> </div>
<div id="minor-publishing-actions"> <div id="minor-publishing-actions">
<?php if ( 'publish' == $post->post_status || 'private' == $post->post_status )
$savebtn = attribute_escape( __('Update Post') ); <?php if ( 'publish' != $post->post_status && 'private' != $post->post_status ) { ?>
else <input type="submit" name="save" id="save-post" value="<?php echo attribute_escape( __('Save Draft') ); ?>" tabindex="4" class="button button-highlighted" />
$savebtn = attribute_escape( __('Save Draft') ); <?php } ?>
?>
<input type="submit" name="save" id="save-post" value="<?php echo $savebtn; ?>" tabindex="4" class="button button-highlighted" />
<?php if ( 'publish' == $post->post_status ) { ?> <?php if ( 'publish' == $post->post_status ) { ?>
<a class="preview button" href="<?php echo clean_url(get_permalink($post->ID)); ?>" target="_blank" tabindex="4"><?php _e('View Post'); ?></a> <a class="preview button" href="<?php echo clean_url(get_permalink($post->ID)); ?>" target="_blank" tabindex="4"><?php _e('View Post'); ?></a>
@ -182,7 +183,6 @@ else
</div> </div>
<div class="clear"></div> <div class="clear"></div>
</div> </div>
<!--</div>-->
<div id="major-publishing-actions"> <div id="major-publishing-actions">
<?php do_action('post_submitbox_start'); ?> <?php do_action('post_submitbox_start'); ?>
@ -201,12 +201,13 @@ if ( !in_array( $post->post_status, array('publish', 'future') ) || 0 == $post->
<?php else : ?> <?php else : ?>
<input name="publish" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php _e('Submit for Review') ?>" /> <input name="publish" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php _e('Submit for Review') ?>" />
<?php endif; ?> <?php endif; ?>
<?php } else { ?>
<input name="save" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php _e('Update Post') ?>" />
<?php } ?> <?php } ?>
</div> </div>
</div>
<div class="clear"></div> <div class="clear"></div>
</div> </div>
</div>
<?php <?php
} }

View File

@ -208,13 +208,16 @@ table#availablethemes td.bottom {
} }
#misc-publishing-actions { #misc-publishing-actions {
width: 69%;
float: left; float: left;
border-right: 1px solid #ddd; border-right: 1px solid #ddd;
} }
#side-sortables #misc-publishing-actions {
max-width: 170px;
}
.misc-pub-section { .misc-pub-section {
padding: 6px 0; padding: 6px;
border-bottom: 1px solid #ddd; border-bottom: 1px solid #ddd;
} }
@ -223,42 +226,52 @@ table#availablethemes td.bottom {
} }
#minor-publishing-actions { #minor-publishing-actions {
width: 30%; padding: 6px 6px 0 0;
float: right; float: right;
text-align: right; text-align: right;
} }
#save-post {
float: right;
margin-bottom: 10px;
}
.preview { .preview {
float: right; float: right;
clear: right;
padding: 2px 8px !important; padding: 2px 8px !important;
top: 10px;
position: relative;
} }
#minor-publishing { #minor-publishing {
margin-top: -10px;
border-bottom: 1px solid #ddd; border-bottom: 1px solid #ddd;
} }
#major-publishing-actions { #major-publishing-actions {
background: #eaf2fa; background: #eaf2fa;
padding-top: 8px; padding: 6px;
clear: both; clear: both;
} }
#minor-publishing-actions input,
#major-publishing-actions input,
#minor-publishing-actions .preview {
min-width: 80px;
text-align: center;
}
#delete-action { #delete-action {
line-height: 25px; line-height: 25px;
vertical-align: middle; vertical-align: middle;
text-align: left; text-align: left;
float: left; float: left;
width: 30%; width: 30%;
background: #eaf2fa;
} }
#publishing-action { #publishing-action {
text-align: right; text-align: right;
float: right; float: right;
width: 70%; width: 70%;
background: #eaf2fa;
} }
.side-info { .side-info {
@ -299,6 +312,9 @@ table#availablethemes td.bottom {
-webkit-border-radius: 11px; -webkit-border-radius: 11px;
border-radius: 11px; border-radius: 11px;
-moz-box-sizing: content-box; -moz-box-sizing: content-box;
-webkit-box-sizing: content-box;
-khtml-box-sizing: content-box;
box-sizing: content-box;
} }
a.button { a.button {
@ -322,10 +338,6 @@ a.button {
width: 150px; width: 150px;
} }
#publish {
min-width: 100px;
}
#wpcontent select { #wpcontent select {
font: 12px/20px "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, sans-serif; font: 12px/20px "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, sans-serif;
padding: 2px; padding: 2px;
@ -399,6 +411,7 @@ textarea.all-options, input.all-options {
outline: none; outline: none;
-moz-box-sizing: border-box; -moz-box-sizing: border-box;
-webkit-box-sizing: border-box; -webkit-box-sizing: border-box;
-khtml-box-sizing: border-box;
box-sizing: border-box; box-sizing: border-box;
} }
@ -1501,6 +1514,10 @@ table.form-table td .updated {
margin: 0 6px 6px; margin: 0 6px 6px;
} }
#poststuff #submitdiv .inside {
margin: 0;
}
#titlediv, #poststuff .postarea { #titlediv, #poststuff .postarea {
margin-bottom: 20px; margin-bottom: 20px;
} }