WordPress.org

Make WordPress Core

Changeset 9394


Ignore:
Timestamp:
10/29/2008 06:00:22 AM (12 years ago)
Author:
markjaquith
Message:

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

Location:
trunk/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/edit-form-advanced.php

    r9384 r9394  
    7171<div class="submitbox" id="submitpost">
    7272
    73 <!--<div class="inside-submitbox">-->
    74 
    7573<div id="minor-publishing">
    7674<div id="misc-publishing-actions">
     75
     76<?php // Hidden submit button early on so that the browser chooses the right button when form is submitted with Return key ?>
     77<div style="display:none;">
     78<input type="submit" name="save" value="<?php echo attribute_escape( __('Save') ); ?>" />
     79</div>
     80
    7781<?php if ( $can_publish && current_user_can( 'edit_others_posts' ) ) { ?>
    7882    <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>
     
    8084
    8185<div class="misc-pub-section" id="visibility">
    82 <?php _e('Visibility:'); ?> <?php _e('Public'); // TODO: dropdown ?>
    83 </div>
    84 
    85 <?php
     86<?php _e('Visibility:'); ?> <b><?php _e('Public'); // TODO: dropdown ?></b>
     87</div>
     88
     89<?php
     90$datef = _c( 'M j, Y \a\t G:i|Publish box date format');
    8691if ( 0 != $post->ID ) {
    8792    if ( 'future' == $post->post_status ) { // scheduled for publishing at a future date
    88         $stamp = __('Scheduled for: %1$s at %2$s');
     93        $stamp = __('Scheduled for:<br />%1$s');
    8994    } else if ( 'publish' == $post->post_status ) { // already published
    90         $stamp = __('Published on: %1$s at %2$s');
     95        $stamp = __('Published on:<br />%1$s');
    9196    } else if ( '0000-00-00 00:00:00' == $post->post_date_gmt ) { // draft, 1 or more saves, no date specified
    9297        $stamp = __('Publish immediately');
    9398    } else { // draft, 1 or more saves, date specified
    94         $stamp = __('Publish on: %1$s at %2$s');
     99        $stamp = __('Publish on:<br />%1$s');
    95100    }
    96     $date = mysql2date(get_option('date_format'), $post->post_date);
    97     $time = mysql2date(get_option('time_format'), $post->post_date);
     101    $date = date_i18n( $datef, strtotime( $post->post_date ) );
    98102} else { // draft (no saves, and thus no date specified)
    99103    $stamp = __('Publish immediately');
    100     $date = mysql2date(get_option('date_format'), current_time('mysql'));
    101     $time = mysql2date(get_option('time_format'), current_time('mysql'));
     104    $date = date_i18n( $datef, strtotime( current_time('mysql') ) );
    102105}
    103106?>
    104107<?php if ( $can_publish ) : // Contributors don't get to choose the date of publish ?>
    105108<div class="misc-pub-section curtime">
    106     <span id="timestamp"><?php printf($stamp, $date, $time); ?></span>
     109    <span id="timestamp"><?php printf($stamp, $date); ?></span>
    107110    &nbsp;<a href="#edit_timestamp" class="edit-timestamp hide-if-no-js" tabindex='4'><?php _e('Edit') ?></a>
    108111    <div id="timestampdiv" class="hide-if-js"><?php touch_time(($action == 'edit'),1,4); ?></div>
     
    111114
    112115<div class="misc-pub-section misc-pub-section-last"><label for="post_status"><?php _e('Status:') ?></label>
    113 <strong><span id="post-status-display">
     116<b><span id="post-status-display">
    114117<?php
    115118switch ( $post->post_status ) {
     
    129132}
    130133?>
    131 </span></strong>
     134</span></b>
    132135<?php if ( 'publish' == $post->post_status || 'private' == $post->post_status ) { ?>
    133136<a href="#post_status" class="edit-post-status hide-if-no-js" tabindex='4'><?php _e('Edit') ?></a>
     
    168171
    169172<div id="minor-publishing-actions">
    170 <?php if ( 'publish' == $post->post_status || 'private' == $post->post_status )
    171     $savebtn = attribute_escape( __('Update Post') );
    172 else
    173     $savebtn = attribute_escape( __('Save Draft') );
    174 ?>
    175 <input type="submit" name="save" id="save-post" value="<?php echo $savebtn; ?>" tabindex="4" class="button button-highlighted" />
     173
     174<?php if ( 'publish' != $post->post_status && 'private' != $post->post_status )  { ?>
     175<input type="submit" name="save" id="save-post" value="<?php echo attribute_escape( __('Save Draft') ); ?>" tabindex="4" class="button button-highlighted" />
     176<?php } ?>
    176177
    177178<?php if ( 'publish' == $post->post_status ) { ?>
     
    183184<div class="clear"></div>
    184185</div>
    185 <!--</div>-->
    186186
    187187<div id="major-publishing-actions">
     
    202202    <input name="publish" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php _e('Submit for Review') ?>" />
    203203<?php endif; ?>
    204 <?php } ?>
    205 </div>
    206 </div>
    207 
     204<?php } else { ?>
     205    <input name="save" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php _e('Update Post') ?>" />
     206<?php } ?>
     207</div>
    208208<div class="clear"></div>
     209</div>
    209210</div>
    210211
  • trunk/wp-admin/wp-admin.css

    r9393 r9394  
    209209
    210210#misc-publishing-actions {
    211     width: 69%;
    212211    float: left;
    213212    border-right: 1px solid #ddd;
    214213}
    215214
     215#side-sortables #misc-publishing-actions {
     216    max-width: 170px;
     217}
     218
    216219.misc-pub-section {
    217     padding: 6px 0;
     220    padding: 6px;
    218221    border-bottom: 1px solid #ddd;
    219222}
     
    224227
    225228#minor-publishing-actions {
    226     width: 30%;
     229    padding: 6px 6px 0 0;
    227230    float: right;
    228231    text-align: right;
    229232}
    230233
     234#save-post {
     235    float: right;
     236    margin-bottom: 10px;
     237}
     238
    231239.preview {
    232240    float: right;
     241    clear: right;
    233242    padding: 2px 8px !important;
    234     top: 10px;
    235     position: relative;
    236243}
    237244
    238245#minor-publishing {
     246    margin-top: -10px;
    239247    border-bottom: 1px solid #ddd;
    240248}
     
    242250#major-publishing-actions {
    243251    background: #eaf2fa;
    244     padding-top: 8px;
     252    padding: 6px;
    245253    clear: both;
     254}
     255
     256#minor-publishing-actions input,
     257#major-publishing-actions input,
     258#minor-publishing-actions .preview {
     259    min-width: 80px;
     260    text-align: center;
    246261}
    247262
     
    252267    float: left;
    253268    width: 30%;
    254     background: #eaf2fa;
    255269}
    256270
     
    259273    float: right;
    260274    width: 70%;
    261     background: #eaf2fa;
    262275}
    263276
     
    300313    border-radius: 11px;
    301314    -moz-box-sizing: content-box;
     315    -webkit-box-sizing: content-box;
     316    -khtml-box-sizing: content-box;
     317    box-sizing: content-box;
    302318}
    303319
     
    321337.tablenav select#cat {
    322338    width: 150px;
    323 }
    324 
    325 #publish {
    326     min-width: 100px;
    327339}
    328340
     
    400412    -moz-box-sizing: border-box;
    401413    -webkit-box-sizing: border-box;
     414    -khtml-box-sizing: border-box;
    402415    box-sizing: border-box;
    403416}
     
    15001513    font-size: 11px;
    15011514    margin: 0 6px 6px;
     1515}
     1516
     1517#poststuff #submitdiv .inside {
     1518    margin: 0;
    15021519}
    15031520
Note: See TracChangeset for help on using the changeset viewer.