Making WordPress.org

Changeset 13093


Ignore:
Timestamp:
01/08/2024 06:09:16 PM (13 months ago)
Author:
amieiro
Message:

Translate: Add a flag to the inactive projects in the consistency tool.

File:
1 edited

Legend:

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

    r13087 r13093  
    145145                $project_name = $result->project_name;
    146146                $parent_project_id = $result->project_parent_id;
     147                $is_active = $result->active;
    147148                while ( $parent_project_id ) {
    148149                    $parent_project = GP::$project->get( $parent_project_id );
    149150                    $parent_project_id = $parent_project->parent_project_id;
    150151                    $project_name = "{$parent_project->name} - {$project_name}";
     152                    $is_active = $is_active && $parent_project->active;
    151153                }
    152154
     
    159161                }
    160162
     163                if( ! $is_active ) {
     164                    $active_text = '';
     165                } else {
     166                    $active_text = sprintf(
     167                        ' <span class="dashicons dashicons-flag"></span><span class="inactive">%s</span>',
     168                        esc_translation( '(inactive)' )
     169                    );
     170                }
     171
    161172                printf(
    162173                    '<tr class="%s"><td>%s</td><td>%s</td></tr>',
     
    164175                    sprintf(
    165176                        '<div class="string">%s%s</div>
    166                         <div class="meta">Project: <a href="/projects/%s/%s/">%s</a></div>',
     177                        <div class="meta">Project: <a href="/projects/%s/%s/">%s</a>%s</div>',
    167178                        esc_translation( $result->original_singular ),
    168179                        $original_context,
    169180                        $result->project_path,
    170181                        $set,
    171                         $project_name
    172                     ),
     182                        $project_name,
     183                        $active_text
     184                ),
    173185                    sprintf(
    174186                        '<div class="string%s">%s</div>
Note: See TracChangeset for help on using the changeset viewer.