From 5507fcd13f9730b263eb77b97c0488054a99cf93 Mon Sep 17 00:00:00 2001 From: octavioamu Date: Wed, 13 Nov 2019 22:04:00 -0300 Subject: [PATCH 01/27] fix filters and additions --- app/app/urls.py | 1 + .../dashboard/hackathon/projects.html | 57 ++++++++++++------- app/dashboard/templates/dashboard/index.html | 3 + app/dashboard/views.py | 25 +++++++- 4 files changed, 64 insertions(+), 22 deletions(-) diff --git a/app/app/urls.py b/app/app/urls.py index f872d0d29cf..ab0273feee9 100644 --- a/app/app/urls.py +++ b/app/app/urls.py @@ -187,6 +187,7 @@ path('hackathon//', dashboard.views.hackathon, name='hackathon'), path('hackathon/onboard//', dashboard.views.hackathon_onboard, name='hackathon_onboard'), path('hackathon/projects//', dashboard.views.hackathon_projects, name='hackathon_projects'), + path('hackathon/projects/', dashboard.views.hackathon_projects, name='hackathon_projects2'), path('modal/new_project//', dashboard.views.hackathon_get_project, name='hackathon_get_project'), path( 'modal/new_project///', diff --git a/app/dashboard/templates/dashboard/hackathon/projects.html b/app/dashboard/templates/dashboard/hackathon/projects.html index 297e5eb5ec5..26296f35084 100644 --- a/app/dashboard/templates/dashboard/hackathon/projects.html +++ b/app/dashboard/templates/dashboard/hackathon/projects.html @@ -99,6 +99,7 @@ {% endif %}

{{hackathon.name}} Projects

{{ hackathon.start_date|date:"M j, Y" }} - {{ hackathon.end_date|date:"M j, Y" }} + @@ -106,34 +107,45 @@

{{hackathon.name}} Projects

{% if hackathon.end_date|timeuntil >= "1 min" and not projects%}

This hackathon event is running until {{hackathon.end_date}}, please check again later.

{% endif %} -
-
-
-
- -
- - -
+ + +
+
+ +
+ +
- {% if query %} - Results for: {% for q in query %}{{ q }} {% endfor %} - {% endif %} - +
+ {% if query %} + Results for: {% for q in query %}{{ q }} {% endfor %} + {% endif %}
-
+
+
+ +
+ +
+
+
+ -
+
Order by: Newest | Oldest
-
+
-
{% for project in projects %}
@@ -195,7 +207,7 @@

No projects submitted yet

{% include 'shared/hackathon_sponsors.html' %} - {% if hackathon.end_date|timesince <= "1 min" %} -
- {% if hackathon.show_results %} - Projects - {% endif %} +
+ {% if hackathon.show_results %} + Projects + {% endif %} + {% if hackathon.end_date|timesince <= "1 min" %} Hackathon Guide -
- {% endif %} + {% endif %} +
{% else %} {% include 'dashboard/ftux.html' %} From f7f6a0c4a965b17ae13ba1b33a3d21ca65ea2b6e Mon Sep 17 00:00:00 2001 From: octavioamu Date: Thu, 14 Nov 2019 18:25:33 -0300 Subject: [PATCH 03/27] add projects to bounty details --- app/dashboard/templates/bounty/details.html | 44 +++++++++++++++++++-- app/dashboard/views.py | 2 + 2 files changed, 43 insertions(+), 3 deletions(-) diff --git a/app/dashboard/templates/bounty/details.html b/app/dashboard/templates/bounty/details.html index be91099c926..c5c16caf748 100644 --- a/app/dashboard/templates/bounty/details.html +++ b/app/dashboard/templates/bounty/details.html @@ -145,14 +145,14 @@

+ {% if prize_projects %} + + {% endif %}
{% trans "Funder" %}
diff --git a/app/dashboard/views.py b/app/dashboard/views.py index 6fe4ca6d5a0..ed5460ee109 100644 --- a/app/dashboard/views.py +++ b/app/dashboard/views.py @@ -1874,6 +1874,8 @@ def bounty_details(request, ghuser='', ghrepo='', ghissue=0, stdbounties_id=None if bounty.event: params['event_tag'] = bounty.event.slug + params['prize_projects'] = HackathonProject.objects.filter(hackathon=bounty.event, bounty=bounty).exclude(status='invalid').prefetch_related('profiles') + print(params['prize_projects']) helper_handle_snooze(request, bounty) helper_handle_approvals(request, bounty) From 445667d533c51cdff2bd258afd0f4e12c364c34a Mon Sep 17 00:00:00 2001 From: octavioamu Date: Thu, 14 Nov 2019 18:39:18 -0300 Subject: [PATCH 04/27] bounty duplication agh --- app/dashboard/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/dashboard/views.py b/app/dashboard/views.py index ed5460ee109..0007ef97106 100644 --- a/app/dashboard/views.py +++ b/app/dashboard/views.py @@ -1874,7 +1874,7 @@ def bounty_details(request, ghuser='', ghrepo='', ghissue=0, stdbounties_id=None if bounty.event: params['event_tag'] = bounty.event.slug - params['prize_projects'] = HackathonProject.objects.filter(hackathon=bounty.event, bounty=bounty).exclude(status='invalid').prefetch_related('profiles') + params['prize_projects'] = HackathonProject.objects.filter(hackathon=bounty.event, bounty__standard_bounties_id=bounty.standard_bounties_id).exclude(status='invalid').prefetch_related('profiles') print(params['prize_projects']) helper_handle_snooze(request, bounty) From a4b0537d84e3b8d4cc4c792ca7c2920c299d2f2e Mon Sep 17 00:00:00 2001 From: octavioamu Date: Thu, 14 Nov 2019 18:48:53 -0300 Subject: [PATCH 05/27] fix spacing --- app/dashboard/templates/bounty/details.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/dashboard/templates/bounty/details.html b/app/dashboard/templates/bounty/details.html index c5c16caf748..ee772899487 100644 --- a/app/dashboard/templates/bounty/details.html +++ b/app/dashboard/templates/bounty/details.html @@ -207,12 +207,12 @@
{% trans "Projects" %}
{% endif %} {% endfor %} {% if project.logo %} - + {% else %} - + {% endif %} -
+
{{project.name}}
Team Members From b43f9067b0c8323265100b15f3e2779f30de81f0 Mon Sep 17 00:00:00 2001 From: Aditya Anand M C Date: Thu, 14 Nov 2019 13:52:04 -0800 Subject: [PATCH 06/27] bug: fixed wonky button --- app/assets/v2/css/bounty.css | 10 ---------- app/assets/v2/images/comment.svg | 1 - app/assets/v2/js/pages/bounty_details.js | 4 +--- app/dashboard/templates/bounty/details.html | 16 ---------------- 4 files changed, 1 insertion(+), 30 deletions(-) delete mode 100644 app/assets/v2/images/comment.svg diff --git a/app/assets/v2/css/bounty.css b/app/assets/v2/css/bounty.css index 9d5a63713e9..7fc05178d17 100644 --- a/app/assets/v2/css/bounty.css +++ b/app/assets/v2/css/bounty.css @@ -410,16 +410,6 @@ a.btn { margin-left: 5px; } -#btn-white .github-comment { - color: #FFFFFF; - position: absolute; - font-size: 0.625rem; - text-align: center; - width: 1.25rem; - top: 0.4375rem; - right: 0.5rem; -} - .activity { margin-bottom: 10px; } diff --git a/app/assets/v2/images/comment.svg b/app/assets/v2/images/comment.svg deleted file mode 100644 index 9928219e45d..00000000000 --- a/app/assets/v2/images/comment.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/app/assets/v2/js/pages/bounty_details.js b/app/assets/v2/js/pages/bounty_details.js index 8d94d3127a2..fc8d5940802 100644 --- a/app/assets/v2/js/pages/bounty_details.js +++ b/app/assets/v2/js/pages/bounty_details.js @@ -1247,9 +1247,7 @@ var do_actions = function(result) { text: (result['repo_type'] === 'private' ? ' ' + gettext('Private Repo') : '' + gettext('View On Github')), parent: 'github_actions', - title: gettext('View issue details and comments on Github'), - comments: result['github_comments'], - color: 'comments' + title: gettext('View issue details and comments on Github') }; actions.push(_entry); diff --git a/app/dashboard/templates/bounty/details.html b/app/dashboard/templates/bounty/details.html index ee772899487..6959673ab81 100644 --- a/app/dashboard/templates/bounty/details.html +++ b/app/dashboard/templates/bounty/details.html @@ -262,22 +262,6 @@
{% trans "Funder" %}
[[:text]] ( [[:pending_acceptance]] ) - [[else color == 'comments']] - - [[if comments]] - - [[:text]] - - Comment - - [[:comments]] - - - - [[else]] - [[:text]] - [[/if]] - [[else]] [[:text]] From 70a3215e1e821d68c1fe58cfc68d680c0de4a22e Mon Sep 17 00:00:00 2001 From: Aditya Anand M C Date: Thu, 14 Nov 2019 14:51:30 -0800 Subject: [PATCH 07/27] fix --- app/grants/templates/grants/detail/info.html | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/grants/templates/grants/detail/info.html b/app/grants/templates/grants/detail/info.html index b5a5a6a7afe..0d06b0fd1f6 100644 --- a/app/grants/templates/grants/detail/info.html +++ b/app/grants/templates/grants/detail/info.html @@ -212,11 +212,6 @@

{% trans "Edit Info" %}

-
+ {% csrf_token %}
From 3e2fb185ef261a96442120e66a9a9dd1532044c2 Mon Sep 17 00:00:00 2001 From: Aditya Anand M C Date: Thu, 14 Nov 2019 16:36:12 -0800 Subject: [PATCH 08/27] bug: add teammates during grant creation --- app/assets/v2/js/grants/new.js | 2 +- app/grants/views.py | 22 ++++++++++++++++++++-- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/app/assets/v2/js/grants/new.js b/app/assets/v2/js/grants/new.js index cb2cbc8562b..f72634026f2 100644 --- a/app/assets/v2/js/grants/new.js +++ b/app/assets/v2/js/grants/new.js @@ -167,7 +167,7 @@ const init = () => { formData.append('contract_version', $('#contract_version').val()); formData.append('transaction_hash', $('#transaction_hash').val()); formData.append('network', $('#network').val()); - formData.append('team_members', $('#input-team_members').val()); + formData.append('team_members[]', $('#input-team_members').val()); saveGrant(formData, false); document.issueURL = linkURL; diff --git a/app/grants/views.py b/app/grants/views.py index 349185e7dca..ecd5764f355 100644 --- a/app/grants/views.py +++ b/app/grants/views.py @@ -300,8 +300,17 @@ def grant_new(request): } grant = Grant.objects.create(**grant_kwargs) new_grant_admin(grant) + + team_members = (team_members[0].split(',')) team_members.append(profile.id) - grant.team_members.add(*list(filter(lambda member_id: member_id > 0, map(int, team_members)))) + team_members = list(set(team_members)) + + for i in range(0, len(team_members)): + team_members[i] = int(team_members[i]) + + grant.team_members.add(*team_members) + grant.save() + return JsonResponse({ 'success': True, }) @@ -377,8 +386,17 @@ def grant_new_v0(request): 'logo': logo, } grant = Grant.objects.create(**grant_kwargs) + + team_members = (team_members[0].split(',')) team_members.append(profile.id) - grant.team_members.add(*list(filter(lambda member_id: member_id > 0, map(int, team_members)))) + team_members = list(set(team_members)) + + for i in range(0, len(team_members)): + team_members[i] = int(team_members[i]) + + grant.team_members.add(*team_members) + grant.save() + return JsonResponse({ 'success': True, }) From 9f3c1016fea9cd1b159d42ec69f186e7384d3df0 Mon Sep 17 00:00:00 2001 From: Aditya Anand M C Date: Thu, 14 Nov 2019 16:44:59 -0800 Subject: [PATCH 09/27] bug: remove dulpicate filter --- .../templates/dashboard/sidebar_search.html | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/app/dashboard/templates/dashboard/sidebar_search.html b/app/dashboard/templates/dashboard/sidebar_search.html index 95baeb23cf7..09429e96dae 100644 --- a/app/dashboard/templates/dashboard/sidebar_search.html +++ b/app/dashboard/templates/dashboard/sidebar_search.html @@ -84,19 +84,6 @@
-
-
- Applicants -
-
- -
-
-
{% trans "Organization name" %} From 583840fa50ad360303bba86754125e91411712ed Mon Sep 17 00:00:00 2001 From: Owocki Date: Thu, 14 Nov 2019 18:58:38 -0800 Subject: [PATCH 10/27] a few fixes for results, orbi analytics, and quests --- app/quests/views.py | 12 +----------- app/retail/templates/results.html | 6 ++++-- app/retail/templates/shared/tag_manager_1.html | 5 ----- app/retail/views.py | 1 - 4 files changed, 5 insertions(+), 19 deletions(-) diff --git a/app/quests/views.py b/app/quests/views.py index 91971d1ebca..bfc051e9a40 100644 --- a/app/quests/views.py +++ b/app/quests/views.py @@ -271,17 +271,6 @@ def index(request): if popular.exists(): quests.append(('Popular', get_package_helper(popular, request))) - print(f" phase1.3 at {round(time.time(),2)} ") - # new quests! - new_quests = Quest.objects.filter(visible=True, created_on__gt=(timezone.now() - timezone.timedelta(hours=hours_new))).order_by('-ui_data__success_pct') - if new_quests.exists(): - quests.append(('New', get_package_helper(new_quests, request))) - - print(f" phase1.4 at {round(time.time(),2)} ") - # popular quests - popular = Quest.objects.filter(visible=True).order_by('-ui_data__attempts_count')[0:5] - if popular.exists(): - quests.append(('Popular', get_package_helper(popular, request))) print(f" phase2 at {round(time.time(),2)} ") rewards_schedule = [] @@ -294,6 +283,7 @@ def index(request): 'reward_multiplier': 1/reward_denominator }) + print(f" phase3 at {round(time.time(),2)} ") attempt_count = QuestAttempt.objects.count() success_count = QuestAttempt.objects.filter(success=True).count() diff --git a/app/retail/templates/results.html b/app/retail/templates/results.html index 3d699f5a0c7..b3aa318bae2 100644 --- a/app/retail/templates/results.html +++ b/app/retail/templates/results.html @@ -162,7 +162,7 @@

Platform Activities

-
+
{% include 'shared/activity_container.html' %}
@@ -541,10 +541,12 @@

{% trans "TLDR - We're building a Mesh Network document.offset_loaded = true; } }, 3000); + $.get('/activity', function(html){ + $("#activities").html($(html).find('.activity_stream').html()); + }) }); - {% include 'shared/activity_scripts.html' %} diff --git a/app/retail/templates/shared/tag_manager_1.html b/app/retail/templates/shared/tag_manager_1.html index 2c119277515..70e52036db5 100644 --- a/app/retail/templates/shared/tag_manager_1.html +++ b/app/retail/templates/shared/tag_manager_1.html @@ -23,11 +23,6 @@ })(window,document,'script','dataLayer','GTM-WVPQHKX'); - - - {% else %}