Make WordPress Core

Ticket #43481: 43481.7.diff

File 43481.7.diff, 16.2 KB (added by xkon, 7 years ago)

simplifying the page

  • src/wp-admin/css/forms.css

     
    10761076        clear: both;
    10771077}
    10781078
     1079/*------------------------------------------------------------------------------
     1080   Privacy Tools
     1081------------------------------------------------------------------------------*/
    10791082
     1083body.privacy-php #poststuff h2 {
     1084        font-size: 1.3em;
     1085}
     1086
     1087body.privacy-php .create-privacy-policy-box .submit {
     1088        margin-top: 0;
     1089}
     1090
     1091body.privacy-php table .spinner {
     1092        float: none;
     1093        margin: 0 0 0 10px;
     1094}
     1095
     1096body.privacy-php p.submit {
     1097        display: inline-block;
     1098        margin-top: 0;
     1099}
     1100
     1101body.privacy-php #major-publishing-actions input {
     1102        text-align: left;
     1103}
     1104
     1105body.privacy-php .new-request p.submit input {
     1106        margin-top: -5px;
     1107        vertical-align: middle;
     1108}
     1109
    10801110/* =Media Queries
    10811111-------------------------------------------------------------- */
    10821112
  • src/wp-admin/privacy.php

     
    6262
    6363// If a privacy policy page ID is available, make sure the page actually exists. If not, display an error.
    6464$privacy_policy_page_exists = false;
    65 $privacy_policy_page_id = (int) get_option( 'wp_page_for_privacy_policy' );
     65$privacy_policy_page_id     = (int) get_option( 'wp_page_for_privacy_policy' );
    6666
    6767if ( ! empty( $privacy_policy_page_id ) ) {
    68                 $privacy_policy_page = get_post( $privacy_policy_page_id );
    69                 if ( ! $privacy_policy_page instanceof WP_Post ) {
     68        $privacy_policy_page = get_post( $privacy_policy_page_id );
     69        if ( ! $privacy_policy_page instanceof WP_Post ) {
     70                add_settings_error(
     71                        'page_for_privacy_policy',
     72                        'page_for_privacy_policy',
     73                        __( 'The currently selected privacy policy page does not exist. Please create or select new page.' ),
     74                        'error'
     75                );
     76        } else {
     77                if ( 'trash' === $privacy_policy_page->post_status ) {
    7078                        add_settings_error(
    7179                                'page_for_privacy_policy',
    7280                                'page_for_privacy_policy',
    73                                 __( 'The currently selected privacy policy page does not exist. Please create or select new page.' ),
     81                                sprintf(
     82                                        // translators: %s The url to restore the page.
     83                                        __( 'The currently selected privacy policy page is in the trash. Please create or select new privacy policy page or <a href="%s">restore the current page</a>.' ),
     84                                        'edit.php?post_status=trash&post_type=page'
     85                                ),
    7486                                'error'
    7587                        );
    7688                } else {
    77                         if ( 'trash' === $privacy_policy_page->post_status ) {
    78                                 add_settings_error(
    79                                         'page_for_privacy_policy',
    80                                         'page_for_privacy_policy',
    81                                         sprintf(
    82                                                 __( 'The currently selected privacy policy page is in the trash. Please create or select new privacy policy page or <a href="%s">restore the current page</a>.' ),
    83                                                 'edit.php?post_status=trash&post_type=page'
    84                                         ),
    85                                         'error'
    86                                 );
    87                         } else {
    88                                 $privacy_policy_page_exists = true;
    89                         }
     89                        $privacy_policy_page_exists = true;
    9090                }
     91        }
    9192}
    9293
    9394get_current_screen()->add_help_tab( array(
     
    104105require_once( ABSPATH . 'wp-admin/admin-header.php' );
    105106
    106107?>
     108<!-- PAGE WRAP -->
    107109<div class="wrap">
    108         <h1><?php _e( 'Privacy Tools' ); ?></h1>
     110        <h1><?php esc_html_e( 'Privacy' ); ?></h1>
    109111        <?php settings_errors(); ?>
     112        <div id="poststuff">
     113                <div id="post-body" class="metabox-holder">
     114                        <!-- main content -->
     115                        <div id="post-body-content">
     116                                <div class="postbox create-privacy-policy-box">
     117                                        <h2><?php esc_html_e( 'Privacy Policy Page' ); ?></h2>
     118                                        <div class="inside">
     119                                                <?php
     120                                                if ( $privacy_policy_page_exists ) {
     121                                                        $edit_href = add_query_arg(
     122                                                                array(
     123                                                                        'post'   => $privacy_policy_page_id,
     124                                                                        'action' => 'edit',
     125                                                                ),
     126                                                                admin_url( 'post.php' )
     127                                                        );
     128                                                        $view_href = get_permalink( $privacy_policy_page_id );
     129                                                ?>
     130                                                <p>
     131                                                        <strong>
     132                                                                <?php
     133                                                                printf(
     134                                                                        // translators: %1$s Edit url. %2$s View url.
     135                                                                        __( '<a href="%1$s">Edit</a> or <a href="%2$s">view</a> your privacy policy.' ),
     136                                                                        esc_url( $edit_href ),
     137                                                                        esc_url( $view_href )
     138                                                                );
     139                                                                ?>
     140                                                        </strong>
     141                                                </p>
     142                                                <?php
     143                                                }
     144                                                ?>
     145                                                <form method="post" action="">
     146                                                        <input type="hidden" name="action" value="set-privacy-page" />
     147                                                        <p class="post-attributes-label-wrapper">
     148                                                                <label class="post-attributes-label" for="page_for_privacy_policy">
     149                                                                        <?php
     150                                                                        if ( $privacy_policy_page_exists ) {
     151                                                                                esc_html_e( 'Select another page for your privacy policy' );
     152                                                                        } else {
     153                                                                                esc_html_e( 'Select an existing privacy policy page' );
     154                                                                        }
     155                                                                        ?>
     156                                                                </label>
     157                                                        </p>
     158                                                        <?php
     159                                                        wp_dropdown_pages(
     160                                                                array(
     161                                                                        'name'              => 'page_for_privacy_policy',
     162                                                                        'show_option_none'  => __( '&mdash; Select &mdash;' ),
     163                                                                        'option_none_value' => '0',
     164                                                                        'selected'          => $privacy_policy_page_id,
     165                                                                        'post_status'       => array( 'draft', 'publish' ),
     166                                                                )
     167                                                        );
    110168
    111         <h2><?php _e( 'Privacy policy page' ); ?></h2>
     169                                                        wp_nonce_field( 'set-privacy-page' );
     170                                                        submit_button( __( 'Set Page' ), '', 'submit', true, array( 'id' => 'set-page' ) );
     171                                                        ?>
     172                                                </form>
     173                                                <?php
     174                                                if ( ! $privacy_policy_page_exists ) {
     175                                                ?>
     176                                                <form method="post" action="">
     177                                                        <p class="post-attributes-label-wrapper">
     178                                                                <strong><?php esc_html_e( 'Create new page for your privacy policy' ); ?></strong>
     179                                                        </p>
     180                                                        <input type="hidden" name="action" value="create-privacy-page" />
     181                                                        <?php
    112182
    113         <?php
    114         if ( $privacy_policy_page_exists ) {
    115                 $edit_href = add_query_arg(
    116                         array(
    117                                 'post'  => $privacy_policy_page_id,
    118                                 'action' => 'edit',
    119                         ),
    120                         admin_url( 'post.php' )
    121                 );
    122                 $view_href = get_permalink( $privacy_policy_page_id );
     183                                                        wp_nonce_field( 'create-privacy-page' );
     184                                                        submit_button( __( 'Create Page' ), 'primary', 'submit', true, array( 'id' => 'create-page' ) );
    123185
    124                 ?>
    125                 <p><strong>
    126                         <?php
    127                         printf(
    128                                 __( '<a href="%1$s">Edit</a> or <a href="%2$s">view</a> your privacy policy.' ),
    129                                 $edit_href,
    130                                 $view_href
    131                         );
    132                         ?>
    133                 </strong></p>
    134                 <?php
    135         }
    136         ?>
    137 
    138         <table class="form-table">
    139                 <tr>
    140                         <th scope="row">
    141                                 <label for="page_for_privacy_policy">
    142                                         <?php
    143 
    144                                         if ( $privacy_policy_page_exists ) {
    145                                                 _e( 'Select another page for your privacy policy' );
    146                                         } else {
    147                                                 _e( 'Select an existing privacy policy page' );
    148                                         }
    149 
    150                                         ?>
    151                                 </label>
    152                         </th>
    153                         <td id="front-static-pages">
    154                                 <form method="post" action="">
    155                                         <input type="hidden" name="action" value="set-privacy-page" />
    156                                         <?php
    157 
    158                                         wp_dropdown_pages(
    159                                                 array(
    160                                                         'name'              => 'page_for_privacy_policy',
    161                                                         'show_option_none'  => __( '&mdash; Select &mdash;' ),
    162                                                         'option_none_value' => '0',
    163                                                         'selected'          => $privacy_policy_page_id,
    164                                                         'post_status'       => array( 'draft', 'publish' ),
    165                                                 )
    166                                         );
    167 
    168                                         wp_nonce_field( 'set-privacy-page' );
    169                                         submit_button( __( 'Set Page' ), 'primary', 'submit', true, array( 'id' => 'set-page' ) );
    170 
    171                                         ?>
    172                                 </form>
    173                         </td>
    174                 </tr>
    175                 <?php
    176 
    177                 if ( ! $privacy_policy_page_exists ) {
    178                         ?>
    179                         <tr>
    180                                 <th scope="row"><?php _e( 'Create new page for your privacy policy' ); ?></th>
    181                                 <td>
    182                                         <form method="post" action="">
    183                                                 <input type="hidden" name="action" value="create-privacy-page" />
     186                                                        ?>
     187                                                </form>
    184188                                                <?php
    185 
    186                                                 wp_nonce_field( 'create-privacy-page' );
    187                                                 submit_button( __( 'Create Page' ), 'primary', 'submit', true, array( 'id' => 'create-page' ) );
    188 
     189                                                }
    189190                                                ?>
    190                                         </form>
    191                                 </td>
    192                         </tr>
    193                         <?php
    194                 }
    195 
    196                 ?>
    197         </table>
     191                                        </div>
     192                                </div>
     193                                <div class="postbox">
     194                                        <h2><?php esc_html_e( 'Export Requests' ); ?></h2>
     195                                        <div class="inside">
     196                                                <!-- THIS TABLE IS FOR PREVIEW PURPOSES ONLY IT WILL BE REPLACED BY WP_List_Table -->
     197                                                <table class="wp-list-table widefat fixed striped pages">
     198                                                        <thead>
     199                                                                <tr>
     200                                                                        <th scope="col" id="email" class="manage-column column-primary column-email">Email</th>
     201                                                                        <th scope="col" id="requested" class="manage-column column-requested">Requested on</th>
     202                                                                        <th scope="col" id="status" class="manage-column colum-status">Status</th>
     203                                                                </tr>
     204                                                        </thead>
     205                                                        <tbody id="the-list">
     206                                                                <tr id="post-2" class="iedit author-self level-0 post-2 type-page status-publish hentry">
     207                                                                        <td class="email column-email has-row-actions column-primary" data-colname="Email">
     208                                                                                <strong>wp@develop.oo</strong>
     209                                                                                <div class="row-actions">
     210                                                                                        <span class="edit"><a href="">Download</a> | </span>
     211                                                                                        <span class="edit"><a href="">Send via Email</a> | </span>
     212                                                                                        <span class="trash"><a href="">Remove Request</a>
     213                                                                                <button type="button" class="toggle-row"><span class="screen-reader-text">Show more details</span></button>
     214                                                                        </td>
     215                                                                        <td class="requested column-requested" data-colname="Requested">March 16, 2018<br/>10:51 pm</a></td>
     216                                                                        <td class="status column-status" data-colname="Status">Verified</td>
     217                                                                </tr>
     218                                                                <tr id="post-2" class="iedit author-self level-0 post-2 type-page status-publish hentry">
     219                                                                        <td class="email column-email has-row-actions column-primary" data-colname="Email">
     220                                                                                <strong>wp@develop.oo</strong>
     221                                                                                <div class="row-actions">
     222                                                                                        <span class="edit"><a href="">Download</a> | </span>
     223                                                                                        <span class="edit"><a href="">Send via Email</a> | </span>
     224                                                                                        <span class="trash"><a href="">Remove Request</a>
     225                                                                                <button type="button" class="toggle-row"><span class="screen-reader-text">Show more details</span></button>
     226                                                                        </td>
     227                                                                        <td class="requested column-requested" data-colname="Requested">March 16, 2018<br/>10:51 pm</a></td>
     228                                                                        <td class="status column-status" data-colname="Status">Verification Pending</td>
     229                                                                </tr>
     230                                                                <tr id="post-2" class="iedit author-self level-0 post-2 type-page status-publish hentry">
     231                                                                        <td class="email column-email has-row-actions column-primary" data-colname="Email">
     232                                                                                <strong>wp@develop.oo</strong>
     233                                                                                <div class="row-actions">
     234                                                                                        <span class="edit"><a href="">Download</a> | </span>
     235                                                                                        <span class="edit"><a href="">Send via Email</a> | </span>
     236                                                                                        <span class="trash"><a href="">Remove Request</a>
     237                                                                                <button type="button" class="toggle-row"><span class="screen-reader-text">Show more details</span></button>
     238                                                                        </td>
     239                                                                        <td class="requested column-requested" data-colname="Requested">March 16, 2018<br/>10:51 pm</a></td>
     240                                                                        <td class="status column-status" data-colname="Status">Exporting <span class="spinner is-active"></span></td>
     241                                                                </tr>
     242                                                        </tbody>
     243                                                        <tfoot>
     244                                                                <tr>
     245                                                                        <th scope="col" id="email" class="manage-column column-primary column-email">Email</th>
     246                                                                        <th scope="col" id="requested" class="manage-column column-requested">Requested on</th>
     247                                                                        <th scope="col" id="status" class="manage-column colum-status">Status</th>
     248                                                                </tr>
     249                                                        </tfoot>
     250                                                </table>
     251                                                <!-- THIS TABLE IS FOR PREVIEW PURPOSES ONLY IT WILL BE REPLACED BY WP_List_Table -->
     252                                        </div>
     253                                        <!-- manual export request box -->
     254                                        <div id="major-publishing-actions" class="new-request">
     255                                                <h3>Add New Export Request</h3>
     256                                                <form method="post" action="">
     257                                                        <label class="post-attributes-label" for="manual_export_email">
     258                                                                E-mail
     259                                                        </label>
     260                                                        <input type="text" name="action" name="manual_export_email" id="manual_export_email" value="" />
     261                                                        <?php
     262                                                                submit_button( __( 'Add' ), '', 'submit', true, array( 'id' => 'add_export_request' ) );
     263                                                        ?>
     264                                                </form>
     265                                                <p class="description"><?php _e( 'A verification email will be sent to the user at this email address, asking them to verify the request.' ); ?></p>
     266                                                <div class="clear"></div>
     267                                        </div>
     268                                </div>
     269                                <div class="postbox">
     270                                        <h2><?php esc_html_e( 'Erasure / Anonymization Requests' ); ?></h2>
     271                                        <div class="inside">
     272                                                <!-- THIS TABLE IS FOR PREVIEW PURPOSES ONLY IT WILL BE REPLACED BY WP_List_Table -->
     273                                                <table class="wp-list-table widefat fixed striped pages">
     274                                                        <thead>
     275                                                                <tr>
     276                                                                        <th scope="col" id="email" class="manage-column column-primary column-email">Email</th>
     277                                                                        <th scope="col" id="requested" class="manage-column column-requested">Requested on</th>
     278                                                                        <th scope="col" id="status" class="manage-column colum-status">Status</th>
     279                                                                </tr>
     280                                                        </thead>
     281                                                        <tbody id="the-list">
     282                                                                <tr id="post-2" class="iedit author-self level-0 post-2 type-page status-publish hentry">
     283                                                                        <td class="email column-email has-row-actions column-primary" data-colname="Email">
     284                                                                                <strong>wp@develop.oo</strong>
     285                                                                                <div class="row-actions">
     286                                                                                        <span class="edit"><a href="">Anonymize</a> | </span>
     287                                                                                        <span class="trash"><a href="">Remove Request</a>
     288                                                                                <button type="button" class="toggle-row"><span class="screen-reader-text">Show more details</span></button>
     289                                                                        </td>
     290                                                                        <td class="requested column-requested" data-colname="Requested">March 16, 2018<br/>10:51 pm</a></td>
     291                                                                        <td class="status column-status" data-colname="Status">Verified</td>
     292                                                                </tr>
     293                                                                <tr id="post-2" class="iedit author-self level-0 post-2 type-page status-publish hentry">
     294                                                                        <td class="email column-email has-row-actions column-primary" data-colname="Email">
     295                                                                                <strong>wp@develop.oo</strong>
     296                                                                                <div class="row-actions">
     297                                                                                        <span class="edit"><a href="">Anonymize</a> | </span>
     298                                                                                        <span class="trash"><a href="">Remove Request</a>
     299                                                                                <button type="button" class="toggle-row"><span class="screen-reader-text">Show more details</span></button>
     300                                                                        </td>
     301                                                                        <td class="requested column-requested" data-colname="Requested">March 16, 2018<br/>10:51 pm</a></td>
     302                                                                        <td class="status column-status" data-colname="Status">Verification Pending</td>
     303                                                                </tr>
     304                                                                <tr id="post-2" class="iedit author-self level-0 post-2 type-page status-publish hentry">
     305                                                                        <td class="email column-email has-row-actions column-primary" data-colname="Email">
     306                                                                                <strong>wp@develop.oo</strong>
     307                                                                                <div class="row-actions">
     308                                                                                        <span class="edit"><a href="">Anonymize</a> | </span>
     309                                                                                        <span class="trash"><a href="">Remove Request</a>
     310                                                                                <button type="button" class="toggle-row"><span class="screen-reader-text">Show more details</span></button>
     311                                                                        </td>
     312                                                                        <td class="requested column-requested" data-colname="Requested">March 16, 2018<br/>10:51 pm</a></td>
     313                                                                        <td class="status column-status" data-colname="Status">Anonymizing <span class="spinner is-active"></span></td>
     314                                                                </tr>
     315                                                        </tbody>
     316                                                        <tfoot>
     317                                                                <tr>
     318                                                                        <th scope="col" id="email" class="manage-column column-primary column-email">Email</th>
     319                                                                        <th scope="col" id="requested" class="manage-column column-requested">Requested on</th>
     320                                                                        <th scope="col" id="status" class="manage-column colum-status">Status</th>
     321                                                                </tr>
     322                                                        </tfoot>
     323                                                </table>
     324                                                <!-- THIS TABLE IS FOR PREVIEW PURPOSES ONLY IT WILL BE REPLACED BY WP_List_Table -->
     325                                        </div>
     326                                        <!-- manual anonymize request box -->
     327                                        <div id="major-publishing-actions" class="new-request">
     328                                                <h3>Add New Anonymization Request</h3>
     329                                                <form method="post" action="">
     330                                                        <label class="post-attributes-label" for="manual_export_email">
     331                                                                E-mail
     332                                                        </label>
     333                                                        <input type="text" name="action" name="manual_export_email" id="manual_export_email" value="" />
     334                                                        <?php
     335                                                                submit_button( __( 'Add' ), '', 'submit', true, array( 'id' => 'add_export_request' ) );
     336                                                        ?>
     337                                                </form>
     338                                                <p class="description"><?php _e( 'A verification email will be sent to the user at this email address, asking them to verify the request.' ); ?></p>
     339                                                <div class="clear"></div>
     340                                        </div>
     341                                </div>
     342                        </div>
     343                </div>
     344        </div>
    198345</div>
    199 
    200346<?php
    201347
    202348include( ABSPATH . 'wp-admin/admin-footer.php' );