Skip to content

Commit 5175287

Browse files
committed
Merge pull request WP-API#38 from mattheu/master
Update Oauth authorization view - nicer styles
2 parents 827e43a + 4cbe9bb commit 5175287

File tree

1 file changed

+61
-10
lines changed

1 file changed

+61
-10
lines changed

theme/oauth1-authorize.php

Lines changed: 61 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,69 @@
88
$current_user = wp_get_current_user();
99

1010
$url = site_url( 'wp-login.php?action=oauth1_authorize', 'login_post' );
11+
1112
?>
1213

14+
<style>
15+
16+
.login-title {
17+
margin-bottom: 15px;
18+
}
19+
20+
.login-info .avatar {
21+
margin-right: 15px;
22+
margin-bottom: 15px;
23+
float: left;
24+
}
25+
26+
#login form .login-info p {
27+
margin-bottom: 15px;
28+
}
29+
30+
/** Note - login scope has not yet been implemented. **/
31+
.login-scope {
32+
clear: both;
33+
margin-bottom: 15px;
34+
}
35+
36+
.login-scope h4 {
37+
margin-bottom: 10px;
38+
}
39+
40+
.login-scope ul {
41+
margin-left: 1.5em;
42+
}
43+
44+
.submit {
45+
clear: both;
46+
}
47+
48+
.submit .button {
49+
margin-right: 10px;
50+
float: left;
51+
}
52+
53+
</style>
54+
1355
<form name="oauth1_authorize_form" id="oauth1_authorize_form" action="<?php echo esc_url( $url ); ?>" method="post">
1456

15-
<h2><?php echo esc_html( sprintf( __('Connect %1$s'), $consumer->post_title ) ) ?></h2>
16-
<p><?php
17-
printf(
18-
__( 'Howdy <strong>%1$s</strong>, "%2$s" would like to connect to %3$s.' ),
19-
$current_user->user_login,
20-
$consumer->post_title,
21-
get_bloginfo( 'name' )
22-
)
23-
?></p>
57+
<h2 class="login-title"><?php echo esc_html( sprintf( __('Connect %1$s'), $consumer->post_title ) ) ?></h2>
58+
59+
<div class="login-info">
60+
61+
<?php echo get_avatar( $current_user->ID, '78' ); ?>
62+
63+
<p><?php
64+
printf(
65+
__( 'Howdy <strong>%1$s</strong>,<br/> "%2$s" would like to connect to %3$s.' ),
66+
$current_user->user_login,
67+
$consumer->post_title,
68+
get_bloginfo( 'name' )
69+
)
70+
?></p>
71+
72+
</div>
73+
2474
<?php
2575
/**
2676
* Fires inside the lostpassword <form> tags, before the hidden fields.
@@ -29,9 +79,10 @@
2979
*/
3080
do_action( 'oauth1_authorize_form', $consumer ); ?>
3181
<p class="submit">
32-
<button type="submit" name="wp-submit" value="cancel" class="button button-primary button-large"><?php _e('Cancel'); ?></button>
3382
<button type="submit" name="wp-submit" value="authorize" class="button button-primary button-large"><?php _e('Authorize'); ?></button>
83+
<button type="submit" name="wp-submit" value="cancel" class="button button-large"><?php _e('Cancel'); ?></button>
3484
</p>
85+
3586
</form>
3687

3788
<p id="nav">

0 commit comments

Comments
 (0)