Skip to content
This repository has been archived by the owner on Mar 15, 2018. It is now read-only.

Show register and sign in buttons (bug 1072619) #709

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 13 additions & 3 deletions src/media/css/account.styl
Expand Up @@ -97,16 +97,26 @@
padding: 10px;
}
}
.only-logged-in.extras {
display: none;
}
.extras {
display: inline-block;
background: $seavan-salt-white;
border: 0;
}
.reviewer-tools, .terms {
display: block;
margin-top: 20px;
}
}
.logged-in .account-settings .only-logged-out.extras {
display: none;
}
.logged-in .account-settings .only-logged-in.extras {
display: inline-block;
}



@media $at-least-desktop {
.account-settings .terms {
Expand Down Expand Up @@ -197,10 +207,10 @@
background: none;
}
}
.only-logged-in.button.reviewer-tools {
.only-logged-in.reviewer-tools {
display: none;
}
footer .extras .button.reviewer-tools {
footer .extras.reviewer-tools {
display: none;
}
}
1 change: 0 additions & 1 deletion src/media/css/buttons.styl
Expand Up @@ -69,7 +69,6 @@ $install-font-size = 12px;
ellipsis();
font: 400 $font-size/$medium $open-stack;
height: $medium;
min-width: 100px;
white-space: nowrap;
padding: 0 $h-padding;
text-align: center;
Expand Down
5 changes: 5 additions & 0 deletions src/media/css/header.styl
Expand Up @@ -255,6 +255,7 @@ body {
word-wrap: normal;

&.loading-submit {
box-shadow: none;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As much as I liked this...
split-login-buttons mov

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do the elements still shift over? The spinner should keep the same width.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, they stay put now.

hidetext();
outline: 0;
spinner('loading');
Expand All @@ -271,6 +272,10 @@ body {
cursor: pointer;
}

.header-button.persona {
width: auto;
}

// On hover the settings gear icon should turn blue.
// On the Account Settings page the gear should also turn blue.
.act-tray.active .header-button.settings {
Expand Down
4 changes: 4 additions & 0 deletions src/media/css/purchase.styl
Expand Up @@ -49,3 +49,7 @@
}
}
}

.purchases .extras .button {
margin-right: 10px;
}
11 changes: 9 additions & 2 deletions src/media/js/commonplace/login.js
Expand Up @@ -48,7 +48,7 @@ define('login',

var $this = $(this);
$this.addClass('loading-submit');
startLogin().always(function() {
startLogin({register: $this.hasClass('register')}).always(function() {
$this.removeClass('loading-submit').trigger('blur');
});

Expand All @@ -75,7 +75,7 @@ define('login',
return [x, y];
}

function startLogin() {
function startLogin(options) {
var w = 320;
var h = 600;
var i = getCenteredCoordinates(w, h);
Expand All @@ -85,9 +85,13 @@ define('login',
var opt = {
termsOfService: settings.persona_tos,
privacyPolicy: settings.persona_privacy,
register: false,
siteLogo: settings.persona_site_logo,
oncancel: oncancel
};
// Override our settings with the provided ones.
_.extend(opt, options);

if (settings.persona_unverified_issuer) {
// We always need to force a specific issuer because bridged IdPs don't work with verified/unverified.
// See bug 910938.
Expand Down Expand Up @@ -130,6 +134,9 @@ define('login',
save_fxa_auth_url(settings.fxa_auth_url);
} else {
fxa_url = settings.fxa_auth_url;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where's fxa_auth_url defined? I can't find it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It gets pulled in when consumer_info loads.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, I see

if (opt.register) {
fxa_url += '&action=signup';
}
}
fxa_popup = window.open(
fxa_url,
Expand Down
19 changes: 0 additions & 19 deletions src/media/js/fxa_components.js

This file was deleted.

5 changes: 4 additions & 1 deletion src/templates/header.html
Expand Up @@ -16,5 +16,8 @@ <h1 class="site"><a href="{{ url('homepage') }}"><span class="wordmark">Firefox
<span class="flex-span"></span>

{{ act_tray(false) }}
<a href="#" class="header-button persona">{{ _('Sign In') }}</a>
{% if capabilities.fallbackFxA() %}
<a href="#" class="header-button persona register">{{ _('Register') }}</a>
{% endif %}
<a href="#" class="header-button button t persona">{{ _('Sign In') }}</a>
</nav>
31 changes: 24 additions & 7 deletions src/templates/settings/main.html
Expand Up @@ -36,15 +36,32 @@ <h2 class="linefit">{{ _('Account Settings') }}</h2>

<footer>
<p class="only-logged-in inline"><button type="submit" class="button action">{{ _('Save Changes') }}</button></p>
<p class="extras">
{% if capabilities.fallbackFxA() %}
<p class="only-logged-out extras">
<a href="#" class="button persona register only-logged-out">{{ _('Register') }}</a>
</p>
<p class="only-logged-out extras">
<a href="#" class="button persona only-logged-out">{{ _('Sign In') }}</a>
</p>
{% else %}
<p class="only-logged-out extras">
<a href="#" class="button persona only-logged-out">{{ _('Sign In / Sign Up') }}</a>
</p>
{% endif %}
<p class="extras only-logged-in">
<a href="#" class="button logout only-logged-in">{{ _('Sign Out') }}</a>
<a href="#" class="button persona only-logged-out">{{ _('Sign In / Sign Up') }}</a>
<a href="{{ url('privacy') }}" class="button support terms">{{ _('Privacy Policy') }}</a>
<a href="{{ url('terms') }}" class="button support terms">{{ _('Terms of Use') }}</a>
{% if user.get_permission('reviewer') %}
<a href="/reviewers/apps/queue/" class="button action only-logged-in reviewer-tools" rel="external">{{ _('Reviewer Tools') }}</a>
{% endif %}
</p>
<p class="extras terms">
<a href="{{ url('privacy') }}" class="button support">{{ _('Privacy Policy') }}</a>
</p>
<p class="extras terms">
<a href="{{ url('terms') }}" class="button support">{{ _('Terms of Use') }}</a>
</p>
{% if user.get_permission('reviewer') %}
<p class="extras reviewer-tools">
<a href="/reviewers/apps/queue/" class="button action only-logged-in" rel="external">{{ _('Reviewer Tools') }}</a>
</p>
{% endif %}
</footer>
</form>

Expand Down
7 changes: 6 additions & 1 deletion src/templates/user/purchases.html
Expand Up @@ -47,7 +47,12 @@ <h2>{{ _('My Apps') }}</h2>
<footer class="only-logged-out">
<article class="extras">
<p class="notice">{{ _('You must be signed in to view your apps.') }}</p>
<a class="button full persona" href="#">{{ _('Sign in / Sign up') }}</a>
{% if capabilities.fallbackFxA() %}
<a class="button full persona register" href="#">{{ _('Register') }}</a>
<a class="button full persona" href="#">{{ _('Sign In') }}</a>
{% else %}
<a class="button full persona" href="#">{{ _('Sign In / Sign Up') }}</a>
{% endif %}
</article>
</footer>
</section>