Making WordPress.org

Changeset 2313


Ignore:
Timestamp:
01/18/2016 09:10:41 PM (9 years ago)
Author:
stephdau
Message:

WordPress.org SSO: new custom template handling for login experience.

See #1524: wporg-login theme partof the work.

Location:
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/footer.php

    r2084 r2313  
    55 * @package wporg-login
    66 */
     7?>
     8    </div>
     9    <div class="loginfooter">wordpress.org &nbsp; • &nbsp; code is poetry</div>
     10</div>
    711
    8 require WPORGPATH . 'footer.php';
     12<?php wp_footer(); ?>
     13
     14</body>
     15</html>
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/functions.php

    r2236 r2313  
    4747function wporg_login_replace_css() {
    4848    wp_deregister_style( 'login' );
    49     wp_register_style( 'login', get_stylesheet_directory_uri() . '/login.css', array( 'buttons', 'dashicons', 'open-sans' ), filemtime( __DIR__ . '/login.css' ) );
     49    wp_register_style( 'login', get_stylesheet_directory_uri() . '/stylesheets/login.css', array( 'buttons', 'dashicons', 'open-sans' ), filemtime( __DIR__ . '/login.css' ) );
    5050}
    5151add_action( 'login_init', 'wporg_login_replace_css' );
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/header.php

    r2084 r2313  
    66 */
    77
    8 global $pagetitle, $wporg_global_header_options;
    9 $pagetitle = wp_title( '', false );
    10 wp_enqueue_style( 'blog-wp4', 'https://wordpress.org/style/blog-wp4.css', array(), 12 );
    11 wp_enqueue_style( 'theme', get_stylesheet_uri(), array(), filemtime( __DIR__ . '/style.css' ) );
     8//global $pagetitle, $wporg_global_header_options;
     9//$pagetitle = wp_title( '', false );
    1210
    13 $wporg_global_header_options = array(
    14     'menu' => '',
    15     'search' => '',
    16 );
     11wp_enqueue_style( 'normalize', get_template_directory_uri() . '/stylesheets/normalize.css', array(), filemtime( __DIR__ . '/style.css' ) );
     12wp_enqueue_style( 'custom-login', get_template_directory_uri() . '/stylesheets/login.css', array(), filemtime( __DIR__ . '/style.css' ) );
     13?>
     14<!doctype html>
     15<html class="no-js" lang="">
     16<head>
     17<meta charset="utf-8">
     18<meta http-equiv="x-ua-compatible" content="ie=edge">
     19<title>WordPress.org OAuth Login</title>
     20<meta name="description" content="">
     21<meta name="viewport" content="width=device-width, initial-scale=1">
    1722
    18 require WPORGPATH . 'header.php';
     23<?php wp_head(); ?>
     24</head>
     25<body>
     26
     27<div class="wrapper">
     28    <div class="login">
     29        <h1><a href="https://wordpress.org/" title="WordPress.org" tabindex="-1">WordPress.org Login</a></h1>
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/index.php

    r2102 r2313  
    77
    88get_header();
    9 ?>
    109
    11 <div id="pagebody">
    12     <div id="login-welcome" class="wrapper">
    13         <h1><?php _e( 'Welcome!', 'wporg-login' ); ?></h1>
    14         <ul>
    15             <?php if ( is_user_logged_in() ) : ?>
    16                 <li class="button"><a href="<?php echo wp_logout_url(); ?>"><?php _e( 'Log Out', 'wporg-login' ); ?></a></li>
    17             <?php else : ?>
    18                 <li class="button"><a href="<?php echo wp_login_url(); ?>"><?php _e( 'Log In', 'wporg-login' ); ?></a></li>
    19                 <li class="button"><a href="https://wordpress.org/support/register.php"><?php _e( 'Register', 'wporg-login' ); ?></a></li>
    20             <?php endif; ?>
    21         </ul>
    22         <?php /* Could display wp_login_form(); */ ?>
    23     </div>
    24 </div>
     10if ( ! empty( $_GET['screen'] ) ) {
     11    $screen = preg_replace( '/[^a-z0-9-]/', '', $_GET['screen'] );
     12} else if ( preg_match( '/^\/oauth([\/\?]{1}.*)?$/', $_SERVER['REQUEST_URI'] ) ) {
     13    $screen = 'oauth';
     14} else {
     15    $screen = 'login';
     16}
    2517
    26 <?php get_footer(); ?>
     18$partial = __DIR__ . '/partials/' . $screen . '.php';
     19
     20if ( file_exists( $partial ) ) {
     21    require_once( $partial );
     22}
     23
     24get_footer();
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/style.css

    r2081 r2313  
    66 * Author: The WordPress.org Team
    77 */
    8 
    9 #mobile-menu-button,
    10 .survey-wrapper,
    11 #wporg-footer {
    12     display: none;
    13 }
    14 #wporg-header {
    15     text-align: center;
    16     height: 100px !important;
    17 }
    18 #wporg-header h1 {
    19     float: none;
    20     display: inline-block;
    21 }
    22 body {
    23     background: #ffffff url("/wp-content/themes/pub/wporg-login/images/background.jpg") no-repeat left top;
    24     background-size: cover;
    25 }
    26 #login-welcome {
    27     text-align: center;
    28 }
Note: See TracChangeset for help on using the changeset viewer.