@@ -7,13 +7,15 @@ $(document).ready(function () {
7
7
var get_issue_assigned_form_op = $ ( '.get-issue-assigned-form-op' ) ;
8
8
var participated_in_gsoc_form_op = $ ( '.participated-in-gsoc-form-op' ) ;
9
9
var mentor_students_form_op = $ ( '.mentor-students-form-op' ) ;
10
+ var feedback_form_op = $ ( '.feedback-comment' ) ;
10
11
11
12
var community_google_form = $ ( '.community-google-form' ) ;
12
13
var newcomer_promotion_form = $ ( '.newcomer-promotion-form' ) ;
13
14
var calendar_event_form = $ ( '.calendar-event-form' ) ;
14
15
var get_issue_assigned_form = $ ( '.get-issue-assigned-form' ) ;
15
16
var participated_in_gsoc_form = $ ( '.participated-in-gsoc-form' ) ;
16
17
var mentor_students_form = $ ( '.mentor-students-form' ) ;
18
+ var feedback_form = $ ( '.feedback' ) ;
17
19
18
20
var is_user_authenticated = Cookies . get ( 'authenticated' ) ;
19
21
var authenticated_username = Cookies . get ( 'username' ) ;
@@ -28,6 +30,11 @@ $(document).ready(function () {
28
30
'?form_submitted=True&form_type=community'
29
31
) ;
30
32
33
+ $ ( '.feedback-form' ) . attr (
34
+ 'action' , window . location . pathname +
35
+ '?form_submitted=True&form_type=feedback'
36
+ ) ;
37
+
31
38
$ . getJSON ( "/static/contributors-data.json" , function ( data ) {
32
39
var contributor_data = data [ authenticated_username ] ;
33
40
var teams = contributor_data . teams ;
@@ -87,6 +94,24 @@ $(document).ready(function () {
87
94
display_form_or_error ( mentor_students_form ) ;
88
95
} ) ;
89
96
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
+
90
115
$ ( '.community-form :input' ) . focusin ( function ( ) {
91
116
if ( is_user_authenticated === undefined &&
92
117
authenticated_username === undefined ) {
0 commit comments