Skip to content

Commit 6048e0e

Browse files
committed
community/: Add a form for adding a gsoc student
The contributors who've participated in GSoC in any year, with the organization can fill up this form. All the valid submissions, will be displayed on the projects website under a new tab, named 'Google Summer of Code` students. Closes #273
1 parent e94bc5c commit 6048e0e

File tree

3 files changed

+109
-1
lines changed

3 files changed

+109
-1
lines changed

community/forms.py

+44
Original file line numberDiff line numberDiff line change
@@ -148,3 +148,47 @@ class OrganizationMentor(forms.Form):
148148
choices=[('GSoC', 'Google Summer of Code'), ('GCI', 'Google Code-In')],
149149
label='Mentoring Program'
150150
)
151+
152+
153+
class GSOCStudent(forms.Form):
154+
user = forms.CharField(
155+
max_length=50, label='GitHub Username',
156+
widget=forms.TextInput(attrs={'autocomplete': 'off'})
157+
)
158+
year = forms.IntegerField(
159+
label='Participation year',
160+
widget=forms.NumberInput(attrs={'autocomplete': 'off'})
161+
)
162+
project_topic = forms.CharField(
163+
max_length=300, label='GSoC Project Topic',
164+
help_text='Should be same as on GSoC Website!',
165+
widget=forms.TextInput(attrs={'autocomplete': 'off'})
166+
)
167+
project_desc = forms.CharField(
168+
max_length=2000, label='Project Description',
169+
widget=forms.Textarea(attrs={'autocomplete': 'off'})
170+
)
171+
accepted_proposal = forms.URLField(
172+
label='Accepted Proposal URL',
173+
help_text='The proposal you submitted during GSoC Program!',
174+
widget=forms.URLInput(attrs={'autocomplete': 'off'})
175+
)
176+
cEP = forms.URLField(
177+
label='Org Enhancement Proposal Merge Request', required=False,
178+
help_text='For example, in {org} we have cEP({org} Enhancement '
179+
'Proposal)'.format(org='coala'), # Ignore KeywordBear
180+
widget=forms.URLInput(attrs={'autocomplete': 'off'})
181+
)
182+
project_url = forms.URLField(
183+
label='GSoC Project URL',
184+
widget=forms.URLInput(attrs={'autocomplete': 'off'})
185+
)
186+
mentors = forms.CharField(
187+
max_length=200, label='Project Mentors',
188+
help_text='Separate name of mentor by comma(,)',
189+
widget=forms.TextInput(attrs={'autocomplete': 'off'})
190+
)
191+
image = forms.URLField(
192+
label='Personal Image URL', required=False,
193+
widget=forms.URLInput(attrs={'autocomplete': 'off'})
194+
)

community/views.py

+11-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
JoinCommunityForm,
1717
CommunityGoogleForm,
1818
CommunityEvent,
19-
OrganizationMentor
19+
OrganizationMentor,
20+
GSOCStudent,
2021
)
2122
from data.models import Team
2223
from gamification.models import Participant as GamificationParticipant
@@ -47,6 +48,14 @@ def initialize_org_context_details():
4748
return org_details
4849

4950

51+
def get_gsoc_student_form_variables(context):
52+
context['gsoc_student_form'] = GSOCStudent()
53+
context['gsoc_student_form_name'] = os.environ.get(
54+
'GSOC_STUDENT_FORM_NAME', None
55+
)
56+
return context
57+
58+
5059
def get_community_mentor_form_variables(context):
5160
context['organization_mentor_form'] = OrganizationMentor()
5261
context['organization_mentor_form_name'] = os.environ.get(
@@ -75,6 +84,7 @@ def get_all_community_forms(context):
7584
context = get_community_google_form_variables(context)
7685
context = get_community_event_form_variables(context)
7786
context = get_community_mentor_form_variables(context)
87+
context = get_gsoc_student_form_variables(context)
7888
return context
7989

8090

templates/community_forms.html

+54
Original file line numberDiff line numberDiff line change
@@ -156,3 +156,57 @@ <h5 class="text-center custom-green-color-font bold-text">
156156
<input class="waves-effect waves-light btn-large large-font" type="submit" value="Submit">
157157
</div>
158158
</form>
159+
160+
<form name="{{ gsoc_student_form_name }}" method="post"
161+
netlify-honeypot="bot-field" class="participated-in-gsoc-form display-none"
162+
data-netlify="true" action="/">
163+
<h5 class="text-center custom-green-color-font bold-text">
164+
Google Summer of Code, Participation Student Details
165+
</h5>
166+
{% csrf_token %}
167+
{% for field in gsoc_student_form %}
168+
<div class="row">
169+
<div class="input-field col s12">
170+
{% if field.name == 'user' %}
171+
<p>{{ field.label_tag }}</p>
172+
{% else %}
173+
{{ field.label_tag }}
174+
{% endif %}
175+
{{ field }}
176+
{% if field.help_text %}
177+
<i class="fa fa-info-circle" aria-hidden="true">{{ field.help_text }}</i>
178+
{% endif %}
179+
</div>
180+
</div>
181+
{% endfor %}
182+
<div class="validation-checkboxes">
183+
<p>
184+
<label>
185+
<input type="checkbox" required>
186+
<span>I am a member of {{ org.name }} oragnization.</span>
187+
</label>
188+
</p>
189+
<p>
190+
<label>
191+
<input type="checkbox" required>
192+
<span>All of the above information provided by me has no false
193+
entries. If so, I am liable of getting blacklisted.</span>
194+
</label>
195+
</p>
196+
<p style="display: none">
197+
<label>
198+
<input type="checkbox" name="bot-field">
199+
<span>I am a bot</span>
200+
</label>
201+
</p>
202+
<p>
203+
<strong>
204+
Note: You will receive an email within 24 hrs, if any of the
205+
validation checks are not passed.
206+
</strong>
207+
</p>
208+
</div>
209+
<div class="apply-flex center-content submit-btn">
210+
<input class="waves-effect waves-light btn-large large-font" type="submit" value="Submit">
211+
</div>
212+
</form>

0 commit comments

Comments
 (0)