diff --git a/community/forms.py b/community/forms.py index c3e00d39..e75f05de 100644 --- a/community/forms.py +++ b/community/forms.py @@ -141,10 +141,54 @@ class OrganizationMentor(forms.Form): widget=forms.TextInput(attrs={'autocomplete': 'off'}) ) year = forms.ChoiceField( - choices=[(TODAY.year, TODAY.year),(TODAY.year + 1, TODAY.year + 1)], + choices=[(TODAY.year, TODAY.year), (TODAY.year + 1, TODAY.year + 1)], label='Mentoring Year', widget=forms.Select() ) program = forms.ChoiceField( choices=[('GSoC', 'Google Summer of Code'), ('GCI', 'Google Code-In')], label='Mentoring Program' ) + + +class GSOCStudent(forms.Form): + user = forms.CharField( + max_length=50, label='GitHub Username', + widget=forms.TextInput(attrs={'autocomplete': 'off'}) + ) + year = forms.IntegerField( + label='Participation year', + widget=forms.NumberInput(attrs={'autocomplete': 'off'}) + ) + project_topic = forms.CharField( + max_length=300, label='GSoC Project Topic', + help_text='Should be same as on GSoC Website!', + widget=forms.TextInput(attrs={'autocomplete': 'off'}) + ) + project_desc = forms.CharField( + max_length=2000, label='Project Description', + widget=forms.Textarea(attrs={'autocomplete': 'off'}) + ) + accepted_proposal = forms.URLField( + label='Accepted Proposal URL', + help_text='The proposal you submitted during GSoC Program!', + widget=forms.URLInput(attrs={'autocomplete': 'off'}) + ) + cEP = forms.URLField( + label='Org Enhancement Proposal Merge Request', required=False, + help_text='For example, in {org} we have cEP({org} Enhancement ' + 'Proposal)'.format(org='coala'), # Ignore KeywordBear + widget=forms.URLInput(attrs={'autocomplete': 'off'}) + ) + project_url = forms.URLField( + label='GSoC Project URL', + widget=forms.URLInput(attrs={'autocomplete': 'off'}) + ) + mentors = forms.CharField( + max_length=200, label='Project Mentors', + help_text='Separate name of mentor by comma(,)', + widget=forms.TextInput(attrs={'autocomplete': 'off'}) + ) + image = forms.URLField( + label='Personal Image URL', required=False, + widget=forms.URLInput(attrs={'autocomplete': 'off'}) + ) diff --git a/community/views.py b/community/views.py index b27318a8..2ab3b644 100644 --- a/community/views.py +++ b/community/views.py @@ -16,7 +16,8 @@ JoinCommunityForm, CommunityGoogleForm, CommunityEvent, - OrganizationMentor + OrganizationMentor, + GSOCStudent, ) from data.models import Team from gamification.models import Participant as GamificationParticipant @@ -47,6 +48,14 @@ def initialize_org_context_details(): return org_details +def get_gsoc_student_form_variables(context): + context['gsoc_student_form'] = GSOCStudent() + context['gsoc_student_form_name'] = os.environ.get( + 'GSOC_STUDENT_FORM_NAME', None + ) + return context + + def get_community_mentor_form_variables(context): context['organization_mentor_form'] = OrganizationMentor() context['organization_mentor_form_name'] = os.environ.get( @@ -75,6 +84,7 @@ def get_all_community_forms(context): context = get_community_google_form_variables(context) context = get_community_event_form_variables(context) context = get_community_mentor_form_variables(context) + context = get_gsoc_student_form_variables(context) return context diff --git a/templates/community_forms.html b/templates/community_forms.html index 9a18efab..5e6046b8 100644 --- a/templates/community_forms.html +++ b/templates/community_forms.html @@ -155,3 +155,57 @@