From 699d6d84b983934ea1e8f25459f89983e5b7635a Mon Sep 17 00:00:00 2001 From: Miguel Angel G Date: Tue, 31 Mar 2020 17:46:48 -0600 Subject: [PATCH 1/5] Add option to looking for team members --- .../migrations/0096_auto_20200331_2325.py | 23 +++++++++++++ app/dashboard/models.py | 6 ++++ .../dashboard/hackathon/project_new.html | 10 ++++++ app/dashboard/views.py | 34 +++++++++++-------- 4 files changed, 58 insertions(+), 15 deletions(-) create mode 100644 app/dashboard/migrations/0096_auto_20200331_2325.py diff --git a/app/dashboard/migrations/0096_auto_20200331_2325.py b/app/dashboard/migrations/0096_auto_20200331_2325.py new file mode 100644 index 00000000000..a28e39fe42e --- /dev/null +++ b/app/dashboard/migrations/0096_auto_20200331_2325.py @@ -0,0 +1,23 @@ +# Generated by Django 2.2.4 on 2020-03-31 23:25 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('dashboard', '0095_hackathonevent_visible'), + ] + + operations = [ + migrations.AddField( + model_name='hackathonproject', + name='looking_members', + field=models.BooleanField(default=False), + ), + migrations.AddField( + model_name='hackathonproject', + name='message', + field=models.CharField(blank=True, default='', max_length=150), + ), + ] diff --git a/app/dashboard/models.py b/app/dashboard/models.py index 4349d4173ab..f8324f11cbe 100644 --- a/app/dashboard/models.py +++ b/app/dashboard/models.py @@ -4666,6 +4666,12 @@ class HackathonProject(SuperModel): choices=PROJECT_STATUS, blank=True ) + message = models.CharField( + max_length=150, + blank=True, + default='' + ) + looking_members = models.BooleanField(default=False) chat_channel_id = models.CharField(max_length=255, blank=True, null=True) class Meta: diff --git a/app/dashboard/templates/dashboard/hackathon/project_new.html b/app/dashboard/templates/dashboard/hackathon/project_new.html index 5b846830e3a..4efee8f84c3 100644 --- a/app/dashboard/templates/dashboard/hackathon/project_new.html +++ b/app/dashboard/templates/dashboard/hackathon/project_new.html @@ -71,6 +71,16 @@

Tell us about your project

