Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Donation meter updates #229

Merged
merged 4 commits into from Aug 2, 2018

Conversation

2 participants
@leavengood
Copy link
Contributor

commented Aug 2, 2018

Work to make the donation meter stay more up-to-date.

I've moved the donation meter HTML into a partial, updated it to move out most of the inline CSS, and then added JavaScript to update it based on a JSON file.

The intent will be to have my Go donation meter program update the JSON once a day.

Worse case if the JavaScript fails, we still have the most recent HTML update from August 1, and I could see updating it once a month or so.

I think I've kept to pretty basic JavaScript, and this works on Firefox, Chrome and Safari on macOS High Sierra. I was not able to test WebPositive in Haiku.

The style of the meter change a bit, here is what it looks like now:

screen shot 2018-08-02 at 12 17 30 pm

leavengood added some commits Aug 1, 2018

Move most inline styles for the donation meter into CSS
Also change the style a bit to make it look better.

Add various ids to use later for JavaScript which will update the meter from a
JSON file.

@leavengood leavengood requested review from kallisti5 and waddlesplash Aug 2, 2018

@leavengood

This comment has been minimized.

Copy link
Contributor Author

commented Aug 2, 2018

Also FWIW this is what the JSON looks like:

{
  "updated_at": "2018-08-02T11:35:43.511Z",
  "usd_donations": 4213.77,
  "eur_donations": 1146,
  "eur_to_usd_rate": 1.160950,
  "total_donations": 5544.22
}
@waddlesplash
Copy link
Member

left a comment

Looks pretty good.

@@ -0,0 +1,21 @@
<h2 class="fundraising">Fundraising 2018</h2>

This comment has been minimized.

Copy link
@waddlesplash

waddlesplash Aug 2, 2018

Member

This file should be in the top level "layouts" directory, as it's not theme-specific.

@@ -194,6 +194,48 @@ nav.navbar button.btn:hover {
margin-top: 0px;
}

.fundraising-meter {

This comment has been minimized.

Copy link
@waddlesplash

waddlesplash Aug 2, 2018

Member

Since these are only used on the frontpage and are not theme specific, they should go in an inline <style> tag in the partial file instead of here.

Move fundraising partial to correct place, use style block
Also use round not ceil for the total donation amount.
@leavengood

This comment has been minimized.

Copy link
Contributor Author

commented Aug 2, 2018

OK, fixed your comments.

@waddlesplash waddlesplash merged commit 6015685 into master Aug 2, 2018

@waddlesplash waddlesplash deleted the donation-meter-updates branch Nov 6, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.