From 1edfa50d1a60b13a4dc6c726ef7abe2da35bb625 Mon Sep 17 00:00:00 2001 From: Johann-S Date: Wed, 8 May 2019 15:01:03 +0200 Subject: [PATCH 01/12] add a thanks page to our doc --- site/content/docs/5.0/thanks.md | 76 +++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 site/content/docs/5.0/thanks.md diff --git a/site/content/docs/5.0/thanks.md b/site/content/docs/5.0/thanks.md new file mode 100644 index 000000000..cc1aa5a2f --- /dev/null +++ b/site/content/docs/5.0/thanks.md @@ -0,0 +1,76 @@ +--- +layout: docs +title: Thanks +description: To say thanks to our sponsors and services which support us. +group: thanks +aliases: "/thanks/" +toc: true +--- + +## Sponsors + +{{< sponsors.inline >}} +{{- $ocURL := "https://opencollective.com/bootstrap/members/all.json" -}} +{{- $sponsors := getJSON $ocURL "?TierId=7193&limit=10&offset=0" -}} +
+ {{- range $sponsors }} + {{- if .isActive -}} +
+
+ {{- .name -}} +
+
+ {{- .name -}} +
+

{{- .description -}}

+
+
+
+ {{- end -}} + {{- end -}} +
+{{< /sponsors.inline >}} + +## Backers + +{{< backers.inline >}} +{{- $ocURL := "https://opencollective.com/bootstrap/members/all.json" -}} +{{- $sponsors := getJSON $ocURL "?TierId=7192&limit=10&offset=0" -}} +
+ {{- range $sponsors }} + {{- if .isActive -}} +
+
+ {{- .name -}} +
+
+ {{- .name -}} +
+

{{- .description -}}

+
+
+
+ {{- end -}} + {{- end -}} +
+{{< /backers.inline >}} + +## Services + +{{< services.inline >}} +
+
+
+
+ BrowserStack +
+
+
+ BrowserStack +
+

Instant access to 2000+ browsers and real iOS and Android devices for cross browser testing. Ship apps and websites that work for everyone, every time. Get Free Trial.

+
+
+
+
+{{< /services.inline >}} From dd854e31713051628c002b146d080ca380607668 Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Wed, 8 May 2019 16:33:28 +0300 Subject: [PATCH 02/12] Check for `.description` and `.website`. --- site/content/docs/5.0/thanks.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/site/content/docs/5.0/thanks.md b/site/content/docs/5.0/thanks.md index cc1aa5a2f..e84664794 100644 --- a/site/content/docs/5.0/thanks.md +++ b/site/content/docs/5.0/thanks.md @@ -20,9 +20,13 @@ toc: true {{- .name -}}
+ {{ if .website -}} {{- .name -}} + {{ else -}} + {{- .name -}} + {{ end -}}
-

{{- .description -}}

+ {{ with .description }}

{{ . | chomp }}

{{ end }}
@@ -44,9 +48,13 @@ toc: true {{- .name -}}
+ {{ if .website -}} {{- .name -}} + {{ else -}} + {{- .name -}} + {{ end -}}
-

{{- .description -}}

+ {{ with .description }}

{{ . | chomp }}

