diff --git a/app/app/settings.py b/app/app/settings.py index 73834bbd180..fc6edddb4d8 100644 --- a/app/app/settings.py +++ b/app/app/settings.py @@ -874,5 +874,7 @@ def callback(request): PHONE_SALT = env('PHONE_SALT', default='THIS_IS_INSECURE_CHANGE_THIS_PLEASE') HYPERCHARGE_BOUNTIES_PROFILE_HANDLE = env('HYPERCHARGE_BOUNTIES_PROFILE', default='gitcoinbot') +ADDEVENT_CLIENT_ID = env('ADDEVENT_CLIENT_ID', default='') +ADDEVENT_API_TOKEN = env('ADDEVENT_API_TOKEN', default='') -BRIGHTID_PRIVATE_KEY = env('BRIGHTID_PRIVATE_KEY', default='wrong-private-key') +BRIGHTID_PRIVATE_KEY = env('BRIGHTID_PRIVATE_KEY', default='wrong-private-key') \ No newline at end of file diff --git a/app/app/urls.py b/app/app/urls.py index 03a804775f8..53fa07f3c8d 100644 --- a/app/app/urls.py +++ b/app/app/urls.py @@ -293,6 +293,7 @@ path('api/v0.1/hackathon//save/', dashboard.views.save_hackathon, name='save_hackathon'), path('api/v1/hackathon//prizes', dashboard.views.hackathon_prizes, name='hackathon_prizes_api'), path('api/v0.1/hackathon//showcase/', dashboard.views.showcase, name='hackathon_showcase'), + path('api/v0.1/hackathon//events/', dashboard.views.events, name='hackathon_events'), path('api/v0.1/projects/', dashboard.views.get_project, name='project_context'), # action URLs url(r'^funder', retail.views.funder_bounties_redirect, name='funder_bounties_redirect'), diff --git a/app/assets/v2/images/hackathon/check.svg b/app/assets/v2/images/hackathon/check.svg new file mode 100644 index 00000000000..01e65de101e --- /dev/null +++ b/app/assets/v2/images/hackathon/check.svg @@ -0,0 +1,4 @@ + + + + diff --git a/app/assets/v2/images/hackathon/demo.png b/app/assets/v2/images/hackathon/demo.png new file mode 100644 index 00000000000..062813526fe Binary files /dev/null and b/app/assets/v2/images/hackathon/demo.png differ diff --git a/app/assets/v2/images/hackathon/demo.svg b/app/assets/v2/images/hackathon/demo.svg new file mode 100644 index 00000000000..5f745a6f03f --- /dev/null +++ b/app/assets/v2/images/hackathon/demo.svg @@ -0,0 +1,4 @@ + + + + diff --git a/app/assets/v2/images/hackathon/formation.svg b/app/assets/v2/images/hackathon/formation.svg new file mode 100644 index 00000000000..c903af8b413 --- /dev/null +++ b/app/assets/v2/images/hackathon/formation.svg @@ -0,0 +1,4 @@ + + + + diff --git a/app/assets/v2/images/hackathon/office.svg b/app/assets/v2/images/hackathon/office.svg new file mode 100644 index 00000000000..d1e001e56c7 --- /dev/null +++ b/app/assets/v2/images/hackathon/office.svg @@ -0,0 +1,4 @@ + + + + diff --git a/app/assets/v2/images/hackathon/pitch.svg b/app/assets/v2/images/hackathon/pitch.svg new file mode 100644 index 00000000000..91c6807a12f --- /dev/null +++ b/app/assets/v2/images/hackathon/pitch.svg @@ -0,0 +1,4 @@ + + + + diff --git a/app/assets/v2/images/hackathon/workshop.svg b/app/assets/v2/images/hackathon/workshop.svg new file mode 100644 index 00000000000..8115ca5c1df --- /dev/null +++ b/app/assets/v2/images/hackathon/workshop.svg @@ -0,0 +1,4 @@ + + + + diff --git a/app/assets/v2/js/pages/dashboard-hackathon.js b/app/assets/v2/js/pages/dashboard-hackathon.js index 857e66a100c..eaf0b9d817d 100644 --- a/app/assets/v2/js/pages/dashboard-hackathon.js +++ b/app/assets/v2/js/pages/dashboard-hackathon.js @@ -911,6 +911,9 @@ case 3: newPathName = 'participants'; break; + case 4: + newPathName = 'events'; + break; case 5: newPathName = 'showcase'; break; diff --git a/app/assets/v2/js/vue-components.js b/app/assets/v2/js/vue-components.js index ae123b6a3c8..ba35b473edd 100644 --- a/app/assets/v2/js/vue-components.js +++ b/app/assets/v2/js/vue-components.js @@ -402,6 +402,68 @@ Vue.component('project-directory', { }); +Vue.component('events', { + delimiters: [ '[[', ']]' ], + props: [], + data: function() { + return { + events: [] + }; + }, + methods: { + nth: function(d) { + if (d > 3 && d < 21) + return 'th'; + switch (d % 10) { + case 1: return 'st'; + case 2: return 'nd'; + case 3: return 'rd'; + default: return 'th'; + } + }, + fetchEvents: async function() { + const response = await fetchData(`/api/v0.1/hackathon/${document.hackathonObj.id}/events/`, 'GET'); + + this.$set(this, 'events', response.events.events); + }, + formatDate: function(event) { + const monthNames = [ + 'January', 'February', 'March', 'April', 'May', 'June', + 'July', 'August', 'September', 'October', 'November', 'December' + ]; + const date = event.date_start.split('/'); + const time = event.date_start_time; + const newDate = new Date(`${date[2]}-${date[0]}-${date[1]}T${time}`); + const month = monthNames[newDate.getMonth()]; + const day = newDate.getDay(); + const hours = newDate.getHours(); + const ampm = event.date_start_ampm.toLowerCase(); + + return `${month} ${day}${this.nth(newDate.getDay())}, ${hours} ${ampm} ET`; + }, + eventTag: function(event) { + const text = event.eventname; + + if (text.includes('formation')) { + return 'formation'; + } else if (text.includes('pitch')) { + return 'pitch'; + } else if (text.includes('check')) { + return 'check'; + } else if (text.includes('office')) { + return 'office'; + } else if (text.includes('demo')) { + return 'demo'; + } + + return 'workshop'; + } + }, + mounted() { + this.fetchEvents(); + } +}); + Vue.component('showcase', { delimiters: [ '[[', ']]' ], props: [], diff --git a/app/dashboard/migrations/0151_hackathonevent_calendar_id.py b/app/dashboard/migrations/0151_hackathonevent_calendar_id.py new file mode 100644 index 00000000000..b417d219e43 --- /dev/null +++ b/app/dashboard/migrations/0151_hackathonevent_calendar_id.py @@ -0,0 +1,18 @@ +# Generated by Django 2.2.4 on 2020-09-30 05:21 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('dashboard', '0150_auto_20200904_1505'), + ] + + operations = [ + migrations.AddField( + model_name='hackathonevent', + name='calendar_id', + field=models.CharField(blank=True, max_length=255), + ), + ] diff --git a/app/dashboard/models.py b/app/dashboard/models.py index e4ff1894c0f..77443d2e52a 100644 --- a/app/dashboard/models.py +++ b/app/dashboard/models.py @@ -4921,6 +4921,7 @@ class HackathonEvent(SuperModel): objects = HackathonEventQuerySet.as_manager() display_showcase = models.BooleanField(default=False) showcase = JSONField(default=dict, blank=True, null=True) + calendar_id = models.CharField(max_length=255, blank=True) def __str__(self): """String representation for HackathonEvent. diff --git a/app/dashboard/templates/dashboard/index-vue.html b/app/dashboard/templates/dashboard/index-vue.html index 5fcc014f5ca..35190a4d60a 100644 --- a/app/dashboard/templates/dashboard/index-vue.html +++ b/app/dashboard/templates/dashboard/index-vue.html @@ -622,6 +622,60 @@
Invite [[numUsers]] Users to the Bounty
+ + +
+ +
+
+

Events Schedule

+ {% if is_staff %} + + {% endif %} +
+
+
+
+ + + + + + +
+
+

Team formation

+

Pitch Day

+

Mid hack Check-In

+

Sponsor Office Hours

+

Workshop

+

Demo Day

+

[[formatDate(event)]]

+

[[event.title]] [[ event.organizer ? `with ${event.organizer}` : '']]

+

+
+
+
+
+ Add to Calendar + [[event.date_start]] [[event.date_start_time]] + [[event.date_end]] [[event.date_end_time]] + [[event.timezone]] + [[event.title]] + [[event.description]] + [[event.location]] +
+
+
+
+
+
+
+