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

Hackathons List Page #6297

Merged
merged 92 commits into from
Aug 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
3af71ef
add nav
walidmujahid May 29, 2020
cb9c0ab
finish new hackthon section;move subscription section
walidmujahid May 29, 2020
4471c4f
update hackathon card
walidmujahid May 29, 2020
e3b2226
add tribes section
walidmujahid May 29, 2020
9b63098
add featured hackathon section in header
walidmujahid May 29, 2020
443593b
style: center text;change margins
walidmujahid May 29, 2020
8c6583c
style: remove gutter width;resize image
walidmujahid May 29, 2020
ad327ce
style: add image height;remove margins from featured image
walidmujahid May 29, 2020
9ae1ad6
add customisable width/height for featured logo
walidmujahid May 29, 2020
2e65cf0
style: handle smaller screens
walidmujahid May 29, 2020
9822b29
fix: recreate migrations
walidmujahid May 29, 2020
104c153
add no-featured-hackathon section
walidmujahid May 29, 2020
401b9e3
TODO: filtering tribes
walidmujahid May 29, 2020
2dc9450
style: update margins
walidmujahid May 29, 2020
5523987
fix: stop changing featured bool on each save
walidmujahid May 29, 2020
257c4b6
style: fix tribes grid and columns
walidmujahid May 29, 2020
53a0a0c
fix: duplicate listing of same tribe
walidmujahid Apr 11, 2020
46d2114
handle showing tribes from most recent finsihed hackathon
walidmujahid Apr 11, 2020
d1e7d3f
feat: set a default tab on hackathons list
walidmujahid Apr 11, 2020
d7a9199
refactor: make variables plural
walidmujahid Apr 11, 2020
7dc04d3
show top four tribes if no current or upcoming hackathon exists
walidmujahid Apr 13, 2020
38a02b4
fix migrations
walidmujahid Apr 13, 2020
66922f2
refactor: move repetitive code into `get_hackathon_events`
walidmujahid Apr 14, 2020
16a24bf
rename get_hackathon_events to get_hackathon_event
walidmujahid Apr 14, 2020
b054d7f
refactor tribes filtering
walidmujahid Apr 14, 2020
b4d580b
move functions to dashboard.utils
walidmujahid Apr 14, 2020
60163af
fix migrations
walidmujahid Apr 15, 2020
6087807
fix: missing import
walidmujahid Apr 16, 2020
2810112
fix: recreate migrations
walidmujahid Apr 16, 2020
047d171
Fix styles and index errors
zoek1 May 4, 2020
3954885
Remove unused images and fix extension
zoek1 May 4, 2020
5b94962
feat: add workshops
walidmujahid May 14, 2020
08f808d
fix: misspelled attribute
walidmujahid May 20, 2020
de0533f
add speaker avatar;finish workshops section
walidmujahid May 20, 2020
0b2687a
fix: recreate migrations
walidmujahid May 20, 2020
1d4ade1
remove uneeded margin
walidmujahid May 21, 2020
1399bf5
update copy
walidmujahid May 21, 2020
bfd4126
fix: recreate migrations
walidmujahid May 21, 2020
553cef1
fix: padding and copy position
walidmujahid May 21, 2020
4e2900e
fix: recreate migrations
walidmujahid May 22, 2020
a1899b6
fix:recreate migrations
walidmujahid May 30, 2020
be8468d
add back prize amount and number of hackers
walidmujahid May 30, 2020
6cf04a9
fix: recreate migrations
walidmujahid Jun 7, 2020
bbb99f7
fix subscription sextion layout
walidmujahid Jun 7, 2020
33d9a1a
fix hackathon section
walidmujahid Jun 7, 2020
f08b441
fix: card-logo larger than card-header for some images
walidmujahid Jun 7, 2020
0adede2
add back deleted curly
walidmujahid Jun 7, 2020
c15a6fd
fix: skip overhead of dropdown of profile instances
walidmujahid Jun 9, 2020
9501fa4
adjust workshop layout
walidmujahid Jun 9, 2020
072c363
remove cover_max_width from HackathonWorkshop model
walidmujahid Jun 9, 2020
f068824
recreate migrations
walidmujahid Jun 9, 2020
65d69e2
adjust layout for hackathon card prize amount and builders row
walidmujahid Jun 9, 2020
b87a0cd
recreate migrations
walidmujahid Jun 13, 2020
e3232fb
receate migrations
walidmujahid Jun 16, 2020
c0b0f7f
recreate migrations
walidmujahid Jun 17, 2020
1855ec8
recreate migrations
walidmujahid Jun 23, 2020
a348125
recreate migrations
walidmujahid Jun 28, 2020
6db3df5
refactor: use bootstrap position-relative class
walidmujahid Jul 3, 2020
350adfe
refactor: remove commented lines
walidmujahid Jul 3, 2020
6f12a1b
recreate migrations
walidmujahid Jul 3, 2020
d789bb8
recreate mgrations
walidmujahid Jul 10, 2020
e622f9d
remove featured hackathon
walidmujahid Jul 24, 2020
0d9e7c3
remove workshops section
walidmujahid Jul 24, 2020
5c39f1e
remove tribe sections and trbe util functions
walidmujahid Jul 24, 2020
cc7e810
updste header background, logo and details
walidmujahid Jul 24, 2020
6ff6a87
remove value of prizes and number of builders from card
walidmujahid Jul 24, 2020
9845495
recreate migrations
walidmujahid Jul 24, 2020
6b1c547
use footer colour
walidmujahid Jul 24, 2020
84f683e
update subscription section
walidmujahid Jul 24, 2020
1392181
update tab section
walidmujahid Jul 24, 2020
dbb973f
update form button padding
walidmujahid Jul 24, 2020
2a5850a
add hackathon summary to model and template
walidmujahid Jul 24, 2020
9264ec9
remove lines in pre_save signal pertaining to removal of featured hac…
walidmujahid Jul 24, 2020
5f3b3a2
fix display of hackathon summary
walidmujahid Jul 24, 2020
9237aae
decrease padding to keep buttons on same line
walidmujahid Jul 24, 2020
e093c81
maek hackathon summary font smaller
walidmujahid Jul 24, 2020
90482fc
set secondary buttons
walidmujahid Jul 24, 2020
2d50469
add sponsors list to hackathon card
walidmujahid Jul 24, 2020
0b7494a
remove count from tabs
walidmujahid Jul 24, 2020
a7d1ce9
adjust tablist sizing on smaller screens
walidmujahid Jul 24, 2020
021f4d4
remove styles and refactor
walidmujahid Jul 24, 2020
b83a528
increase width of cards, logo sizes, and handle sizes for smaller scr…
walidmujahid Jul 24, 2020
8f47dd9
update cards
walidmujahid Jul 24, 2020
7ea70e1
add showcase button
walidmujahid Jul 24, 2020
f1e035e
recreate migrations
walidmujahid Jul 27, 2020
b789be9
recreate migrations
walidmujahid Jul 27, 2020
3965168
remove unused files
walidmujahid Jul 28, 2020
10484e2
style: revert to previous style
walidmujahid Jul 28, 2020
b712a15
style: add line
walidmujahid Jul 28, 2020
63667be
style: use `let`
walidmujahid Jul 28, 2020
11993b1
use zoek1's updates
walidmujahid Jul 28, 2020
0c3e3cd
recreate migrations
walidmujahid Jul 28, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions app/assets/v2/css/home.css
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,14 @@ figure:hover::before {
.video-row {
grid-template-columns: 1fr;
}

.box-cta {
margin: 0 !important;
}

.work-internet {
walidmujahid marked this conversation as resolved.
Show resolved Hide resolved
width: 17rem;
}
}