{{ end }}
From 4c7953d365867bb780c1767870c648695badb5f5 Mon Sep 17 00:00:00 2001 From: Martijn Cuppens Date: Wed, 8 May 2019 21:20:15 +0300 Subject: [PATCH 03/12] Change theming & copy --- site/content/docs/5.0/thanks.md | 78 +++++++++---------- site/data/services.yml | 6 ++ .../5.0/assets/img/services/browserstack.svg | 1 + .../docs/5.0/assets/img/services/netlify.svg | 1 + 4 files changed, 44 insertions(+), 42 deletions(-) create mode 100644 site/data/services.yml create mode 100644 site/static/docs/5.0/assets/img/services/browserstack.svg create mode 100644 site/static/docs/5.0/assets/img/services/netlify.svg diff --git a/site/content/docs/5.0/thanks.md b/site/content/docs/5.0/thanks.md index e84664794..ac00d1fe2 100644 --- a/site/content/docs/5.0/thanks.md +++ b/site/content/docs/5.0/thanks.md @@ -1,34 +1,34 @@ --- layout: docs -title: Thanks -description: To say thanks to our sponsors and services which support us. +title: Support the team group: thanks aliases: "/thanks/" toc: true --- +Through donations and sponsorships we are able to maintain & improve Bootstrap. Feel free to show your support on our [Open Collective page](https://opencollective.com/bootstrap). + ## Sponsors {{< sponsors.inline >}} {{- $ocURL := "https://opencollective.com/bootstrap/members/all.json" -}} {{- $sponsors := getJSON $ocURL "?TierId=7193&limit=10&offset=0" -}} -
+
{{- range $sponsors }} {{- if .isActive -}} -
-
- {{- .name -}} -
-
- {{ if .website -}} - {{- .name -}} - {{ else -}} - {{- .name -}} - {{ end -}} -
- {{ with .description }}

{{ . | chomp }}

{{ end }} +
+
+
+ {{- .name -}}
+

+ {{ if .website -}} + {{- .name -}} + {{ else -}} + {{- .name -}} + {{ end -}} +

{{- end -}} {{- end -}} @@ -40,22 +40,18 @@ toc: true {{< backers.inline >}} {{- $ocURL := "https://opencollective.com/bootstrap/members/all.json" -}} {{- $sponsors := getJSON $ocURL "?TierId=7192&limit=10&offset=0" -}} -
+
{{- range $sponsors }} {{- if .isActive -}} -
-
- {{- .name -}} -
-
- {{ if .website -}} - {{- .name -}} - {{ else -}} - {{- .name -}} - {{ end -}} -
- {{ with .description }}

{{ . | chomp }}

{{ end }} -
+
+
+ {{ if .website -}} + + {{ end -}} + {{- .name -}} + {{ if .website -}} + + {{ end -}}
{{- end -}} @@ -66,19 +62,17 @@ toc: true ## Services {{< services.inline >}} -
-
-
-
- BrowserStack -
-
-
- BrowserStack -
-

Instant access to 2000+ browsers and real iOS and Android devices for cross browser testing. Ship apps and websites that work for everyone, every time. Get Free Trial.

-
+
+ {{- range (index $.Site.Data "services") }} +
+ {{ if .website -}} + + {{ end -}} + {{- .name -}} + {{ if .website -}} + + {{ end -}}
-
+ {{ end -}}
{{< /services.inline >}} diff --git a/site/data/services.yml b/site/data/services.yml new file mode 100644 index 000000000..07e020b42 --- /dev/null +++ b/site/data/services.yml @@ -0,0 +1,6 @@ +- name: Browserstack + image: browserstack.svg + website: https://www.browserstack.com/ +- name: Netlify + image: netlify.svg + website: https://www.netlify.com diff --git a/site/static/docs/5.0/assets/img/services/browserstack.svg b/site/static/docs/5.0/assets/img/services/browserstack.svg new file mode 100644 index 000000000..3fab672c2 --- /dev/null +++ b/site/static/docs/5.0/assets/img/services/browserstack.svg @@ -0,0 +1 @@ + diff --git a/site/static/docs/5.0/assets/img/services/netlify.svg b/site/static/docs/5.0/assets/img/services/netlify.svg new file mode 100644 index 000000000..67a78718d --- /dev/null +++ b/site/static/docs/5.0/assets/img/services/netlify.svg @@ -0,0 +1 @@ + From 3b78e40962a4d9bbac2c01c24656857e920b40fa Mon Sep 17 00:00:00 2001 From: Johann-S Date: Mon, 3 Jun 2019 13:54:01 +0200 Subject: [PATCH 04/12] using xhr to display backers and sponsors --- site/content/docs/5.0/thanks.md | 149 +++++++++++++++++++++++--------- 1 file changed, 108 insertions(+), 41 deletions(-) diff --git a/site/content/docs/5.0/thanks.md b/site/content/docs/5.0/thanks.md index ac00d1fe2..71dced5e5 100644 --- a/site/content/docs/5.0/thanks.md +++ b/site/content/docs/5.0/thanks.md @@ -11,52 +11,13 @@ Through donations and sponsorships we are able to maintain & improve Bootstrap. ## Sponsors {{< sponsors.inline >}} -{{- $ocURL := "https://opencollective.com/bootstrap/members/all.json" -}} -{{- $sponsors := getJSON $ocURL "?TierId=7193&limit=10&offset=0" -}} -
- {{- range $sponsors }} - {{- if .isActive -}} -
-
-
- {{- .name -}} -
-
-

- {{ if .website -}} - {{- .name -}} - {{ else -}} - {{- .name -}} - {{ end -}} -

-
- {{- end -}} - {{- end -}} -
+
{{< /sponsors.inline >}} ## Backers {{< backers.inline >}} -{{- $ocURL := "https://opencollective.com/bootstrap/members/all.json" -}} -{{- $sponsors := getJSON $ocURL "?TierId=7192&limit=10&offset=0" -}} -
- {{- range $sponsors }} - {{- if .isActive -}} -
-
- {{ if .website -}} - - {{ end -}} - {{- .name -}} - {{ if .website -}} - - {{ end -}} -
-
- {{- end -}} - {{- end -}} -
+
{{< /backers.inline >}} ## Services @@ -75,4 +36,110 @@ Through donations and sponsorships we are able to maintain & improve Bootstrap.
{{ end -}}
+ + {{< /services.inline >}} From b72135b4c35ca96b4b3c4aa2209b3b01002e9055 Mon Sep 17 00:00:00 2001 From: Johann-S Date: Mon, 3 Jun 2019 16:33:07 +0200 Subject: [PATCH 05/12] change opencollective endpoint to get backers --- site/content/docs/5.0/thanks.md | 39 ++++++++++++++------------------- 1 file changed, 17 insertions(+), 22 deletions(-) diff --git a/site/content/docs/5.0/thanks.md b/site/content/docs/5.0/thanks.md index 71dced5e5..b93de9847 100644 --- a/site/content/docs/5.0/thanks.md +++ b/site/content/docs/5.0/thanks.md @@ -47,7 +47,7 @@ Through donations and sponsorships we are able to maintain & improve Bootstrap. '
', '
', '
', - ' ' + sponsor.name + '', + ' ' + sponsor.name + '', '
', '
', '

', @@ -84,7 +84,7 @@ Through donations and sponsorships we are able to maintain & improve Bootstrap. ) } - output.push('' + backer.name + '') + output.push('' + backer.name + '') if (backer.website) { output.push('') @@ -99,11 +99,11 @@ Through donations and sponsorships we are able to maintain & improve Bootstrap. backerListEl.innerHTML = output.join('') } - function requestOC(params, cb) { - var ocURL = 'https://opencollective.com/bootstrap/members/all.json' + function requestOC(cb) { + var ocURL = 'https://opencollective.com/api/groups/bootstrap/backers' var xhr = new XMLHttpRequest() - xhr.open('GET', ocURL + params, true) + xhr.open('GET', ocURL, true) xhr.onload = function () { if (xhr.readyState !== 4) { return @@ -119,26 +119,21 @@ Through donations and sponsorships we are able to maintain & improve Bootstrap. } (function () { - requestOC('?TierId=7193', function (sponsorList, error) { - if (sponsorList) { - sponsorList = sponsorList.filter(function (sponsor) { return sponsor.isActive }) - .slice(0, 10) + requestOC(function (allBackerList, error) { + var backerList = allBackerList.filter(function (backer) { return backer.tier === 'backer' }) + var sponsorList = allBackerList.filter(function (backer) { return backer.tier === 'sponsor' }) - // Sort by total amount donated - sponsorList.sort(function (sponsor1, sponsor2) { return sponsor2.totalAmountDonated - sponsor1.totalAmountDonated }) - displaySponsors(sponsorList) - } - }) + // Sort by total amount donated + sponsorList.sort(function (sponsor1, sponsor2) { return sponsor2.directDonations - sponsor1.directDonations }) + sponsorList = sponsorList.slice(0, 10) - requestOC('?TierId=7192', function (backerList, error) { - if (backerList) { - backerList = backerList.filter(function (backer) { return backer.isActive }) - .slice(0, 10) + displaySponsors(sponsorList) - // Sort by total amount donated - backerList.sort(function (backer1, backer2) { return backer2.totalAmountDonated - backer1.totalAmountDonated }) - displayBackers(backerList) - } + // Sort by total amount donated + backerList.sort(function (backer1, backer2) { return backer2.directDonations - backer1.directDonations }) + backerList = backerList.slice(0, 10) + + displayBackers(backerList) }) })() From 9f72bbae7c0992b1a0f5d53592563e4b9167bdd3 Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Sat, 8 Jun 2019 13:50:24 +0300 Subject: [PATCH 06/12] Tweak image. --- site/content/docs/5.0/thanks.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/site/content/docs/5.0/thanks.md b/site/content/docs/5.0/thanks.md index b93de9847..7d1ece963 100644 --- a/site/content/docs/5.0/thanks.md +++ b/site/content/docs/5.0/thanks.md @@ -27,9 +27,9 @@ Through donations and sponsorships we are able to maintain & improve Bootstrap. {{- range (index $.Site.Data "services") }}
{{ if .website -}} - + {{ end -}} - {{- .name -}} + {{ .name }} {{ if .website -}} {{ end -}} From 9febb30c19640af1ff782e52a5402be7648f458e Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Sat, 8 Jun 2019 14:34:37 +0300 Subject: [PATCH 07/12] Clean up classes and lint JS. --- site/content/docs/5.0/thanks.md | 195 +++++++++++++++++--------------- 1 file changed, 103 insertions(+), 92 deletions(-) diff --git a/site/content/docs/5.0/thanks.md b/site/content/docs/5.0/thanks.md index 7d1ece963..a27b32807 100644 --- a/site/content/docs/5.0/thanks.md +++ b/site/content/docs/5.0/thanks.md @@ -38,103 +38,114 @@ Through donations and sponsorships we are able to maintain & improve Bootstrap.
{{< /services.inline >}} From e46e225895dab9070c42c83f91fe5e6f03d9be0e Mon Sep 17 00:00:00 2001 From: Johann-S Date: Tue, 11 Jun 2019 09:40:26 +0200 Subject: [PATCH 08/12] migrate to new oc api --- site/content/docs/5.0/thanks.md | 39 +++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/site/content/docs/5.0/thanks.md b/site/content/docs/5.0/thanks.md index a27b32807..d828f50a0 100644 --- a/site/content/docs/5.0/thanks.md +++ b/site/content/docs/5.0/thanks.md @@ -41,23 +41,27 @@ Through donations and sponsorships we are able to maintain & improve Bootstrap. (function () { 'use strict' + var backerDisplayed = 10 + function displaySponsors(sponsorList) { var sponsorListEl = document.getElementById('sponsorList') var output = [] sponsorList.forEach(function (sponsor) { + var sponsorAccount = sponsor.fromAccount + output.push( '
', '
', - ' ' + sponsor.name + '', + ' ' + sponsorAccount.name + '', '
', '

', ) - if (sponsor.website) { - output.push('' + sponsor.name + '') + if (sponsorAccount.website) { + output.push('' + sponsorAccount.name + '') } else { - output.push(sponsor.name) + output.push(sponsorAccount.name) } output.push( @@ -74,20 +78,22 @@ Through donations and sponsorships we are able to maintain & improve Bootstrap. var output = [] backerList.forEach(function (backer) { + var backerAccount = backer.fromAccount + output.push( '
', '
' ) - if (backer.website) { + if (backerAccount.website) { output.push( - '' + '' ) } - output.push('' + backer.name + '') + output.push('' + backerAccount.name + '') - if (backer.website) { + if (backerAccount.website) { output.push('') } @@ -101,7 +107,7 @@ Through donations and sponsorships we are able to maintain & improve Bootstrap. } function requestOC(cb) { - var ocURL = 'https://opencollective.com/api/groups/bootstrap/backers' + var ocURL = 'https://rest.opencollective.com/v2/bootstrap/orders/incoming/active' var xhr = new XMLHttpRequest() xhr.open('GET', ocURL, true) @@ -121,27 +127,28 @@ Through donations and sponsorships we are able to maintain & improve Bootstrap. } (function () { - requestOC(function (allBackerList) { + requestOC(function (data) { + var allBackerList = data.nodes var backerList = allBackerList.filter(function (backer) { - return backer.tier === 'backer' + return backer.tier.slug === 'backer' }) var sponsorList = allBackerList.filter(function (backer) { - return backer.tier === 'sponsor' + return backer.tier.slug === 'sponsor' }) // Sort by total amount donated sponsorList.sort(function (sponsor1, sponsor2) { - return sponsor2.directDonations - sponsor1.directDonations + return sponsor2.totalDonations.value - sponsor1.totalDonations.value }) - sponsorList = sponsorList.slice(0, 10) + sponsorList = sponsorList.slice(0, backerDisplayed) displaySponsors(sponsorList) // Sort by total amount donated backerList.sort(function (backer1, backer2) { - return backer2.directDonations - backer1.directDonations + return backer2.totalDonations.value - backer1.totalDonations.value }) - backerList = backerList.slice(0, 10) + backerList = backerList.slice(0, backerDisplayed) displayBackers(backerList) }) From 058067336f4dc5ee18da8edc7ac0dd2dfce8ae0a Mon Sep 17 00:00:00 2001 From: Martijn Cuppens Date: Tue, 20 Aug 2019 19:32:17 +0300 Subject: [PATCH 09/12] Move inline css to scss file --- site/assets/scss/_sponsor.scss | 9 +++++++++ site/assets/scss/docs.scss | 1 + site/content/docs/5.0/thanks.md | 4 ++-- 3 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 site/assets/scss/_sponsor.scss diff --git a/site/assets/scss/_sponsor.scss b/site/assets/scss/_sponsor.scss new file mode 100644 index 000000000..dac9a751d --- /dev/null +++ b/site/assets/scss/_sponsor.scss @@ -0,0 +1,9 @@ +.sponsor { + width: 100px; + height: 100px; +} + +.sponsor-md { + width: 50px; + height: 50px; +} diff --git a/site/assets/scss/docs.scss b/site/assets/scss/docs.scss index 4da387aa4..ec59ef2f0 100644 --- a/site/assets/scss/docs.scss +++ b/site/assets/scss/docs.scss @@ -36,6 +36,7 @@ @import "ads"; @import "content"; @import "skippy"; +@import "sponsor"; @import "sidebar"; @import "layout"; @import "toc"; diff --git a/site/content/docs/5.0/thanks.md b/site/content/docs/5.0/thanks.md index d828f50a0..9589cafea 100644 --- a/site/content/docs/5.0/thanks.md +++ b/site/content/docs/5.0/thanks.md @@ -52,7 +52,7 @@ Through donations and sponsorships we are able to maintain & improve Bootstrap. output.push( '
', - '
', + ' ', '

', @@ -82,7 +82,7 @@ Through donations and sponsorships we are able to maintain & improve Bootstrap. output.push( '
', - '
' + '