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

Hackathon - add featured bounties #4658

Merged
merged 2 commits into from Jun 20, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
48 changes: 23 additions & 25 deletions app/assets/v2/js/pages/dashboard.js
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 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() {
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
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