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

paint the walls #3718

Merged
merged 40 commits into from
Aug 28, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
25d0a7b
Prune obsolete template
chadwhitacre Aug 26, 2015
5d9084e
Take down the "Cleaning up!" sign
chadwhitacre Aug 26, 2015
267d6d7
Kill big penny background
chadwhitacre Aug 26, 2015
5d3f1f4
Rough-in a layout revision
chadwhitacre Aug 26, 2015
d4bad07
Tighten up typography on content
chadwhitacre Aug 26, 2015
b6007f8
Rationalize new banner text w/ page titles
chadwhitacre Aug 26, 2015
b695c14
Prune redundant template
chadwhitacre Aug 27, 2015
6cf0162
Let aaronsw go
chadwhitacre Aug 27, 2015
e4b009c
Use the ~ in username presentation
chadwhitacre Aug 27, 2015
4a86d06
Upgrade the hole in the banner
chadwhitacre Aug 27, 2015
4d0d2c8
Simplify template structure
chadwhitacre Aug 27, 2015
2533a7a
Fix the suspicious knob
chadwhitacre Aug 27, 2015
f643891
Move the avatar from the sidebar to the banner
chadwhitacre Aug 27, 2015
05ed075
Move details out of sidebar and nav into it
chadwhitacre Aug 27, 2015
18de09b
Update Credit Card and PayPal forms
chadwhitacre Aug 27, 2015
59270bd
Fix goofy transparency on header sign-in
chadwhitacre Aug 27, 2015
0625c5f
Dust off Team page
chadwhitacre Aug 27, 2015
690f802
Revise the About pages a bit
chadwhitacre Aug 27, 2015
b3efbd1
Preen a bunch of stuff
chadwhitacre Aug 27, 2015
081d30b
Tighten up a whole bunch o' stuff
chadwhitacre Aug 27, 2015
ce9b21e
Another batch of minor improvements
chadwhitacre Aug 27, 2015
a66b188
Put tagline on homepage
chadwhitacre Aug 27, 2015
5c032b8
Two more tweaks
chadwhitacre Aug 27, 2015
7ad6747
Make the homepage banner a link to About
chadwhitacre Aug 27, 2015
dae81ad
Move About to the footer
chadwhitacre Aug 27, 2015
169775d
Add a ~ to avoid a redirect
chadwhitacre Aug 28, 2015
a4aa5cd
Implement a min-height on #main
chadwhitacre Aug 28, 2015
73a1da4
Give routes and email their own index
chadwhitacre Aug 28, 2015
969b341
Tighten up transfer confirmation a bit
chadwhitacre Aug 28, 2015
963824f
Repair sign-in drop-down in header
chadwhitacre Aug 28, 2015
8d3b262
Put details on Delpan into a popup
chadwhitacre Aug 28, 2015
9951ee1
Implement sidebar suppression
chadwhitacre Aug 28, 2015
bf9fcee
Fix stats layout
chadwhitacre Aug 28, 2015
4da2455
Do the tighten up
chadwhitacre Aug 28, 2015
ea60d38
Update the success image in the README
chadwhitacre Aug 28, 2015
1fd5d2f
Remove the Feedback link on the side
chadwhitacre Aug 28, 2015
013d998
Remove old leaderboard styles
chadwhitacre Aug 28, 2015
5c6c391
Make the menus responsive
chadwhitacre Aug 28, 2015
cd45031
I think that's it? Responsiveness!
chadwhitacre Aug 28, 2015
6804d4a
Update README success image again
chadwhitacre Aug 28, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions emails/charge_failed.spt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<pre>{{ exchange.note }}</pre>

<a href="{{ participant.profile_url+'routes/credit-card.html' }}"
<a href="{{ participant.profile_url+'routes/credit-card' }}"
style="{{ button_style }}">{{ _("Fix Credit Card") }}</a>

[---] text/plain
Expand All @@ -25,4 +25,4 @@

{{ exchange.note }}

{{ _("Follow this link to fix your credit card:") }} {{ participant.profile_url+'routes/credit-card.html' }}
{{ _("Follow this link to fix your credit card:") }} {{ participant.profile_url+'routes/credit-card' }}
2 changes: 2 additions & 0 deletions error.spt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ from gratipay.utils.i18n import HTTP_ERRORS

[----------------------------------------]

banner = _("Eep!")
code = response.code
msg = _(HTTP_ERRORS.get(code, status_strings.get(code, '')))
try:
Expand All @@ -20,6 +21,7 @@ err = response.body
if code == 500 and not err:
err = _("Looks like you've found a bug! Sorry for the inconvenience, we'll get it fixed ASAP!")

