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
28 changes: 28 additions & 0 deletions app/dashboard/migrations/0096_auto_20200401_2038.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Generated by Django 2.2.4 on 2020-04-01 20:38

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=''),
),
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),
),
]
7 changes: 7 additions & 0 deletions app/dashboard/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -4510,6 +4510,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 @@ -4668,6 +4669,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
13 changes: 1 addition & 12 deletions app/dashboard/templates/addinterest.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,6 @@ <h5 class="font-subheader">{% trans "Non-Disclosure Agreement" %}</h5>
<textarea id="issue_message" class="form__input"></textarea>
</div>
<div>
{% if bounty.event %}
<div class="d-flex">
<div class="filter-label ml-0 mb-3">
<label for="checkbox2 mb-0">
{% trans "Discord Username" %}
</label>
<input type="text" id="discord_username" name="discord_username" class="form__input font-body" placeholder="vivek#9746" value="{{gitcoin_discord_username}}" required/>
<span class="font-caption"><a target="_blank" href="https://chat.gitcoin.co/hackathons">Join Chat</a> to get updates from our sponsors prizes and find help</span>
</div>
</div>
{% endif %}
<div class="checkbox_container d-flex font-caption">
<input type="checkbox" id="checkbox2" class="form__input" value="1" required/>
<span class="checkbox"></span>
Expand Down Expand Up @@ -101,7 +90,7 @@ <h5 class="font-subheader">{% trans "Non-Disclosure Agreement" %}</h5>
</div>
</div>
</div>
<button id="submit" class="row button button--primary btn-interested" type="submit">{% trans "Submit" %}</button>
<button id="submit" class="row button button--primary btn-interested" type="submit">{% trans "Next" %}</button>
</form>
{% else %}
<div class="text-center mb-5 mt-4">
Expand Down
20 changes: 20 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 Expand Up @@ -112,6 +122,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" 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 @@ -3923,6 +3923,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 @@ -3943,7 +3945,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