Commit f94197eb8ed79a627ac906ca127dab3bb9db0e32

Authored by Macartur Sousa
1 parent b8eaae51

Fix create instutution form with colab profile

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