Browse Source

Merge branch 'hotfix/update-supports'

zhixin 5 years ago
parent
commit
bb71c80035

+ 1 - 1
site/_includes/scripts.html

@@ -13,7 +13,7 @@ $(function () {
 {%- endif -%}
 
 <script src="{{ site.baseurl }}/assets/js/docs.min.js?m=1"></script>
-<script src="{{ site.baseurl }}/assets/js/supports.js?m=2"></script>
+<script src="{{ site.baseurl }}/assets/js/supports.js?m=3"></script>
 {% include analytics.html %}
 
 {%- if page.group == "themes" -%}

+ 1 - 1
site/_includes/stylesheet.html

@@ -7,6 +7,6 @@
 {% endif %}
 {% if page.layout != "examples" %}
 <link href="{{ site.baseurl }}/assets/css/docs.min.css" rel="stylesheet">
-<link href="{{ site.baseurl }}/assets/css/style.css?m=4" rel="stylesheet">
+<link href="{{ site.baseurl }}/assets/css/style.css?m=5" rel="stylesheet">
 {% endif %}
 {%- endif -%}

+ 18 - 11
site/_includes/supports.html

@@ -1,3 +1,5 @@
+<script>window.baseurl = '{{ site.baseurl }}'</script>
+
 <div class="container border-bottom supports-container">
   <div class="pt-5">
     <h3>Support the Team</h3>
@@ -7,41 +9,46 @@
     </div>
   </div>
 
-  <div class="pt-5">
+  <div class="supports pt-5 pb-5">
     <div>
-      <h3>PayPal Sponsors</h3>
+      <h3>Gold Sponsors</h3>
     </div>
 
-    <div>
-      <a href="https://edubirdie.com/write-my-essay" target="_blank" title="$300 by Write my essay services from Edubirdie">
-        <img height="64" src="{{ site.baseurl }}/assets/images/edu-birdie.png" alt="Write my essay services from Edubirdie">
+    <div class="support-description">
+      <b>Gold Sponsors</b> are those who have pledged $100 or more to bootstrap-table.
+      <a href="https://opencollective.com/bootstrap-table#sponsor" target="_blank">
+        Become a gold sponsor
       </a>
     </div>
+
+    <div class="gold-sponsors">
+    </div>
   </div>
 
   <div class="supports pt-5 pb-5">
     <div>
-      <h3>OpenCollective Sponsors</h3>
+      <h3>Bronze Sponsors</h3>
     </div>
 
     <div class="support-description">
-      Support this project by becoming a sponsor. Your logo will show up here with a link to your website.
+      <b>Bronze Sponsors</b> are those who have pledged $10 to $100 to bootstrap-table.
       <a href="https://opencollective.com/bootstrap-table#sponsor" target="_blank">
-        Become a sponsor
+        Become a bronze sponsor
       </a>
     </div>
 
-    <div class="support-sponsors">
+    <div class="bronze-sponsors">
     </div>
   </div>
 
   <div class="supports pt-5 pb-5">
     <div>
-      <h3>OpenCollective Backers</h3>
+      <h3>Backers</h3>
     </div>
 
     <div class="support-description">
-      Support this project by becoming a backer. Your image will show up here with a link to your website.
+      The following <b>Backers</b> are individuals who have contributed various amounts of money in order to help support bootstrap-table.
+      Every little bit helps, and we appreciate even the smallest contributions.
       <a href="https://opencollective.com/bootstrap-table#sponsor" target="_blank">
         Become a backer
       </a>

+ 7 - 1
site/assets/css/style.css

@@ -142,8 +142,14 @@ header.themes .bd-lead {
   margin: 0 2px 2px;
 }
 
+.support-gold-avatar {
+  max-height: 96px;
+  max-width: 288px;
+  vertical-align: middle;
+}
+
 .support-silver-avatar {
   max-height: 64px;
   max-width: 192px;
   vertical-align: middle;
-}
+}

+ 34 - 6
site/assets/js/supports.js

@@ -10,25 +10,53 @@ $(function () {
 
     return [
       '<a class="support-item" href="' + item.website + '" target="_blank" title="$' + item.totalAmountDonated + ' by ' + item.name + '">',
-      '<img class="support-silver-avatar" src="' + item.image + '" alt="' + item.name + '">',
+      '<img class="support-' + (item.classes || 'silver') + '-avatar" src="' + item.image + '" alt="' + item.name + '">',
       '</a>'
     ].join('')
   }
 
-  $.getJSON('https://examples.wenzhixin.net.cn/opencollective/all.json', res => {
+  $.getJSON('https://examples.wenzhixin.net.cn/opencollective/all.json', function (res) {
+    res.push({
+      website: 'https://edubirdie.com/write-my-essay',
+      totalAmountDonated: 300,
+      name: 'Write my essay services from Edubirdie',
+      image: window.baseurl + '/assets/images/edu-birdie.png',
+      isActive: true,
+      role: 'BACKER'
+    })
+
     res.sort(function (a, b) {
       return b.totalAmountDonated - a.totalAmountDonated
     })
 
-    var organizations = res.filter(function (item) {
-      return item.role === 'BACKER' && item.type === 'ORGANIZATION' && item.isActive
+    var goldSponsors = res.filter(function (item) {
+      var isGold = item.isActive &&
+        item.role === 'BACKER' &&
+        item.totalAmountDonated >= 100
+
+      if (isGold) {
+        item.classes = 'gold'
+      }
+      return isGold
+    })
+
+    var bronzeSponsors = res.filter(function (item) {
+      return item.isActive &&
+        item.role === 'BACKER' &&
+        item.totalAmountDonated >= 10 &&
+        item.totalAmountDonated < 100
     })
 
     var backers = res.filter(function (item) {
-      return item.role === 'BACKER' && item.type === 'USER' && item.isActive
+      return item.isActive &&
+        item.role === 'BACKER' &&
+        item.totalAmountDonated < 10
     })
 
-    $('.support-sponsors').html(organizations.map(createSupportItem).join(''))
+    $('.gold-sponsors').html(goldSponsors.map(function (item) {
+      return createSupportItem(item, 'gold')
+    }).join(''))
+    $('.bronze-sponsors').html(bronzeSponsors.map(createSupportItem).join(''))
     $('.support-backers').html(backers.map(createSupportItem).join(''))
   })
 })