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

Add looking for a team option to projects form #6348

Merged
merged 10 commits into from
Apr 7, 2020
23 changes: 23 additions & 0 deletions app/dashboard/migrations/0096_auto_20200331_2325.py
Original file line number Diff line number Diff line change
@@ -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),
),
]
18 changes: 18 additions & 0 deletions app/dashboard/migrations/0096_hackathonevent_banner.py
Original file line number Diff line number Diff line change
@@ -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=''),
),
]
7 changes: 7 additions & 0 deletions app/dashboard/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -4666,6 +4667,12 @@ class HackathonProject(SuperModel):
choices=PROJECT_STATUS,
blank=True
)
message = models.CharField(
max_length=150,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering if this limit is too short, what do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think is ok for a short message, originally the tweets have a length of 140 characters and worked well. One example could be:

Hi! I'm python developer and I'm looking for a fronted partner to hack on the ETC bounty "Create A DIY Hardware Wallet Using Signatory"

150 character limit will help to synthesize messages, and having a character count helper will help a lot the user. What do you think @PixelantDesign?

blank=True,
default=''
)
looking_members = models.BooleanField(default=False)
chat_channel_id = models.CharField(max_length=255, blank=True, null=True)

class Meta:
Expand Down
10 changes: 10 additions & 0 deletions app/dashboard/templates/dashboard/hackathon/project_new.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,16 @@ <h2 class="h5 text-center font-weight-bold mb-4">Tell us about your project</h2>
Search Gitcoin usernames.
</small>
</div>
<div class="form-group">
<div class="form__checkbox d-inline-block">
<input name='looking-members' id='looking-members' type="checkbox" {% if project_selected.looking_members %}checked{% endif %}>
<label class="form__label" for="looking-members">Looking for team members</label>
</div>
<div>
<small for="looking-members-message">Enter short message, 150 characters</small>
<input type="text" class="form-control" maxlength="150" value="{{ project_selected.message }}" name="looking-members-message" id="looking-members-message" >
</div>
</div>
<div class="form-group">
<label for="work_url">Project Repo or PR</label>
<input type="url" class="form-control" name="work_url" id="work_url" value="{{project_selected.work_url}}" placeholder="https://github.com/gitcoinco/web" required>
Expand Down
6 changes: 5 additions & 1 deletion app/dashboard/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'])

Expand All @@ -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:
Expand Down