suppress_sidebar = True
[----------------------------------------] text/html
{% extends "templates/base.html" %}
{% set title = code %}
Expand Down
2 changes: 1 addition & 1 deletion gratipay/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
'b64encode': base64.b64encode,
'enumerate': enumerate,
'filter': filter,
'filter_profile_subnav': utils.filter_profile_subnav,
'filter_profile_nav': utils.filter_profile_nav,
'float': float,
'len': len,
'map': map,
Expand Down
2 changes: 1 addition & 1 deletion gratipay/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ def erase_cookie(cookies, key, **kw):
set_cookie(cookies, key, '', BEGINNING_OF_EPOCH, **kw)


def filter_profile_subnav(user, participant, pages):
def filter_profile_nav(user, participant, pages):
out = []
for foo, bar, show_them, show_others in pages:
if (user.participant == participant and show_them) \
Expand Down
8 changes: 4 additions & 4 deletions gratipay/utils/notifications.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
def paypal_withdrawal_failed(_, user):
href = '/~%s/routes/paypal.html' % user.participant.username
href = '/~%s/routes/paypal' % user.participant.username
return ('error',
['a',
{'href': href}, _("Your last PayPal payout failed!"),
Expand All @@ -8,7 +8,7 @@ def paypal_withdrawal_failed(_, user):


def credit_card_failed(_, user):
href = '/~%s/routes/credit-card.html' % user.participant.username
href = '/~%s/routes/credit-card' % user.participant.username
return ('error',
['span', _("Your credit card has failed!") + " ",
['a', {'href': href}, _("Fix your card")]
Expand All @@ -17,7 +17,7 @@ def credit_card_failed(_, user):


def credit_card_expires(_, user):
href = '/~%s/routes/credit-card.html' % user.participant.username
href = '/~%s/routes/credit-card' % user.participant.username
return ('error',
['span', _("Your credit card is about to expire!") + " ",
['a', {'href': href}, _("Update card")]
Expand All @@ -26,7 +26,7 @@ def credit_card_expires(_, user):


def email_missing(_, user):
href = '/~%s/settings/#emails' % user.participant.username
href = '/~%s/emails/' % user.participant.username
return ('notice',
['span', _('Your account does not have an associated email address.') + " ",
['a', {'href': href}, _('Add an email address')],
Expand Down
Binary file modified img-src/success.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions js/gratipay.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Gratipay.getCookie = function(key) {

Gratipay.init = function() {
Gratipay.warnOffUsersFromDeveloperConsole();
Gratipay.adaptToLongUsernames();
Gratipay.forms.initCSRF();
Gratipay.signIn();
Gratipay.signOut();
Expand All @@ -27,6 +28,16 @@ Gratipay.warnOffUsersFromDeveloperConsole = function() {
console.log("%cPlease close this window now.", "color: blue;");
};

Gratipay.adaptToLongUsernames = function() {
var h1 = $('#banner h1');
var nchars = h1.text().length;
if (nchars > 16)
h1.addClass('really-long');
else if (nchars > 8)
h1.addClass('long');
h1.show();
};

Gratipay.error = function(jqXHR, textStatus, errorThrown) {
var msg = null;
try {
Expand Down
73 changes: 73 additions & 0 deletions js/gratipay/emails.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
Gratipay.emails = {};

Gratipay.emails.post = function(e) {
e.preventDefault();
var $this = $(this);
var action = this.className;
var $inputs = $('.emails button, .emails input');
console.log($this);
var address = $this.parent().data('email') || $('input.add-email').val();

$inputs.prop('disabled', true);

$.ajax({
url: 'modify.json',
type: 'POST',
data: {action: action, address: address},
dataType: 'json',
success: function (msg) {
if (msg) {
Gratipay.notification(msg, 'success');
}
if (action == 'add-email') {
$('input.add-email').val('');
setTimeout(function(){ window.location.reload(); }, 3000);
return;
} else if (action == 'set-primary') {
$('.emails li').removeClass('primary');
$this.parent().addClass('primary');
} else if (action == 'remove') {
$this.parent().fadeOut();
}
$inputs.prop('disabled', false);
},
error: [
function () { $inputs.prop('disabled', false); },
Gratipay.error
],
});
};


Gratipay.emails.init = function () {

// Wire up email addresses list.
// =============================

$('.emails button, .emails input').prop('disabled', false);
$('.emails button[class]').on('click', Gratipay.emails.post);
$('form.add-email').on('submit', Gratipay.emails.post);


// Wire up notification preferences
// ================================

$('.email-notifications input').click(function(e) {
var field = $(e.target).data('field');
var bits = $(e.target).data('bits') || 1;
jQuery.ajax(
{ url: '../emails/notifications.json'
, type: 'POST'
, data: {toggle: field, bits: bits}
, dataType: 'json'
, success: function(data) {
Gratipay.notification(data.msg, 'success');
$(e.target).attr('checked', data.new_value & bits)
}
, error: [
Gratipay.error,
function(){ $(e.target).attr('checked', !$(e.target).attr('checked')) },
]
});
});
};
6 changes: 3 additions & 3 deletions js/gratipay/jump.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
$(document).ready(function() {
$('#jump').submit(function (e) {
$('.jump-box').submit(function (e) {
e.preventDefault();
e.stopPropagation();

var platform = Gratipay.trim($('#jump select').val()),
val = Gratipay.trim($('#jump input').val());
var platform = Gratipay.trim($('.jump-box select').val()),
val = Gratipay.trim($('.jump-box input').val());
if (val) window.location = '/on/' + platform + '/' + val + '/';
});
});
8 changes: 6 additions & 2 deletions js/gratipay/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ Gratipay.routes.lazyLoad = function(script_url) {
}).fail(Gratipay.error);
}

Gratipay.routes.redirectToOverview = function() {
window.location = './';
};

Gratipay.routes.deleteRoute = function(e) {
e.stopPropagation();
e.preventDefault();
Expand All @@ -35,7 +39,7 @@ Gratipay.routes.deleteRoute = function(e) {
{ url: "/~" + Gratipay.username + "/routes/delete.json"
, data: {network: $this.data('network'), address: $this.data('address')}
, type: "POST"
, success: function() { window.location.reload(); }
, success: Gratipay.routes.redirectToOverview
, error: Gratipay.error
}
);
Expand All @@ -44,7 +48,7 @@ Gratipay.routes.deleteRoute = function(e) {

Gratipay.routes.onSuccess = function(data) {
$('button#save').prop('disabled', false);
window.location.reload();
Gratipay.routes.redirectToOverview();
};

Gratipay.routes.associate = function (network, address) {
Expand Down
68 changes: 0 additions & 68 deletions js/gratipay/settings.js
Original file line number Diff line number Diff line change
@@ -1,43 +1,5 @@
Gratipay.settings = {};

Gratipay.settings.post_email = function(e) {
e.preventDefault();
var $this = $(this);
var action = this.className;
var $inputs = $('.emails button, .emails input');
console.log($this);
var address = $this.parent().data('email') || $('input.add-email').val();

$inputs.prop('disabled', true);

$.ajax({
url: '../emails/modify.json',
type: 'POST',
data: {action: action, address: address},
dataType: 'json',
success: function (msg) {
if (msg) {
Gratipay.notification(msg, 'success');
}
if (action == 'add-email') {
$('input.add-email').val('');
setTimeout(function(){ window.location.reload(); }, 3000);
return;
} else if (action == 'set-primary') {
$('.emails li').removeClass('primary');
$this.parent().addClass('primary');
} else if (action == 'remove') {
$this.parent().fadeOut();
}
$inputs.prop('disabled', false);
},
error: [
function () { $inputs.prop('disabled', false); },
Gratipay.error
],
});
};

Gratipay.settings.init = function() {

// Wire up username knob.
Expand Down Expand Up @@ -111,28 +73,6 @@ Gratipay.settings.init = function() {
});
});

// Wire up notification preferences
// ================================

$('.email-notifications input').click(function(e) {
var field = $(e.target).data('field');
var bits = $(e.target).data('bits') || 1;
jQuery.ajax(
{ url: '../emails/notifications.json'
, type: 'POST'
, data: {toggle: field, bits: bits}
, dataType: 'json'
, success: function(data) {
Gratipay.notification(data.msg, 'success');
$(e.target).attr('checked', data.new_value & bits)
}
, error: [
Gratipay.error,
function(){ $(e.target).attr('checked', !$(e.target).attr('checked')) },
]
});
});

// Wire up API Key
// ===============

Expand Down Expand Up @@ -162,14 +102,6 @@ Gratipay.settings.init = function() {
});


// Wire up email addresses list.
// =============================

$('.emails button, .emails input').prop('disabled', false);
$('.emails button[class]').on('click', Gratipay.settings.post_email);
$('form.add-email').on('submit', Gratipay.settings.post_email);


// Wire up close knob.
// ===================

Expand Down
Loading