@@ -7,13 +7,15 @@ $(document).ready(function () {
77 var get_issue_assigned_form_op = $ ( '.get-issue-assigned-form-op' ) ;
88 var participated_in_gsoc_form_op = $ ( '.participated-in-gsoc-form-op' ) ;
99 var mentor_students_form_op = $ ( '.mentor-students-form-op' ) ;
10+ var feedback_form_op = $ ( '.feedback-comment' ) ;
1011
1112 var community_google_form = $ ( '.community-google-form' ) ;
1213 var newcomer_promotion_form = $ ( '.newcomer-promotion-form' ) ;
1314 var calendar_event_form = $ ( '.calendar-event-form' ) ;
1415 var get_issue_assigned_form = $ ( '.get-issue-assigned-form' ) ;
1516 var participated_in_gsoc_form = $ ( '.participated-in-gsoc-form' ) ;
1617 var mentor_students_form = $ ( '.mentor-students-form' ) ;
18+ var feedback_form = $ ( '.feedback' ) ;
1719
1820 var is_user_authenticated = Cookies . get ( 'authenticated' ) ;
1921 var authenticated_username = Cookies . get ( 'username' ) ;
@@ -28,6 +30,11 @@ $(document).ready(function () {
2830 '?form_submitted=True&form_type=community'
2931 ) ;
3032
33+ $ ( '.feedback-form' ) . attr (
34+ 'action' , window . location . pathname +
35+ '?form_submitted=True&form_type=feedback'
36+ ) ;
37+
3138 $ . getJSON ( "/static/contributors-data.json" , function ( data ) {
3239 var contributor_data = data [ authenticated_username ] ;
3340 var teams = contributor_data . teams ;
@@ -87,6 +94,24 @@ $(document).ready(function () {
8794 display_form_or_error ( mentor_students_form ) ;
8895 } ) ;
8996
97+ feedback_form_op . on ( 'click' , function ( ) {
98+ feedback_form . css ( 'display' , 'block' ) ;
99+ $ ( '.user-feeling-level i' ) . on ( 'click' , function ( ) {
100+ var experience = $ ( this ) . attr ( 'experience' ) ;
101+ $ ( 'input[name="experience"]' ) . val ( experience ) ;
102+ $ ( '.user-feeling-level i' ) . css ( 'color' , 'black' ) ;
103+ if ( experience === 'Negative' ) {
104+ $ ( this ) . css ( 'color' , 'red' ) ;
105+ }
106+ else if ( experience === 'Neutral' ) {
107+ $ ( this ) . css ( 'color' , 'blue' ) ;
108+ }
109+ else {
110+ $ ( this ) . css ( 'color' , 'darkgreen' ) ;
111+ }
112+ } ) ;
113+ } ) ;
114+
90115 $ ( '.community-form :input' ) . focusin ( function ( ) {
91116 if ( is_user_authenticated === undefined &&
92117 authenticated_username === undefined ) {
0 commit comments