Making WordPress.org


Ignore:
Timestamp:
07/12/2015 05:42:47 PM (11 years ago)
Author:
ocean90
Message:

Translate: Further design improvements for project portals.

see #1091.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/translate.wordpress.org/public_html/gp-templates/locale-project.php

    r1721 r1734  
    44$breadcrumb   = array();
    55$breadcrumb[] = gp_link_get( '/', __( 'Locales' ) );
    6 $breadcrumb[] = gp_link_get( gp_url_join( '/locale', $locale_slug, $set_slug), esc_html( $locale->english_name ) );
     6$breadcrumb[] = gp_link_get( gp_url_join( '/locale', $locale_slug, $set_slug ), esc_html( $locale->english_name ) );
     7$breadcrumb[] = gp_link_get( gp_url_join( '/locale', $locale_slug, $set_slug, $project->path ), esc_html( $project->name ) );
    78$breadcrumb[] = $sub_project->name;
    89gp_breadcrumb( $breadcrumb );
     
    1314        <p class="project-description"><?php echo $sub_project->description; ?></p>
    1415
    15         <div class="project-box">
     16        <div class="project-box percent-<?php echo $sub_project_status->percent_complete; ?>">
    1617                <div class="project-box-header">
    1718                        <div class="project-icon">
     
    5051
    5152                        <div class="project-status">
    52                                 <?php
    53                                 $percent_complete = floor( $project_status->current_count / $project_status->all_count * 100 );
    54                                 echo $percent_complete . '%';
    55                                 ?>
     53                                <?php echo $sub_project_status->percent_complete . '%'; ?>
    5654                        </div>
    5755                </div>
    5856
    5957                <div class="project-status-progress percent">
    60                         <div class="percent-complete" style="width:<?php echo $percent_complete; ?>%;"></div>
     58                        <div class="percent-complete" style="width:<?php echo $sub_project_status->percent_complete; ?>%;"></div>
    6159                </div>
    6260
    6361                <div class="project-box-footer">
     62                        <ul class="projects-dropdown">
     63                                <li><span>All Sub-Projects</span>
     64                                        <ul>
     65                                                <?php
     66                                                // Show the current project if it has strings.
     67                                                if ( $sub_project_status->all_count ) {
     68                                                        printf(
     69                                                                '<li><a href="%s">%s <span>%s</span></a>',
     70                                                                gp_url_project( $sub_project->path, gp_url_join( $locale->slug, $set_slug ) ),
     71                                                                $sub_project->name,
     72                                                                $sub_project_status->percent_complete . '%'
     73                                                        );
     74                                                }
     75
     76                                                foreach ( $sub_projects as $_sub_project ) {
     77                                                        $status = $sub_project_statuses[ $_sub_project->id ];
     78
     79                                                        printf(
     80                                                                '<li><a href="%s">%s <span>%s</span></a>',
     81                                                                gp_url_project( $_sub_project->path, gp_url_join( $locale->slug, $set_slug ) ),
     82                                                                $_sub_project->name,
     83                                                                $status->percent_complete . '%'
     84                                                        );
     85                                                }
     86                                                ?>
     87                                        </ul>
     88                                </li>
     89                        </ul>
    6490                </div>
    6591        </div>
     
    85111                                        <td class="set-name">
    86112                                                <strong><?php gp_link( gp_url_project( $sub_project->path, gp_url_join( $locale->slug, $set_slug ) ), $sub_project->name ); ?></strong>
    87                                                 <?php if ( $sub_project_status->current_count && $sub_project_status->current_count >= $sub_project_status->all_count * 0.9 ):
    88                                                         $percent = floor( $sub_project_status->current_count / $sub_project_status->all_count * 100 );
     113                                                <?php if ( $sub_project_status->percent_complete > 90 ):
    89114                                                        ?>
    90                                                         <span class="bubble morethan90"><?php echo $percent; ?>%</span>
     115                                                        <span class="bubble morethan90"><?php echo $sub_project_status->percent_complete; ?>%</span>
    91116                                                <?php endif;?>
    92117                                        </td>
     
    116141                                        <td class="set-name">
    117142                                                <strong><?php gp_link( gp_url_project( $sub_project->path, gp_url_join( $locale->slug, $set_slug ) ), $sub_project->name ); ?></strong>
    118                                                 <?php if ( $status->current_count && $status->current_count >= $status->all_count * 0.9 ):
    119                                                         $percent = floor( $status->current_count / $status->all_count * 100 );
     143                                                <?php if ( $status->percent_complete > 90 ):
    120144                                                        ?>
    121                                                         <span class="bubble morethan90"><?php echo $percent; ?>%</span>
     145                                                        <span class="bubble morethan90"><?php echo $status->percent_complete; ?>%</span>
    122146                                                <?php endif;?>
    123147                                        </td>
     
    155179                        }
    156180                });
     181
     182                $( '.projects-dropdown > li' ).on( 'click', function() {
     183                        $( this ).parent( '.projects-dropdown' ).toggleClass( 'open' );
     184                });
    157185        });
    158186</script>
Note: See TracChangeset for help on using the changeset viewer.