From 544e91bf8b800b958e1b8e707ced4799669521c1 Mon Sep 17 00:00:00 2001 From: octavioamu Date: Wed, 19 Jun 2019 17:44:19 -0300 Subject: [PATCH] add featured bounties --- app/assets/v2/js/pages/dashboard.js | 48 +++++++++---------- .../templates/shared/search_bar.html | 2 +- 2 files changed, 24 insertions(+), 26 deletions(-) diff --git a/app/assets/v2/js/pages/dashboard.js b/app/assets/v2/js/pages/dashboard.js index 2780341100f..b3e8c5ed36d 100644 --- a/app/assets/v2/js/pages/dashboard.js +++ b/app/assets/v2/js/pages/dashboard.js @@ -544,33 +544,31 @@ var refreshBounties = function(event, offset, append, do_save_search) { $('.loading').css('display', 'none'); }); - if (!document.hackathon) { - explorer.bounties_request = $.get(featuredBountiesURI, function(results, x) { - results = sanitizeAPIResults(results); - - if (results.length === 0 && !append) { - $('.featured-bounties').hide(); - if (localStorage['referrer'] === 'onboard') { - $('.no-results').removeClass('hidden'); - $('#dashboard-content').addClass('hidden'); - } else { - $('.nonefound').css('display', 'none'); - } + explorer.bounties_request = $.get(featuredBountiesURI, function(results, x) { + results = sanitizeAPIResults(results); + + if (results.length === 0 && !append) { + $('.featured-bounties').hide(); + if (localStorage['referrer'] === 'onboard') { + $('.no-results').removeClass('hidden'); + $('#dashboard-content').addClass('hidden'); + } else { + $('.nonefound').css('display', 'none'); } + } - var html = renderFeaturedBountiesFromResults(results, true); + var html = renderFeaturedBountiesFromResults(results, true); - if (html) { - $('.featured-bounties').show(); - $('#featured-card-container').html(html); - } - }).fail(function() { - if (explorer.bounties_request.readyState !== 0) - _alert({ message: gettext('got an error. please try again, or contact support@gitcoin.co') }, 'error'); - }).always(function() { - $('.loading').css('display', 'none'); - }); - } + if (html) { + $('.featured-bounties').show(); + $('#featured-card-container').html(html); + } + }).fail(function() { + if (explorer.bounties_request.readyState !== 0) + _alert({ message: gettext('got an error. please try again, or contact support@gitcoin.co') }, 'error'); + }).always(function() { + $('.loading').css('display', 'none'); + }); }; window.addEventListener('load', function() { @@ -790,7 +788,7 @@ $(document).ready(function() { // sidebar filters $('.sidebar_search input[type=checkbox], .sidebar_search label').change(function(e) { reset_offset(); - refreshBounties(null, 0, false, true); + // refreshBounties(null, 0, false, true); e.preventDefault(); }); diff --git a/app/dashboard/templates/shared/search_bar.html b/app/dashboard/templates/shared/search_bar.html index 7f3bfd3fa06..dd42d23fd3e 100644 --- a/app/dashboard/templates/shared/search_bar.html +++ b/app/dashboard/templates/shared/search_bar.html @@ -25,7 +25,7 @@