diff --git a/app/app/urls.py b/app/app/urls.py index 32ef1738b55..375d87d72cf 100644 --- a/app/app/urls.py +++ b/app/app/urls.py @@ -222,7 +222,11 @@ path('hackathon//new', dashboard.views.new_hackathon_bounty, name='new_hackathon_bounty2'), path('hackathon//', dashboard.views.hackathon, name='hackathon'), path('hackathon/dashboard/', dashboard.views.dashboard_sponsors, name='sponsors-dashboard'), - path('hackathon/dashboard//', dashboard.views.dashboard_sponsors, name='sponsors-dashboard'), + path( + 'hackathon/dashboard//', + dashboard.views.dashboard_sponsors, + name='sponsors-dashboard' + ), path('hackathon/', dashboard.views.hackathon, name='hackathon2'), path('hackathon//onboard/', dashboard.views.hackathon_onboard, name='hackathon_onboard2'), path('hackathon///', dashboard.views.hackathon, name='hackathon'), diff --git a/app/assets/v2/js/pages/dashboard.js b/app/assets/v2/js/pages/dashboard.js index 3bef9b5680e..cfdd53004e6 100644 --- a/app/assets/v2/js/pages/dashboard.js +++ b/app/assets/v2/js/pages/dashboard.js @@ -345,7 +345,7 @@ var get_search_URI = function(offset, order) { values.forEach(function(_value) { var _key; - if (_value === 'createdByMe') { + if (_value === 'createdByMe' || _value === 'stale') { _key = 'bounty_owner_github_username'; _value = document.contxt.github_handle; } else if (_value === 'startedByMe') { @@ -529,6 +529,18 @@ var refreshBounties = function(event, offset, append) { } explorer.bounties_request = $.get(bountiesURI, function(results, x) { + + // Filter results by open bounties created more than 3 days ago + if ($('input[name="bounty_filter"]:checked').val().toString() === 'stale') { + results = results.filter(bounty => { + let now = new Date(); + let created = new Date(bounty.web3_created); + let daysAgo = new Date(now.setDate(now.getDate() - 3)); + + return daysAgo > created && bounty.status === 'open'; + }); + } + results = sanitizeAPIResults(results); if (results.length === 0 && !append) { diff --git a/app/dashboard/templates/dashboard/sidebar_search.html b/app/dashboard/templates/dashboard/sidebar_search.html index 0d2e2e9196d..9ca59c5e231 100644 --- a/app/dashboard/templates/dashboard/sidebar_search.html +++ b/app/dashboard/templates/dashboard/sidebar_search.html @@ -1,18 +1,19 @@ {% comment %} - Copyright (C) 2020 Gitcoin Core +Copyright (C) 2020 Gitcoin Core - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published - by the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU Affero General Public License as published +by the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Affero General Public License for more details. - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . +You should have received a copy of the GNU Affero General Public License +along with this program. If not, see +. {% endcomment %} {% load i18n static %}