Skip to content

Commit

Permalink
Merge pull request gitcoinco#4658 from gitcoinco/hackathon-featured
Browse files Browse the repository at this point in the history
Hackathon - add featured bounties
  • Loading branch information
thelostone-mc authored Jun 20, 2019
2 parents 01c2ae9 + 2f79fd4 commit 653d229
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 26 deletions.
48 changes: 23 additions & 25 deletions app/assets/v2/js/pages/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 [email protected]') }, '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 [email protected]') }, 'error');
}).always(function() {
$('.loading').css('display', 'none');
});
};

window.addEventListener('load', function() {
Expand Down Expand Up @@ -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();
});

Expand Down
2 changes: 1 addition & 1 deletion app/dashboard/templates/shared/search_bar.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<select name="sort_option" id="sort_option">
<option value="-web3_created">{% trans "Created: Recent" %}</option>
<option value="web3_created">{% trans "Created: Oldest" %}</option>
<option value="-_val_usd_db">{% trans "Value: Highest" %}</option>
<option value="-_val_usd_db" {% if hackathon %}selected{% endif %}>{% trans "Value: Highest" %}</option>
<option value="_val_usd_db">{% trans "Value: Lowest" %}</option>
</select>
</div>
Expand Down

0 comments on commit 653d229

Please sign in to comment.