Making WordPress.org

Changeset 3285


Ignore:
Timestamp:
06/01/2016 02:55:27 PM (10 years ago)
Author:
ocean90
Message:

Translate: Bring header in line with the header of make/polyglots.

Location:
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/inc/class-plugin.php

    r3014 r3285  
    4141                add_filter( 'pre_handle_404', array( $this, 'short_circuit_handle_404' ) );
    4242                add_action( 'wp_default_scripts', array( $this, 'bump_script_versions' ) );
     43                add_action( 'after_setup_theme', array( $this, 'after_setup_theme' ) );
     44                add_filter( 'body_class', array( $this, 'wporg_add_make_site_body_class' ) );
    4345
    4446                // Load the API endpoints.
     
    5153
    5254        /**
     55         * Registers a menu location for a sub-navigation.
     56         */
     57        public function after_setup_theme() {
     58                register_nav_menu( 'wporg_header_subsite_nav', 'WordPress.org Header Sub-Navigation' );
     59        }
     60
     61        /**
     62         * Adds the CSS classes from make/polyglots to the body to sync the headline icon.
     63         */
     64        function wporg_add_make_site_body_class( $classes ) {
     65                $classes[] = 'wporg-make';
     66                $classes[] = 'make-polyglots';
     67                return $classes;
     68        }
     69
     70        /**
    5371         * Registers CLI commands if WP-CLI is loaded.
    5472         */
    55         function register_cli_commands() {
     73        public function register_cli_commands() {
    5674                WP_CLI::add_command( 'wporg-translate init-locale', __NAMESPACE__ . '\CLI\Init_Locale' );
    5775        }
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/templates/header.php

    r2948 r3285  
    44require WPORGPATH . 'header.php';
    55?>
    6         <script type="text/javascript">document.body.className = document.body.className.replace('no-js','js');</script>
     6<script type="text/javascript">document.body.className = document.body.className.replace('no-js','js');</script>
     7
    78<div id="headline">
    89        <div class="wrapper">
    9                 <h2><a href="//make.wordpress.org/polyglots/">Translating WordPress</a></h2>
    10                 <span id="hello">
    11                 <a class="menu-link" href="//make.wordpress.org/polyglots/">Blog</a>
    12                 <a class="menu-link" href="//make.wordpress.org/polyglots/teams/">Teams</a>
    13                 <a class="menu-link" href="//make.wordpress.org/polyglots/handbook/">Translator Handbook</a>
     10                <h2><a href="<?php echo home_url( '/' ); ?>"><?php bloginfo( 'name' ); ?></a></h2>
    1411                <?php
    15                 if ( is_user_logged_in() ):
    16                         $user = wp_get_current_user();
    17 
    18                         printf( __('Hi, %s.'), '<a href="'.gp_url( '/settings' ).'">'.$user->user_login.'</a>' );
     12                wp_nav_menu( array(
     13                        'theme_location' => 'wporg_header_subsite_nav',
     14                        'fallback_cb'    => '__return_false'
     15                ) );
     16                ?>
     17        </div>
     18        <div class="wrapper">
     19                <ul class="translate-meta-nav">
     20                        <?php
     21                        if ( is_user_logged_in() ) {
     22                                $user = wp_get_current_user();
     23                                printf(
     24                                        '<li>logged in as %s</li>',
     25                                        '<a href="' . esc_url( gp_url_profile( $user->user_login ) ) . '">@' . esc_html( $user->user_nicename ) . '</a>'
     26                                );
     27                                ?>
     28                                <li><a href="<?php echo esc_url( gp_url( '/settings' ) ); ?>">Settings</a></li>
     29                                <li><a href="<?php echo esc_url( wp_logout_url( home_url( '/' ) ) ); ?>">Log out</a></li>
     30                                <?php
     31                        } else {
     32                                ?>
     33                                <li><a href="<?php echo esc_url( wp_login_url() ); ?>"><strong>Log in</strong></a></li>
     34                                <?php
     35                        }
    1936                        ?>
    20                         <a href="<?php echo esc_url( wp_logout_url( home_url( '/' ) ) ); ?>"><?php _e( 'Log out' ); ?></a>
    21                 <?php else: ?>
    22                         <strong><a href="<?php echo esc_url( wp_login_url() ); ?>"><?php _e( 'Log in' ); ?></a></strong>
    23                 <?php endif; ?>
    24                 <?php do_action( 'after_hello' ); ?>
    25                 </span>
     37                        </ul>
    2638        </div>
    2739</div>
     40
    2841<div class="gp-content">
    2942
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/templates/style.css

    r3003 r3285  
    1 html, body {
     1/* Secondary header design */
     2#headline .menu {
     3        list-style: none;
     4        float: right;
     5        font-size: 14px;
     6        font-weight: bold;
     7        padding-top: 22px;
     8        margin-right: 15px;
     9}
     10
     11#headline .menu li {
     12        display: inline;
     13        padding-left: 20px;
     14}
     15
     16/* Responsive design for secondary header */
     17@media (max-width: 480px) {
     18        #headline h2 {
     19                margin-left: 6px;
     20                font-size: 20px;
     21        }
     22
     23        #headline h2 a:before {
     24                font-size: 20px;
     25                width: 24px;
     26        }
     27}
     28
     29@media (max-width: 770px) {
     30        #headline {
     31                height: auto;
     32        }
     33
     34        #headline h2 {
     35                float: none;
     36        }
     37
     38        #headline .menu {
     39                float: left;
     40                margin: 0;
     41                padding: 8px 0;
     42                background: #f5f5f5;
     43                border-top: 1px solid #d7d7d7;
     44                width: 100%;
     45        }
     46}
     47
     48.wrapper {
     49        position: relative;
     50}
     51
     52ul.translate-meta-nav {
     53        list-style: none;
    254        margin: 0;
     55        padding: 0;
     56        font-size: 12px;
     57        text-align: right;
     58}
     59
     60#headline ul.translate-meta-nav a {
     61        color: #0073aa;
     62}
     63
     64#headline ul a:hover,
     65#headline ul a:focus {
     66        color: #00a0d2;
     67}
     68
     69@media (min-width: 771px) {
     70        ul.translate-meta-nav {
     71                position: absolute;
     72                bottom: -18px;
     73                right: 6px;
     74        }
     75}
     76
     77ul.translate-meta-nav li {
     78        display: inline-block;
     79        margin: 0 8px
    380}
    481
     
    36113.actionlist a:visited,
    37114.gp-content a {
    38         color: #0074a2;
     115        color: #0073aa;
    39116}
    40117
    41118.gp-content a:hover {
    42         color: #2ea2cc;
     119        color: #00a0d2;
    43120        text-decoration: none;
    44121}
     
    185262
    186263.gp-content .meta a {
    187         color: #0074a2;
     264        color: #0073aa;
    188265        border-bottom: 0;
    189266}
    190267
    191268.gp-content .meta a:hover {
    192         color: #2ea2cc;
     269        color: #00a0d2;
    193270        border-bottom: 0;
    194271}
     
    12951372        cursor: pointer;
    12961373        font: inherit;
    1297         color: #0074a2;
     1374        color: #0073aa;
    12981375}
    12991376
    13001377.button-link:hover {
    1301         color: #2ea2cc;
     1378        color: #00a0d2;
    13021379}
    13031380
Note: See TracChangeset for help on using the changeset viewer.