@media (max-width: 768px) {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions app/assets/v2/js/pages/hackathon-list.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
$(document).ready(function() {
$(document).on('click', '#tabs a', function(e) {
e.preventDefault();
let target = $(this).data('href');

$('.hackathons-list').addClass('hidden');
$('.nav-link').removeClass('active');
$('.nav-link').css('font-weight', '');
$(this).addClass('active');
$(this).css('font-weight', '700');


$('.hackathon-list').addClass('hidden');
$('.hackathon-list.' + target).removeClass('hidden');

$('html,body').animate({
scrollTop: '+=1px'
});
});
});
21 changes: 16 additions & 5 deletions app/dashboard/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,14 @@
from adminsortable2.admin import SortableInlineAdminMixin

from .models import (
Activity, Answer, BlockedURLFilter, BlockedUser, Bounty, BountyEvent, BountyFulfillment, BountyInvites,
BountySyncRequest, CoinRedemption, CoinRedemptionRequest, Coupon, Earning, FeedbackEntry, FundRequest,
HackathonEvent, HackathonProject, HackathonRegistration, HackathonSponsor, Interest, Investigation, LabsResearch,
ObjectView, Option, Poll, PollMedia, PortfolioItem, Profile, ProfileVerification, ProfileView, Question,
SearchHistory, Sponsor, Tip, TipPayout, TokenApproval, TribeMember, TribesSubscription, UserAction,
Activity, Answer, BlockedURLFilter, BlockedUser, Bounty, BountyEvent,
BountyFulfillment, BountyInvites, BountySyncRequest, CoinRedemption,
CoinRedemptionRequest, Coupon, Earning, FeedbackEntry, FundRequest,
HackathonEvent, HackathonProject, HackathonRegistration, HackathonSponsor,
HackathonWorkshop, Interest, Investigation, LabsResearch, ObjectView,
Option, Poll, PollMedia, PortfolioItem, Profile, ProfileVerification,
ProfileView, Question, SearchHistory, Sponsor, Tip, TipPayout,
TokenApproval, TribeMember, TribesSubscription, UserAction,
UserVerificationModel,
)

Expand Down Expand Up @@ -367,6 +370,13 @@ class HackathonSponsorAdmin(admin.ModelAdmin):
list_display = ['pk', 'hackathon', 'sponsor', 'sponsor_type']


class HackathonWorkshopAdmin(admin.ModelAdmin):
"""The admin object for the HackathonWorkshop model."""

raw_id_fields = ['speaker']
list_display = ['pk', 'start_date', 'hackathon', 'speaker', 'url']
walidmujahid marked this conversation as resolved.
Show resolved Hide resolved


class SponsorAdmin(admin.ModelAdmin):
"""The admin object for the Sponsor model."""

Expand Down Expand Up @@ -589,6 +599,7 @@ class ProfileVerificationAdmin(admin.ModelAdmin):
admin.site.register(Sponsor, SponsorAdmin)
admin.site.register(HackathonEvent, HackathonEventAdmin)
admin.site.register(HackathonSponsor, HackathonSponsorAdmin)
admin.site.register(HackathonWorkshop, HackathonWorkshopAdmin)
admin.site.register(HackathonRegistration, HackathonRegistrationAdmin)
admin.site.register(HackathonProject, HackathonProjectAdmin)
admin.site.register(FeedbackEntry, FeedbackAdmin)
Expand Down
45 changes: 45 additions & 0 deletions app/dashboard/migrations/0135_auto_20200728_1656.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Generated by Django 2.2.4 on 2020-07-28 16:56

import datetime
from django.db import migrations, models
import django.db.models.deletion
from django.utils.timezone import utc
import economy.models


class Migration(migrations.Migration):

dependencies = [
('dashboard', '0134_auto_20200728_1114'),
]

operations = [
migrations.AddField(
model_name='hackathonevent',
name='hackathon_summary',
field=models.CharField(blank=True, help_text='280 char summary that shows up on hackathon cards on the hackathon list page', max_length=280),
),
migrations.AlterField(
model_name='tribessubscription',
name='expires_on',
field=models.DateTimeField(blank=True, default=datetime.datetime(2021, 7, 28, 16, 56, 46, 271248, tzinfo=utc), null=True),
),
migrations.CreateModel(
name='HackathonWorkshop',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('created_on', models.DateTimeField(db_index=True, default=economy.models.get_time)),
('modified_on', models.DateTimeField(default=economy.models.get_time)),
('name', models.CharField(max_length=255)),
('start_date', models.DateTimeField()),
('cover', models.ImageField(upload_to='')),
('url', models.URLField(help_text='Blog link, calendar link, or other.')),
('visible', models.BooleanField(default=True, help_text='Can this HackathonWorkshop be seen on /hackathons ?')),
('hackathon', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='workshop_event', to='dashboard.HackathonEvent')),
('speaker', models.ForeignKey(help_text='Main speaker profile.', on_delete=django.db.models.deletion.CASCADE, related_name='workshop_speaker', to='dashboard.Profile')),
],
options={
'abstract': False,
},
),
]
24 changes: 24 additions & 0 deletions app/dashboard/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -4702,10 +4702,12 @@ class HackathonEvent(SuperModel):
sponsors = models.ManyToManyField(Sponsor, through='HackathonSponsor')
sponsor_profiles = models.ManyToManyField('dashboard.Profile', blank=True, limit_choices_to={'data__type': 'Organization'})
show_results = models.BooleanField(help_text=_('Hide/Show the links to access hackathon results'), default=True)
hackathon_summary = models.CharField(max_length=280, blank=True, help_text=_('280 char summary that shows up on hackathon cards on the hackathon list page'))
description = models.TextField(default='', blank=True, help_text=_('HTML rich description.'))
quest_link = models.CharField(max_length=255, blank=True)
chat_channel_id = models.CharField(max_length=255, blank=True, null=True)
visible = models.BooleanField(help_text=_('Can this HackathonEvent be seeing on /hackathons ?'), default=True)

