@@ -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' ) ;
@@ -23,7 +25,7 @@ $(document).ready(function () {
2325 username_input . attr ( 'value' , authenticated_username || 'Anonymous User' ) ;
2426 username_input . attr ( 'disabled' , true ) ;
2527
26- $ ( 'form' ) . attr (
28+ $ ( '.community-form form' ) . attr (
2729 'action' , window . location . pathname +
2830 '?form_submitted=True&form_type=community'
2931 ) ;
@@ -87,6 +89,26 @@ $(document).ready(function () {
8789 display_form_or_error ( mentor_students_form ) ;
8890 } ) ;
8991
92+ feedback_form_op . on ( 'click' , function ( ) {
93+ var top_offset = feedback_form_op . offset ( ) . top ;
94+ feedback_form . css ( 'top' , ( top_offset - 440 ) . toString ( ) + 'px' ) ;
95+ feedback_form . css ( 'display' , 'block' ) ;
96+ $ ( '.user-feeling-level i' ) . on ( 'click' , function ( ) {
97+ var experience = $ ( this ) . attr ( 'experience' ) ;
98+ $ ( 'input[name="experience"]' ) . val ( experience ) ;
99+ $ ( '.user-feeling-level i' ) . css ( 'color' , 'black' ) ;
100+ if ( experience === 'Negative' ) {
101+ $ ( this ) . css ( 'color' , 'red' ) ;
102+ }
103+ else if ( experience === 'Neutral' ) {
104+ $ ( this ) . css ( 'color' , 'blue' ) ;
105+ }
106+ else {
107+ $ ( this ) . css ( 'color' , 'darkgreen' ) ;
108+ }
109+ } ) ;
110+ } ) ;
111+
90112 $ ( '.community-form :input' ) . focusin ( function ( ) {
91113 if ( is_user_authenticated === undefined &&
92114 authenticated_username === undefined ) {
0 commit comments