Making WordPress.org

Changeset 12406


Ignore:
Timestamp:
02/20/2023 02:56:09 PM (4 years ago)
Author:
amieiro
Message:

Translate: Add 4 tabs in the right sidebar of each translation row

Location:
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/templates
Files:
1 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/templates/helper-functions.php

    r12287 r12406  
    88);
    99gp_enqueue_style( 'wporg-translate' );
    10 
    11 /* todo: remove this code and the style-full-width.css file after the tests */
    12 if ( isset( $_GET['full-width'] ) && 'true' == $_GET['full-width'] ) {
    13         wp_register_style(
    14                 'wporg-translate-full-width',
    15                 plugins_url( 'style-full-width.css', __FILE__ ),
    16                 [ 'gp-base', 'wporg-style', 'wporg-translate' ],
    17                 filemtime( __DIR__ . '/style-full-width.css' )
    18         );
    19         gp_enqueue_style( 'wporg-translate-full-width' );
    20 }
    2110
    2211gp_enqueue_script( 'jquery' );
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/templates/stats-overview.php

    r12287 r12406  
    1111?>
    1212<div class="stats-table">
    13 
    14 <?php /* todo: remove this code and the style-full-width.css file after the tests */
    15 if ( ! ( ( isset( $_GET['full-width'] ) && 'true' == $_GET['full-width'] ) ) ): ?>
    1613        <style>
    17         .gp-content {
    18                 max-width: 95%;
    19         }
     14                .gp-content {
     15                        max-width: 95%;
     16                }
    2017        </style>
    21 <?php endif; ?>
    2218        <table id="stats-table" class="table">
    2319                <thead>
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/templates/style.css

    r12070 r12406  
    3030}
    3131
    32 .gp-content table tbody tr:nth-child(2n):not(:hover) {
     32.gp-content table tbody tr:nth-child(2n):not(:hover, .preview) {
    3333        background-color: unset;
    3434}
    … …  
    177177.site-header .site-branding {
    178178        margin: 0 auto;
    179         max-width: 1200px;
    180         padding: 0 10px;
     179        max-width: 1600px;
     180        padding: 0 20px;
    181181}
    182182
    … …  
    239239.navigation-main {
    240240        background: transparent;
    241         max-width: 1200px;
     241        max-width: 1600px;
    242242        height: 32px;
    243243        margin: -32px auto 0 auto;
    … …  
    479479.gp-content {
    480480        margin: 20px auto;
    481         max-width: 1200px;
    482         padding: 0 10px;
     481        max-width: 1600px;
     482        padding: 0 20px;
    483483}
    484484
    … …  
    650650}
    651651
    652 @media screen and (min-width: 700px) {
     652@media screen and (min-width: 1024px) {
    653653        table.glossary .editor .strings {
    654654                width: 60%;
    … …  
    900900        }
    901901
    902         @media screen and (min-width: 700px) {
     902        @media screen and (min-width: 1024px) {
    903903                .locales {
    904904                        -ms-grid-columns: 1fr 30px 1fr 30px 1fr;
    905905                        grid-template-columns: repeat(3, 1fr);
     906                }
     907        }
     908
     909        @media screen and (min-width: 1300px) {
     910                .locales {
     911                        -ms-grid-columns: 1fr 30px 1fr 30px 1fr;
     912                        grid-template-columns: repeat(4, 1fr);
    906913                }
    907914        }
    … …  
    10791086        .projects {
    10801087                grid-template-columns: repeat( 3, minmax( 0, 1fr ) );
     1088        }
     1089}
     1090
     1091@media screen and (min-width: 1500px) {
     1092        .projects {
     1093                grid-template-columns: repeat( 4, minmax( 0, 1fr ) );
    10811094        }
    10821095}
    … …  
    15071520
    15081521/* Responsive styles */
    1509 @media screen and (max-width: 700px) {
     1522@media screen and (max-width: 1024px) {
    15101523        #hello {
    15111524                margin: 25px 10px 15px;
    … …  
    23252338        width: 100%;
    23262339        margin: 0;
    2327         padding: 20px 10px;
     2340        padding: 0 10px 20px 10px;
    23282341}
    23292342
    … …  
    23712384}
    23722385
    2373 @media screen and (min-width: 700px) {
     2386@media screen and (min-width: 1024px) {
    23742387        .editor-panel {
    23752388                display: flex;
    … …  
    23842397}
    23852398
    2386 @media screen and (min-width: 700px) {
     2399@media screen and (min-width: 1024px) {
    23872400        .editor-panel__left {
    23882401                border-bottom: 0;
    … …  
    23962409}
    23972410
    2398 @media screen and (min-width: 700px) {
     2411@media screen and (min-width: 1024px) {
    23992412        .editor-panel__right {
     2413                min-width: 40%;
    24002414                position: -webkit-sticky;
    24012415                position: sticky;
    … …  
    24142428}
    24152429
    2416 @media screen and (min-width: 700px) {
     2430@media screen and (max-width: 1023px) {
     2431        .editor-panel__left {
     2432                width: 100%;
     2433        }
     2434        .editor-panel__right {
     2435                width: 100%;
     2436        }
     2437}
     2438
     2439@media screen and (min-width: 1024px) {
    24172440        .panel-header {
    24182441                height: 40px;
    … …  
    30713094        background-size: 15px 4px;
    30723095}
     3096
     3097/* translate.w.org CSS. Class: .wporg-make */
     3098ul.sidebar-tabs {
     3099        display: inherit;
     3100}
     3101
     3102.editor .nav-sidebar {
     3103        width: 100%;
     3104        overflow: auto;
     3105}
     3106
     3107.sidebar-tabs > li {
     3108        padding: 8px 15px 7px 15px;
     3109}
     3110
     3111.editor .nav-sidebar .meta {
     3112        border: 0;
     3113        border-top: 1px solid #72777C;
     3114}
     3115
     3116.sidebar-tabs li.current {
     3117        border: 1px solid #72777C;
     3118        border-bottom: 1px solid #fff;
     3119        margin-top: -1px;
     3120}
     3121
     3122.meta,
     3123.meta.discussion,
     3124.meta.history,
     3125.meta.other-locales {
     3126        padding: 12px;
     3127}
     3128
     3129.meta.discussion .comment-respond:not(.hide-textarea) {
     3130        padding: 0;
     3131}
     3132
     3133.meta.discussion .optin-message-for-each-discussion :not(.hide-textarea) {
     3134        padding: 1rem 0;
     3135}
     3136
     3137.meta.history td:nth-child(1),
     3138.meta.history td:nth-child(3),
     3139.meta.history td:nth-child(4) {
     3140        text-align: center;
     3141        vertical-align: middle;
     3142        overflow: hidden;
     3143}
     3144
     3145.meta.history th,
     3146.meta.history td {
     3147        padding: 4px !important;
     3148        border: 1px solid #72777C !important;
     3149}
     3150
     3151.meta.history th:nth-child(1) {
     3152        width: 20%;
     3153        vertical-align: middle;
     3154}
     3155
     3156.meta.history  th:nth-child(2) {
     3157        width: 50%;
     3158        vertical-align: middle;
     3159}
     3160
     3161.meta.history th:nth-child(3),
     3162.meta.history th:nth-child(4) {
     3163        width: 15%;
     3164        vertical-align: middle;
     3165}
     3166
     3167.meta.other-locales ul {
     3168        margin: 0;
     3169        padding: 0;
     3170}
     3171
     3172.meta.other-locales .locale.unique, .meta.other-locales .other-locales .locale {
     3173        width: 6rem;
     3174        background: #0073aa;
     3175        margin-right: 10px !important;
     3176}
     3177
     3178@media screen and (max-width: 530px), (min-width: 1024px) and (max-width: 1280px) {
     3179        .editor-panel__right .tab-meta,
     3180        .editor-panel__right .tab-discussion,
     3181        .editor-panel__right .tab-history,
     3182        .editor-panel__right .tab-other-locales {
     3183                white-space: nowrap;
     3184                width: 90px;
     3185                overflow: hidden;
     3186                text-overflow: ellipsis;
     3187                vertical-align: top;
     3188        }
     3189}
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/templates/translation-row-editor.php

    r12074 r12406  
    239239
    240240                        <div class="editor-panel__right">
    241                                 <div class="panel-header">
    242                                         <h3><?php _e( 'Meta', 'glotpress' ); ?></h3>
    243                                 </div>
     241<!--                            <div class="panel-header">
     242                                        <h3><?php /*_e( 'Meta', 'glotpress' ); */?></h3>
     243                                </div>-->
    244244                                <div class="panel-content">
    245                                         <div class="meta">
     245                                        <?php ob_start(); ?>
     246                    <div class="meta" id="sidebar-div-meta-<?php echo $translation->row_id ?>">
    246247                                                <?php gp_tmpl_load( 'translation-row-editor-meta-feedback', get_defined_vars() ); ?>
    247248                                                <?php if ( $translation->translation_status && ( $can_approve_translation || $can_reject_self ) ): ?>
    … …  
    328329                                                </dl>
    329330                                        </div>
     331                                        <?php
     332                                        $meta_sidebar = ob_get_clean();
     333
     334                                        $sidebar_tabs  = '<nav class="nav-sidebar">';
     335                                        $sidebar_tabs .= '<ul class="sidebar-tabs">';
     336                                        $sidebar_tabs .= '      <li class="current tab-meta" data-tab="sidebar-tab-meta-' . $translation->row_id . '" data-row-id="' . $translation->row_id . '">Meta</li>';
     337                                        $sidebar_tabs .= '      <li class="tab-discussion" data-tab="sidebar-tab-discussion-' . $translation->row_id . '" data-row-id="' . $translation->row_id . '">Discussion&nbsp;<span class="count"></span></li>';
     338                                        $sidebar_tabs .= '      <li class="tab-history" data-tab="sidebar-tab-history-' . $translation->row_id . '" data-row-id="' . $translation->row_id . '">History&nbsp;<span class="count"></span></li>';
     339                                        $sidebar_tabs .= '      <li class="tab-other-locales" data-tab="sidebar-tab-other-locales-' . $translation->row_id . '" data-row-id="' . $translation->row_id . '">Other&nbsp;locales&nbsp;<span class="count"></span></li>';
     340                                        $sidebar_tabs .= '</ul>';
     341                                        $sidebar_tabs .= $meta_sidebar;
     342                                        $sidebar_tabs .= '<div class="meta discussion" id="sidebar-div-discussion-' . $translation->row_id . '"  data-row-id="' . $translation->row_id . '" style="display: none;"></div>';
     343                                        $sidebar_tabs .= '<div class="meta history" id="sidebar-div-history-' . $translation->row_id . '"  data-row-id="' . $translation->row_id . '" style="display: none;"></div>';
     344                                        $sidebar_tabs .= '<div class="meta other-locales" id="sidebar-div-other-locales-' . $translation->row_id . '"  data-row-id="' . $translation->row_id . '" style="display: none;"></div>';
     345                                        $sidebar_tabs .= '</nav>';
     346
     347                                        // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
     348                                        echo $sidebar_tabs;
     349                                        ?>
    330350
    331351                                        <?php do_action( 'wporg_translate_meta', $translation ); ?>
Note: See TracChangeset for help on using the changeset viewer.