default_channels = ArrayField(models.CharField(max_length=255), blank=True, default=list)
objects = HackathonEventQuerySet.as_manager()
display_showcase = models.BooleanField(default=False)
Expand Down Expand Up @@ -4791,6 +4793,7 @@ def save(self, *args, **kwargs):
self.slug = slugify(self.name)
super().save(*args, **kwargs)


# method for updating
@receiver(pre_save, sender=HackathonEvent, dispatch_uid="psave_hackathonevent")
def psave_hackathonevent(sender, instance, **kwargs):
Expand All @@ -4812,6 +4815,7 @@ def psave_hackathonevent(sender, instance, **kwargs):
)
walidmujahid marked this conversation as resolved.
Show resolved Hide resolved



class HackathonSponsor(SuperModel):
SPONSOR_TYPES = [
('G', 'Gold'),
Expand Down Expand Up @@ -5429,3 +5433,23 @@ class ProfileVerification(SuperModel):

def __str__(self):
return f'{self.phone_number} ({self.caller_type}) from {self.country_code} request ${self.delivery_method} code at {self.created_on}'


class HackathonWorkshop(SuperModel):
name = models.CharField(max_length=255)
start_date = models.DateTimeField()
cover = models.ImageField()
hackathon = models.ForeignKey(
'dashboard.HackathonEvent',
related_name='workshop_event',
on_delete=models.CASCADE,
blank=True, null=True
)
speaker = models.ForeignKey(
'dashboard.Profile',
related_name='workshop_speaker',
on_delete=models.CASCADE,
help_text='Main speaker profile.'
)
url = models.URLField(help_text='Blog link, calendar link, or other.')
visible = models.BooleanField(help_text=_('Can this HackathonWorkshop be seen on /hackathons ?'), default=True)
Loading