Commit 86badacd43a72cbc69a0b42f951d084a880d016b
1 parent
1e1361d1
Fix create instutution form with colab profile
Signed-off-by: Álvaro Fernando <alvarofernandoms@gmail.com> Signed-off-by: Macartur Sousa <macartur.sc@gmail.com>
Showing
2 changed files
with
88 additions
and
4 deletions
Show diff stats
src/noosfero-spb/gov_user/public/views/create-institution.js
... | ... | @@ -76,11 +76,11 @@ modulejs.define('CreateInstitution', ['jquery', 'NoosferoRoot', 'SelectElement'] |
76 | 76 | add_selected_institution_to_list(institution_id, institution_name); |
77 | 77 | |
78 | 78 | $(".remove-institution").click(remove_institution); |
79 | - //$('#institution_dialog').dialog('close'); | |
80 | 79 | $('#institution_modal').modal('toggle'); |
81 | 80 | } |
82 | 81 | |
83 | 82 | |
83 | + | |
84 | 84 | function success_ajax_response(response) { |
85 | 85 | close_loading(); |
86 | 86 | |
... | ... | @@ -107,6 +107,7 @@ modulejs.define('CreateInstitution', ['jquery', 'NoosferoRoot', 'SelectElement'] |
107 | 107 | update_user_institutions_list(); |
108 | 108 | } else { |
109 | 109 | var errors = create_error_list(response); |
110 | + | |
110 | 111 | $("#create_institution_errors").switchClass("hide-field", "show-field").html("<h2>"+response.message+"</h2>"+errors); |
111 | 112 | |
112 | 113 | show_errors_in_each_field(response.errors); |
... | ... | @@ -117,8 +118,8 @@ modulejs.define('CreateInstitution', ['jquery', 'NoosferoRoot', 'SelectElement'] |
117 | 118 | var errors = "<ul>"; |
118 | 119 | var field_name; |
119 | 120 | |
120 | - for(var error in response.errors) { | |
121 | - errors += "<li>"+response.errors[error]+"</li>"; | |
121 | + for(var i =0;i<response.errors.length;i++) { | |
122 | + errors += "<li>"+response.errors[i]+"</li>"; | |
122 | 123 | } |
123 | 124 | |
124 | 125 | errors += "</ul>"; |
... | ... | @@ -169,7 +170,6 @@ modulejs.define('CreateInstitution', ['jquery', 'NoosferoRoot', 'SelectElement'] |
169 | 170 | $('#institution_modal').modal('toggle'); |
170 | 171 | } |
171 | 172 | |
172 | - | |
173 | 173 | function institution_already_exists(){ |
174 | 174 | if( this.value.length >= 3 ) { |
175 | 175 | $.get(AJAX_URL.institution_already_exists, {name:this.value}, function(response){ | ... | ... |
src/noosfero-spb/noosfero-spb-theme/css/modal.css
... | ... | @@ -19,15 +19,18 @@ |
19 | 19 | overflow-y: auto; |
20 | 20 | } |
21 | 21 | |
22 | +#noosfero_profile-content .fade, | |
2 |
|
|
22 | 23 | .fade { |
23 | 24 | opacity: 0; |
24 | 25 | transition: opacity 0.15s linear 0s; |
25 | 26 | } |
26 | 27 | |
28 | +#noosfero_profile-content .fade.in, | |
27 | 29 | .fade.in { |
28 | 30 | opacity: 1; |
29 | 31 | } |
30 | 32 | |
33 | +#noosfero_profile-content #content .main-content #profile-data .modal-dialog, | |
31 | 34 | .action-profile_editor-edit #content .main-content #profile-data .modal-dialog, |
32 | 35 | .modal-dialog { |
33 | 36 | width: 45%; |
... | ... | @@ -35,21 +38,25 @@ |
35 | 38 | position: relative; |
36 | 39 | } |
37 | 40 | |
41 | +#noosfero_profile-content #content .main-content #profile-data .modal.in .modal-dialog, | |
38 | 42 | .action-profile_editor-edit #content .main-content #profile-data .modal.in .modal-dialog, |
39 | 43 | .modal.in .modal-dialog { |
40 | 44 | transform: translate(0px, 0px); |
41 | 45 | } |
42 | 46 | |
47 | +#noosfero_profile-content #content .main-content #profile-data .modal.fade .modal-dialog, | |
43 | 48 | .action-profile_editor-edit #content .main-content #profile-data .modal.fade .modal-dialog, |
44 | 49 | .modal.fade .modal-dialog { |
45 | 50 | transition: transform 0.3s ease-out 0s; |
46 | 51 | } |
47 | 52 | |
53 | +#noosfero_profile-content #content .main-content #profile-data .modal-content, | |
48 | 54 | .action-profile_editor-edit #content .main-content #profile-data .modal-content, |
49 | 55 | .modal-content { |
50 | 56 | box-shadow: 0px 5px 15px rgba(0, 0, 0, 0.5); |
51 | 57 | } |
52 | 58 | |
59 | +#noosfero_profile-content .modal-content, | |
53 | 60 | .modal-content { |
54 | 61 | position: relative; |
55 | 62 | background-color: #FFF; |
... | ... | @@ -60,6 +67,7 @@ |
60 | 67 | box-shadow: 0px 3px 9px rgba(0, 0, 0, 0.5); |
61 | 68 | } |
62 | 69 | |
70 | +#noosfero_profile-content #content .main-content #profile-data .modal-header, | |
63 | 71 | .action-profile_editor-edit #content .main-content #profile-data .modal-header, |
64 | 72 | .modal-header { |
65 | 73 | min-height: 16.43px; |
... | ... | @@ -67,11 +75,13 @@ |
67 | 75 | border-bottom: 1px solid #E5E5E5; |
68 | 76 | } |
69 | 77 | |
78 | +#noosfero_profile-content #content .main-content #profile-data .modal-header .close, | |
70 | 79 | .action-profile_editor-edit #content .main-content #profile-data .modal-header .close, |
71 | 80 | .modal-header .close { |
72 | 81 | margin-top: -2px; |
73 | 82 | } |
74 | 83 | |
84 | +#noosfero_profile-content #content .main-content #profile-data .modal-header button.close, | |
75 | 85 | .action-profile_editor-edit #content .main-content #profile-data .modal-header button.close, |
76 | 86 | .modal-header button.close { |
77 | 87 | padding: 0px; |
... | ... | @@ -80,6 +90,7 @@ |
80 | 90 | border: 0px none; |
81 | 91 | } |
82 | 92 | |
93 | +#noosfero_profile-content #content .main-content #profile-data .modal-header .close, | |
83 | 94 | .action-profile_editor-edit #content .main-content #profile-data .modal-header .close, |
84 | 95 | .modal-header .close { |
85 | 96 | float: right; |
... | ... | @@ -96,12 +107,14 @@ |
96 | 107 | line-height: 1.42857 !important; |
97 | 108 | } |
98 | 109 | |
110 | +#noosfero_profile-content #content .main-content #profile-data .modal-body, | |
99 | 111 | .action-profile_editor-edit #content .main-content #profile-data .modal-body, |
100 | 112 | .modal-body { |
101 | 113 | position: relative; |
102 | 114 | padding: 15px; |
103 | 115 | } |
104 | 116 | |
117 | +#noosfero_profile-content #content .main-content #profile-data .modal-footer, | |
105 | 118 | .action-profile_editor-edit #content .main-content #profile-data .modal-footer, |
106 | 119 | .modal-footer { |
107 | 120 | padding: 15px; |
... | ... | @@ -111,23 +124,31 @@ |
111 | 124 | |
112 | 125 | |
113 | 126 | /* Bootstrap modal override */ |
127 | +#noosfero_profile-content #content .main-content #profile-data .modal-title, | |
114 | 128 | .action-profile_editor-edit #content .main-content #profile-data .modal-title, |
115 | 129 | .modal-title { |
116 | 130 | font-family: 'open_sansregular', Arial, Helvetica, sans-serif; |
117 | 131 | } |
118 | 132 | |
133 | +#noosfero_profile-content #content .main-header h4, | |
119 | 134 | .action-profile_editor-edit #content .main-header h4, |
120 | 135 | .modal-header h4 { |
121 | 136 | color: #333 !important; |
122 | 137 | font-size: 17px !important; |
123 | 138 | } |
124 | 139 | |
140 | +#noosfero_profile-content #content .main-content #profile-data .modal-body, | |
125 | 141 | .action-profile_editor-edit #content .main-content #profile-data .modal-body, |
126 | 142 | .modal-body { |
127 | 143 | overflow: hidden; |
128 | 144 | } |
129 | 145 | |
130 | 146 | /* Bootstrap modal form fields */ |
147 | +#noosfero_profile-content #content .main-content #profile-data .modal, | |
148 | +#noosfero_profile-content #content .main-content #profile-data .modal input, | |
149 | +#noosfero_profile-content #content .main-content #profile-data .modal select, | |
150 | +#noosfero_profile-content #content .main-content #profile-data .modal .formlabel, | |
151 | +#noosfero_profile-content #content .main-content #profile-data .modal .button.with-text, | |
131 | 152 | .action-profile_editor-edit #content .main-content #profile-data .modal, |
132 | 153 | .action-profile_editor-edit #content .main-content #profile-data .modal input, |
133 | 154 | .action-profile_editor-edit #content .main-content #profile-data .modal select, |
... | ... | @@ -142,21 +163,33 @@ |
142 | 163 | font-style: normal; |
143 | 164 | } |
144 | 165 | |
166 | +#noosfero_profile-content #content .main-content #profile-data .modal .button.with-text.icon-cancel { | |
167 | + color: #3E67B1; | |
168 | +} | |
169 | + | |
170 | +#noosfero_profile-content #content .main-content #profile-data .modal .button.with-text.icon-cancel:hover { | |
171 | + color: #fff; | |
172 | +} | |
173 | + | |
174 | +#noosfero_profile-content #content .main-content #profile-data .modal label, | |
145 | 175 | .action-profile_editor-edit #content .main-content #profile-data .modal label, |
146 | 176 | .modal label { |
147 | 177 | margin-left: 4px; |
148 | 178 | } |
149 | 179 | |
180 | +#noosfero_profile-content #content .main-content #profile-data .modal .sisp-fields label, | |
150 | 181 | .action-profile_editor-edit #content .main-content #profile-data .modal .sisp-fields label, |
151 | 182 | .modal .sisp-fields label { |
152 | 183 | margin-left: 0px; |
153 | 184 | } |
154 | 185 | |
186 | +#noosfero_profile-content #content .main-content #profile-data .modal h2, | |
155 | 187 | .action-profile_editor-edit #content .main-content #profile-data .modal h2, |
156 | 188 | .modal h2 { |
157 | 189 | margin-top: 0px !important; |
158 | 190 | } |
159 | 191 | |
192 | +#noosfero_profile-content #content .main-content #profile-data .modal .form-description, | |
160 | 193 | .action-profile_editor-edit #content .main-content #profile-data .modal .form-description, |
161 | 194 | .modal .form-description { |
162 | 195 | border-bottom: 1px solid #E5E5E5; |
... | ... | @@ -164,12 +197,15 @@ |
164 | 197 | overflow: hidden; |
165 | 198 | } |
166 | 199 | |
200 | +#noosfero_profile-content #content .main-content #profile-data .modal .formfieldline, | |
167 | 201 | .action-profile_editor-edit #content .main-content #profile-data .modal .formfieldline, |
168 | 202 | .modal .formfieldline { |
169 | 203 | padding: 0px; |
170 | 204 | margin: 0px; |
171 | 205 | } |
172 | 206 | |
207 | +#noosfero_profile-content #content .main-content #profile-data .modal input[type="text"], | |
208 | +#noosfero_profile-content #content .main-content #profile-data .modal select, | |
173 | 209 | .action-profile_editor-edit #content .main-content #profile-data .modal input[type="text"], |
174 | 210 | .action-profile_editor-edit #content .main-content #profile-data .modal select, |
175 | 211 | .modal input[type="text"], |
... | ... | @@ -180,12 +216,14 @@ |
180 | 216 | background-color: #fff; |
181 | 217 | } |
182 | 218 | |
219 | +#noosfero_profile-content #content .main-content form .modal input[type="radio"], | |
183 | 220 | .action-profile_editor-edit #content .main-content form .modal input[type="radio"], |
184 | 221 | .modal input[type="radio"] { |
185 | 222 | vertical-align: middle; |
186 | 223 | margin: 0; |
187 | 224 | } |
188 | 225 | |
226 | +#noosfero_profile-content #content .main-content #profile-data .modal .explanation, | |
189 | 227 | .action-profile_editor-edit #content .main-content #profile-data .modal .explanation, |
190 | 228 | .modal .explanation { |
191 | 229 | color: #3F60C6; |
... | ... | @@ -195,6 +233,8 @@ |
195 | 233 | letter-spacing: 0.1px; |
196 | 234 | } |
197 | 235 | |
236 | +#noosfero_profile-content #content .main-content #profile-data .modal .required-field, | |
237 | +#noosfero_profile-content #content .main-content #profile-data .modal .errorExplanation, | |
198 | 238 | .action-profile_editor-edit #content .main-content #profile-data .modal .required-field, |
199 | 239 | .action-profile_editor-edit #content .main-content #profile-data .modal .errorExplanation, |
200 | 240 | .modal .required-field, |
... | ... | @@ -204,6 +244,8 @@ |
204 | 244 | margin-bottom: 20px; |
205 | 245 | } |
206 | 246 | |
247 | +#noosfero_profile-content #content .main-content #profile-data .modal .required-field, | |
248 | +#noosfero_profile-content #content .main-content #profile-data .modal .errorExplanation:empty, | |
207 | 249 | .action-profile_editor-edit #content .main-content #profile-data .modal .required-field, |
208 | 250 | .action-profile_editor-edit #content .main-content #profile-data .modal .errorExplanation:empty, |
209 | 251 | .modal .required-field, |
... | ... | @@ -211,22 +253,26 @@ |
211 | 253 | margin-bottom: 0px; |
212 | 254 | } |
213 | 255 | |
256 | +#noosfero_profile-content #content .main-content #profile-data .modal .spb-row, | |
214 | 257 | .action-profile_editor-edit #content .main-content #profile-data .modal .spb-row, |
215 | 258 | .modal .spb-row { |
216 | 259 | margin-top: 15px; |
217 | 260 | letter-spacing: 0.1px; |
218 | 261 | } |
219 | 262 | |
263 | +#noosfero_profile-content #content .main-content #profile-data .no-margin-top, | |
220 | 264 | .action-profile_editor-edit #content .main-content #profile-data .no-margin-top, |
221 | 265 | .no-margin-top { |
222 | 266 | margin-top: 0px !important; |
223 | 267 | } |
224 | 268 | |
269 | +#noosfero_profile-content #content .main-content #profile-data .modal .modal-margin-right, | |
225 | 270 | .action-profile_editor-edit #content .main-content #profile-data .modal .modal-margin-right, |
226 | 271 | .modal .modal-margin-right { |
227 | 272 | margin-right: 4%; |
228 | 273 | } |
229 | 274 | |
275 | +#noosfero_profile-content #content .main-content #profile-data .modal .modal-margin-left, | |
230 | 276 | .action-profile_editor-edit #content .main-content #profile-data .modal .modal-margin-left, |
231 | 277 | .modal .modal-margin-left { |
232 | 278 | margin-left: 4%; |
... | ... | @@ -238,6 +284,8 @@ |
238 | 284 | width: 392px; |
239 | 285 | } |
240 | 286 | |
287 | +#noosfero_profile-content #content .main-content #profile-data .modal #institutions_cnpj, | |
288 | +#noosfero_profile-content #content .main-content #profile-data .modal #institutions_corporate_name, | |
241 | 289 | .action-profile_editor-edit #content .main-content #profile-data .modal #institutions_cnpj, |
242 | 290 | .action-profile_editor-edit #content .main-content #profile-data .modal #institutions_corporate_name, |
243 | 291 | .modal #institutions_cnpj, |
... | ... | @@ -251,11 +299,13 @@ |
251 | 299 | width: 220px; |
252 | 300 | } |
253 | 301 | |
302 | +#noosfero_profile-content #content .main-content #profile-data .modal #community_state, | |
254 | 303 | .action-profile_editor-edit #content .main-content #profile-data .modal #community_state, |
255 | 304 | .modal #community_state { |
256 | 305 | width: 80px; |
257 | 306 | } |
258 | 307 | |
308 | +#noosfero_profile-content #content .main-content #profile-data .modal #community_city, | |
259 | 309 | .action-profile_editor-edit #content .main-content #profile-data .modal #community_city, |
260 | 310 | .modal #community_city { |
261 | 311 | height: 16px; |
... | ... | @@ -269,6 +319,33 @@ |
269 | 319 | width: 111px; |
270 | 320 | } |
271 | 321 | |
322 | +#noosfero_profile-content #content .main-content #profile-data .modal #community_city, | |
323 | +#noosfero_profile-content #content .main-content #profile-data .modal #institutions_acronym, | |
324 | +#noosfero_profile-content #content .main-content #profile-data .modal #community_name, | |
325 | +#noosfero_profile-content #content .main-content #profile-data .modal #institutions_cnpj, | |
326 | +#noosfero_profile-content #content .main-content #profile-data .modal #institutions_corporate_name { | |
327 | + height: 38px; | |
328 | +} | |
329 | + | |
330 | +#noosfero_profile-content #content .main-content #profile-data .modal #institutions_acronym { | |
331 | + width: 133px; | |
332 | +} | |
333 | + | |
334 | +#noosfero_profile-content #content .main-content #profile-data .modal #community_name { | |
335 | + width: 410px; | |
336 | +} | |
337 | + | |
338 | +#noosfero_profile-content #content .main-content #profile-data .modal #institutions_cnpj, | |
339 | +#noosfero_profile-content #content .main-content #profile-data .modal #institutions_corporate_name { | |
340 | + width: 553px; | |
341 | +} | |
342 | + | |
343 | +#noosfero_profile-content #content .main-content #profile-data .modal #community_city { | |
344 | + width: 225px; | |
345 | +} | |
346 | + | |
347 | +#noosfero_profile-content #content .main-content #profile-data .modal a.button.with-text.icon-add, | |
348 | +#noosfero_profile-content #content .main-content #profile-data .modal a.button.with-text.icon-cancel, | |
272 | 349 | .action-profile_editor-edit #content .main-content #profile-data .modal a.button.with-text.icon-add, |
273 | 350 | .action-profile_editor-edit #content .main-content #profile-data .modal a.button.with-text.icon-cancel, |
274 | 351 | .modal a.button.with-text.icon-add, |
... | ... | @@ -278,17 +355,20 @@ |
278 | 355 | font-size: 12px !important; |
279 | 356 | } |
280 | 357 | |
358 | +#noosfero_profile-content #content .main-content #profile-data .modal a.button.with-text.icon-add, | |
281 | 359 | .action-profile_editor-edit #content .main-content #profile-data .modal a.button.with-text.icon-add, |
282 | 360 | .modal a.button.with-text.icon-add { |
283 | 361 | background-color: #3E67B1 !important; |
284 | 362 | color: #fff !important; |
285 | 363 | } |
286 | 364 | |
365 | +#noosfero_profile-content #content .main-content #profile-data .modal .public-institutions-fields, | |
287 | 366 | .action-profile_editor-edit #content .main-content #profile-data .modal .public-institutions-fields, |
288 | 367 | .modal .public-institutions-fields { |
289 | 368 | display: none; |
290 | 369 | } |
291 | 370 | |
371 | +#noosfero_profile-content #content .main-content #profile-data .modal .modal-form-actions, | |
292 | 372 | .action-profile_editor-edit #content .main-content #profile-data .modal .modal-form-actions, |
293 | 373 | .modal .modal-form-actions { |
294 | 374 | margin-top: 20px; |
... | ... | @@ -318,3 +398,7 @@ |
318 | 398 | color: #FFF !important; |
319 | 399 | text-transform: none !important; |
320 | 400 | } |
401 | + | |
402 | +body .modal-backdrop.fade.in { | |
403 | + display: none; | |
404 | +} | ... | ... |