Search Gitcoin usernames. +
+
+ + +
+
+ Enter short message, 150 characters + +
+
diff --git a/app/dashboard/views.py b/app/dashboard/views.py index 87a00b92ebf..cbd4989a27d 100644 --- a/app/dashboard/views.py +++ b/app/dashboard/views.py @@ -3899,6 +3899,8 @@ def hackathon_save_project(request): bounty_id = request.POST.get('bounty_id') profiles = request.POST.getlist('profiles[]') logo = request.FILES.get('logo') + looking_members = request.POST.get('looking-members', '') == 'on' + message = request.POST.get('looking-members-message', '')[:150] profile = request.user.profile if request.user.is_authenticated and hasattr(request.user, 'profile') else None error_response = invalid_file_response(logo, supported=['image/png', 'image/jpeg', 'image/jpg']) @@ -3919,7 +3921,9 @@ def hackathon_save_project(request): 'logo': request.FILES.get('logo'), 'bounty': bounty_obj, 'summary': clean(request.POST.get('summary'), strip=True), - 'work_url': clean(request.POST.get('work_url'), strip=True) + 'work_url': clean(request.POST.get('work_url'), strip=True), + 'looking_members': looking_members, + 'message': message, } try: @@ -3939,24 +3943,24 @@ def hackathon_save_project(request): 'logo': request.FILES.get('logo', project.first().logo) }) - project.update(**kwargs) + # project.update(**kwargs) - try: - bounty_profile = Profile.objects.get(handle=project.bounty.bounty_owner_github_username.lower()) - if bounty_profile.chat_id is '' or bounty_profile.chat_id is None: - created, bounty_profile = associate_chat_to_profile(bounty_profile) + #try: + # bounty_profile = Profile.objects.get(handle=project.bounty.bounty_owner_github_username.lower()) + # if bounty_profile.chat_id is '' or bounty_profile.chat_id is None: + # created, bounty_profile = associate_chat_to_profile(bounty_profile) - profiles_to_connect.append(bounty_profile.chat_id) - except Exception as e: - logger.info("Bounty Profile owner not apart of gitcoin") + # profiles_to_connect.append(bounty_profile.chat_id) + #except Exception as e: + # logger.info("Bounty Profile owner not apart of gitcoin") - for profile_id in profiles: - curr_profile = Profile.objects.get(id=profile_id) - if not curr_profile.chat_id: - created, curr_profile = associate_chat_to_profile(curr_profile) - profiles_to_connect.append(curr_profile.chat_id) + #for profile_id in profiles: + # curr_profile = Profile.objects.get(id=profile_id) + # if not curr_profile.chat_id: + # created, curr_profile = associate_chat_to_profile(curr_profile) + # profiles_to_connect.append(curr_profile.chat_id) - add_to_channel.delay(project.first().chat_channel_id, profiles_to_connect) + #add_to_channel.delay(project.first().chat_channel_id, profiles_to_connect) profiles.append(str(profile.id)) project.first().profiles.set(profiles) From 21c32310f439bcb9204f6df5949a1a9b806f6a83 Mon Sep 17 00:00:00 2001 From: Miguel Angel G Date: Tue, 31 Mar 2020 18:27:57 -0600 Subject: [PATCH 2/5] Add banner for hackathons --- .../migrations/0096_hackathonevent_banner.py | 18 ++++++++++++++++++ app/dashboard/models.py | 1 + 2 files changed, 19 insertions(+) create mode 100644 app/dashboard/migrations/0096_hackathonevent_banner.py diff --git a/app/dashboard/migrations/0096_hackathonevent_banner.py b/app/dashboard/migrations/0096_hackathonevent_banner.py new file mode 100644 index 00000000000..861af11e399 --- /dev/null +++ b/app/dashboard/migrations/0096_hackathonevent_banner.py @@ -0,0 +1,18 @@ +# Generated by Django 2.2.4 on 2020-04-01 00:20 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('dashboard', '0095_hackathonevent_visible'), + ] + + operations = [ + migrations.AddField( + model_name='hackathonevent', + name='banner', + field=models.ImageField(blank=True, null=True, upload_to=''), + ), + ] diff --git a/app/dashboard/models.py b/app/dashboard/models.py index f8324f11cbe..bfd1dd44522 100644 --- a/app/dashboard/models.py +++ b/app/dashboard/models.py @@ -4508,6 +4508,7 @@ class HackathonEvent(SuperModel): logo_svg = models.FileField(blank=True) start_date = models.DateTimeField() end_date = models.DateTimeField() + banner = models.ImageField(null=True, blank=True) background_color = models.CharField(max_length=255, null=True, blank=True, help_text='hexcode for the banner, default to white') text_color = models.CharField(max_length=255, null=True, blank=True, help_text='hexcode for the text, default to black') identifier = models.CharField(max_length=255, default='', help_text='used for custom styling for the banner') From e4e1475d4a4d2e92f51735cbba5c9769477919b9 Mon Sep 17 00:00:00 2001 From: Miguel Angel G Date: Tue, 31 Mar 2020 23:12:54 -0600 Subject: [PATCH 3/5] Restored commented chat functionality on hackathon projects --- app/dashboard/views.py | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/app/dashboard/views.py b/app/dashboard/views.py index cbd4989a27d..6876b736927 100644 --- a/app/dashboard/views.py +++ b/app/dashboard/views.py @@ -3943,24 +3943,24 @@ def hackathon_save_project(request): 'logo': request.FILES.get('logo', project.first().logo) }) - # project.update(**kwargs) + project.update(**kwargs) - #try: - # bounty_profile = Profile.objects.get(handle=project.bounty.bounty_owner_github_username.lower()) - # if bounty_profile.chat_id is '' or bounty_profile.chat_id is None: - # created, bounty_profile = associate_chat_to_profile(bounty_profile) + try: + bounty_profile = Profile.objects.get(handle=project.bounty.bounty_owner_github_username.lower()) + if bounty_profile.chat_id is '' or bounty_profile.chat_id is None: + created, bounty_profile = associate_chat_to_profile(bounty_profile) - # profiles_to_connect.append(bounty_profile.chat_id) - #except Exception as e: - # logger.info("Bounty Profile owner not apart of gitcoin") + profiles_to_connect.append(bounty_profile.chat_id) + except Exception as e: + logger.info("Bounty Profile owner not apart of gitcoin") - #for profile_id in profiles: - # curr_profile = Profile.objects.get(id=profile_id) - # if not curr_profile.chat_id: - # created, curr_profile = associate_chat_to_profile(curr_profile) - # profiles_to_connect.append(curr_profile.chat_id) + for profile_id in profiles: + curr_profile = Profile.objects.get(id=profile_id) + if not curr_profile.chat_id: + created, curr_profile = associate_chat_to_profile(curr_profile) + profiles_to_connect.append(curr_profile.chat_id) - #add_to_channel.delay(project.first().chat_channel_id, profiles_to_connect) + add_to_channel.delay(project.first().chat_channel_id, profiles_to_connect) profiles.append(str(profile.id)) project.first().profiles.set(profiles) From 4984c4f15eda275b2df57ea58c07e4932f3ea804 Mon Sep 17 00:00:00 2001 From: Miguel Angel G Date: Wed, 1 Apr 2020 14:39:04 -0600 Subject: [PATCH 4/5] Squash migrations on dashboard --- ...0331_2325.py => 0096_auto_20200401_2038.py} | 7 ++++++- .../migrations/0096_hackathonevent_banner.py | 18 ------------------ 2 files changed, 6 insertions(+), 19 deletions(-) rename app/dashboard/migrations/{0096_auto_20200331_2325.py => 0096_auto_20200401_2038.py} (70%) delete mode 100644 app/dashboard/migrations/0096_hackathonevent_banner.py diff --git a/app/dashboard/migrations/0096_auto_20200331_2325.py b/app/dashboard/migrations/0096_auto_20200401_2038.py similarity index 70% rename from app/dashboard/migrations/0096_auto_20200331_2325.py rename to app/dashboard/migrations/0096_auto_20200401_2038.py index a28e39fe42e..fe398cf8f5e 100644 --- a/app/dashboard/migrations/0096_auto_20200331_2325.py +++ b/app/dashboard/migrations/0096_auto_20200401_2038.py @@ -1,4 +1,4 @@ -# Generated by Django 2.2.4 on 2020-03-31 23:25 +# Generated by Django 2.2.4 on 2020-04-01 20:38 from django.db import migrations, models @@ -10,6 +10,11 @@ class Migration(migrations.Migration): ] operations = [ + migrations.AddField( + model_name='hackathonevent', + name='banner', + field=models.ImageField(blank=True, null=True, upload_to=''), + ), migrations.AddField( model_name='hackathonproject', name='looking_members', diff --git a/app/dashboard/migrations/0096_hackathonevent_banner.py b/app/dashboard/migrations/0096_hackathonevent_banner.py deleted file mode 100644 index 861af11e399..00000000000 --- a/app/dashboard/migrations/0096_hackathonevent_banner.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 2.2.4 on 2020-04-01 00:20 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('dashboard', '0095_hackathonevent_visible'), - ] - - operations = [ - migrations.AddField( - model_name='hackathonevent', - name='banner', - field=models.ImageField(blank=True, null=True, upload_to=''), - ), - ] From 6e34c7c5e6aaae3c04e8e3aeb422533c4883887f Mon Sep 17 00:00:00 2001 From: Miguel Angel G Date: Fri, 3 Apr 2020 01:18:11 -0600 Subject: [PATCH 5/5] Remove discord from project form --- app/dashboard/templates/addinterest.html | 13 +------------ .../templates/dashboard/hackathon/project_new.html | 10 ++++++++++ 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/app/dashboard/templates/addinterest.html b/app/dashboard/templates/addinterest.html index f022f5bf3c4..c0965d522fd 100644 --- a/app/dashboard/templates/addinterest.html +++ b/app/dashboard/templates/addinterest.html @@ -62,17 +62,6 @@
{% trans "Non-Disclosure Agreement" %}
- {% if bounty.event %} -
-
- - - Join Chat to get updates from our sponsors prizes and find help -
-
- {% endif %}
@@ -101,7 +90,7 @@
{% trans "Non-Disclosure Agreement" %}
- + {% else %}
diff --git a/app/dashboard/templates/dashboard/hackathon/project_new.html b/app/dashboard/templates/dashboard/hackathon/project_new.html index 4efee8f84c3..f18a397ab8e 100644 --- a/app/dashboard/templates/dashboard/hackathon/project_new.html +++ b/app/dashboard/templates/dashboard/hackathon/project_new.html @@ -122,6 +122,16 @@

Tell us about your project

Search Gitcoin usernames.
+
+
+ + +
+
+ Enter short message, 150 characters + +
+