@@ -55,14 +55,20 @@ <h1>Create Hackathon</h1>
5555 < div class ="col-12 mb-3 ">
5656 {{ form.score_categories|as_crispy_field }}
5757 </ div >
58- < div class ="col-12 col-md-6 mb-3 ">
58+ < div class ="col-12 col-md-12 mb-3 ">
5959 {{ form.is_public|as_crispy_field }}
6060 </ div >
6161 < div class ="col-12 col-md-6 mb-3 ">
62+ {{ form.allow_external_registrations|as_crispy_field }}
63+ </ div >
64+ < div class ="col-6 col-md-6 mb-3 " id ="google-registration-form-wrapper " style ="display: none; " >
65+ {{ form.registration_form|as_crispy_field }}
66+ </ div >
67+ < div class ="col-12 col-md-12 mb-12 ">
6268 {{ form.max_participants|as_crispy_field }}
6369 </ div >
6470 < div class ="col-12 mb-5 ">
65- < input type ="submit " class ="btn-ci mr-2 ">
71+ < input type ="submit " class ="btn-ci mr-2 " value =" Submit " >
6672 < a href ="{% url 'hackathon:hackathon-list' %} " type ="button " class ="btn-ci button "> Cancel</ a >
6773 </ div >
6874 </ div >
@@ -77,4 +83,23 @@ <h1>Create Hackathon</h1>
7783 integrity ="sha256-FEqEelWI3WouFOo2VWP/uJfs1y8KJ++FLh2Lbqc8SJk= " crossorigin ="anonymous ">
7884 </ script >
7985 < script src ="{% static 'js/datetimepicker.js' %} "> </ script >
86+ < script >
87+ document . addEventListener ( 'DOMContentLoaded' , function ( ) {
88+ const isRegisterCheckbox = document . querySelector ( '#id_allow_external_registrations' ) ;
89+ const googleRegistrationFormWrapper = document . querySelector ( '#google-registration-form-wrapper' ) ;
90+
91+ function toggleGoogleRegistrationForm ( ) {
92+ if ( isRegisterCheckbox . checked ) {
93+ googleRegistrationFormWrapper . style . display = 'block' ;
94+ } else {
95+ googleRegistrationFormWrapper . style . display = 'none' ;
96+ }
97+ }
98+
99+ isRegisterCheckbox . addEventListener ( 'change' , toggleGoogleRegistrationForm ) ;
100+
101+ // Initial check
102+ toggleGoogleRegistrationForm ( ) ;
103+ } ) ;
104+ </ script >
80105{% endblock %}
0 commit comments