Commit c019b4074abff7c5febe0852a9fab2d19e2ffc4f

Authored by Macartur Sousa
1 parent bd921519
Exists in master and in 1 other branch mezuro_spb

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
... ... @@ -76,11 +76,11 @@ modulejs.define(&#39;CreateInstitution&#39;, [&#39;jquery&#39;, &#39;NoosferoRoot&#39;, &#39;SelectElement&#39;]
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(&#39;CreateInstitution&#39;, [&#39;jquery&#39;, &#39;NoosferoRoot&#39;, &#39;SelectElement&#39;]
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(&#39;CreateInstitution&#39;, [&#39;jquery&#39;, &#39;NoosferoRoot&#39;, &#39;SelectElement&#39;]
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>";
... ...
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: 590px;
... ... @@ -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,8 @@
242 287 width: 392px;
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,
245 292 .action-profile_editor-edit #content .main-content #profile-data .modal #institutions_cnpj,
246 293 .modal #institutions_cnpj{
247 294 height: 16px;
... ... @@ -258,11 +305,13 @@
258 305 width: 220px;
259 306 }
260 307  
  308 +#noosfero_profile-content #content .main-content #profile-data .modal #community_state,
261 309 .action-profile_editor-edit #content .main-content #profile-data .modal #community_state,
262 310 .modal #community_state {
263 311 width: 90px;
264 312 }
265 313  
  314 +#noosfero_profile-content #content .main-content #profile-data .modal #community_city,
266 315 .action-profile_editor-edit #content .main-content #profile-data .modal #community_city,
267 316 .modal #community_city {
268 317 height: 16px;
... ... @@ -276,6 +325,33 @@
276 325 width: 111px;
277 326 }
278 327  
  328 +#noosfero_profile-content #content .main-content #profile-data .modal #community_city,
  329 +#noosfero_profile-content #content .main-content #profile-data .modal #institutions_acronym,
  330 +#noosfero_profile-content #content .main-content #profile-data .modal #community_name,
  331 +#noosfero_profile-content #content .main-content #profile-data .modal #institutions_cnpj,
  332 +#noosfero_profile-content #content .main-content #profile-data .modal #institutions_corporate_name {
  333 + height: 38px;
  334 +}
  335 +
  336 +#noosfero_profile-content #content .main-content #profile-data .modal #institutions_acronym {
  337 + width: 133px;
  338 +}
  339 +
  340 +#noosfero_profile-content #content .main-content #profile-data .modal #community_name {
  341 + width: 410px;
  342 +}
  343 +
  344 +#noosfero_profile-content #content .main-content #profile-data .modal #institutions_cnpj,
  345 +#noosfero_profile-content #content .main-content #profile-data .modal #institutions_corporate_name {
  346 + width: 553px;
  347 +}
  348 +
  349 +#noosfero_profile-content #content .main-content #profile-data .modal #community_city {
  350 + width: 225px;
  351 +}
  352 +
  353 +#noosfero_profile-content #content .main-content #profile-data .modal a.button.with-text.icon-add,
  354 +#noosfero_profile-content #content .main-content #profile-data .modal a.button.with-text.icon-cancel,
279 355 .action-profile_editor-edit #content .main-content #profile-data .modal a.button.with-text.icon-add,
280 356 .action-profile_editor-edit #content .main-content #profile-data .modal a.button.with-text.icon-cancel,
281 357 .modal a.button.with-text.icon-add,
... ... @@ -285,17 +361,20 @@
285 361 font-size: 12px !important;
286 362 }
287 363  
  364 +#noosfero_profile-content #content .main-content #profile-data .modal a.button.with-text.icon-add,
288 365 .action-profile_editor-edit #content .main-content #profile-data .modal a.button.with-text.icon-add,
289 366 .modal a.button.with-text.icon-add {
290 367 background-color: #3E67B1 !important;
291 368 color: #fff !important;
292 369 }
293 370  
  371 +#noosfero_profile-content #content .main-content #profile-data .modal .public-institutions-fields,
294 372 .action-profile_editor-edit #content .main-content #profile-data .modal .public-institutions-fields,
295 373 .modal .public-institutions-fields {
296 374 display: none;
297 375 }
298 376  
  377 +#noosfero_profile-content #content .main-content #profile-data .modal .modal-form-actions,
299 378 .action-profile_editor-edit #content .main-content #profile-data .modal .modal-form-actions,
300 379 .modal .modal-form-actions {
301 380 margin-top: 20px;
... ... @@ -325,3 +404,7 @@
325 404 color: #FFF !important;
326 405 text-transform: none !important;
327 406 }
  407 +
  408 +body .modal-backdrop.fade.in {
  409 + display: none;
  410 +}
... ...