Commit 3620f232554e03a5221122fbd02cbded39e83d36

Authored by Macartur Sousa
2 parents 2e124026 3ae94d4d
Exists in master and in 1 other branch mezuro_spb

Merge branch 'fixed_gov_user_modal' into 'master'

Fixed gov user modal

Fixed govuser_modal must be merged after siorg branch

See merge request !263
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(&#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>";
... ... @@ -164,12 +165,6 @@ modulejs.define(&#39;CreateInstitution&#39;, [&#39;jquery&#39;, &#39;NoosferoRoot&#39;, &#39;SelectElement&#39;]
164 165 });
165 166 }
166 167  
167   - function cancel_institution(evt){
168   - evt.preventDefault();
169   - $('#institution_modal').modal('toggle');
170   - }
171   -
172   -
173 168 function institution_already_exists(){
174 169 if( this.value.length >= 3 ) {
175 170 $.get(AJAX_URL.institution_already_exists, {name:this.value}, function(response){
... ... @@ -373,7 +368,6 @@ modulejs.define(&#39;CreateInstitution&#39;, [&#39;jquery&#39;, &#39;NoosferoRoot&#39;, &#39;SelectElement&#39;]
373 368 });
374 369  
375 370 $('#save_institution_button').click(save_institution);
376   - $('#cancel_institution_button').click(cancel_institution);
377 371  
378 372 $("#community_name").keyup(institution_already_exists);
379 373  
... ...
src/noosfero-spb/gov_user/views/gov_user_plugin/_institution.html.erb
... ... @@ -181,7 +181,7 @@
181 181 <%= button(:cancel, _("Cancel"), {:controller => "admin_panel", :action => 'index'}) %>
182 182 <% else %>
183 183 <%= link_to(_('Save'), '#', :id=>'save_institution_button', :class=>'button with-text icon-add') %>
184   - <%= link_to(_('Cancel'), '#', :id=>"cancel_institution_button", :class=>'button with-text icon-cancel') %>
  184 + <%= link_to(_('Cancel'), '#', :id=>"cancel_institution_button", :class=>'button with-text icon-cancel', "data-dismiss".to_sym => "modal") %>
185 185 <%= hidden_field_tag :institution_error_message, _("Could not send the form data to the server") %>
186 186 <% end %>
187 187 </div>
... ...
src/noosfero-spb/noosfero-spb-theme/css/modal.css
... ... @@ -19,15 +19,21 @@
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{
  34 + width: 605px;
  35 +}
  36 +
31 37 .action-profile_editor-edit #content .main-content #profile-data .modal-dialog,
32 38 .modal-dialog {
33 39 width: 590px;
... ... @@ -35,21 +41,28 @@
35 41 position: relative;
36 42 }
37 43  
  44 +#noosfero_profile-content #content .main-content #profile-data .modal-dialog {
  45 + position: static;
  46 +}
  47 +
38 48 .action-profile_editor-edit #content .main-content #profile-data .modal.in .modal-dialog,
39 49 .modal.in .modal-dialog {
40 50 transform: translate(0px, 0px);
41 51 }
42 52  
  53 +#noosfero_profile-content #content .main-content #profile-data .modal.fade .modal-dialog,
43 54 .action-profile_editor-edit #content .main-content #profile-data .modal.fade .modal-dialog,
44 55 .modal.fade .modal-dialog {
45 56 transition: transform 0.3s ease-out 0s;
46 57 }
47 58  
  59 +#noosfero_profile-content #content .main-content #profile-data .modal-content,
48 60 .action-profile_editor-edit #content .main-content #profile-data .modal-content,
49 61 .modal-content {
50 62 box-shadow: 0px 5px 15px rgba(0, 0, 0, 0.5);
51 63 }
52 64  
  65 +#noosfero_profile-content .modal-content,
53 66 .modal-content {
54 67 position: relative;
55 68 background-color: #FFF;
... ... @@ -60,6 +73,7 @@
60 73 box-shadow: 0px 3px 9px rgba(0, 0, 0, 0.5);
61 74 }
62 75  
  76 +#noosfero_profile-content #content .main-content #profile-data .modal-header,
63 77 .action-profile_editor-edit #content .main-content #profile-data .modal-header,
64 78 .modal-header {
65 79 min-height: 16.43px;
... ... @@ -67,11 +81,13 @@
67 81 border-bottom: 1px solid #E5E5E5;
68 82 }
69 83  
  84 +#noosfero_profile-content #content .main-content #profile-data .modal-header .close,
70 85 .action-profile_editor-edit #content .main-content #profile-data .modal-header .close,
71 86 .modal-header .close {
72 87 margin-top: -2px;
73 88 }
74 89  
  90 +#noosfero_profile-content #content .main-content #profile-data .modal-header button.close,
75 91 .action-profile_editor-edit #content .main-content #profile-data .modal-header button.close,
76 92 .modal-header button.close {
77 93 padding: 0px;
... ... @@ -80,6 +96,7 @@
80 96 border: 0px none;
81 97 }
82 98  
  99 +#noosfero_profile-content #content .main-content #profile-data .modal-header .close,
83 100 .action-profile_editor-edit #content .main-content #profile-data .modal-header .close,
84 101 .modal-header .close {
85 102 float: right;
... ... @@ -96,12 +113,14 @@
96 113 line-height: 1.42857 !important;
97 114 }
98 115  
  116 +#noosfero_profile-content #content .main-content #profile-data .modal-body,
99 117 .action-profile_editor-edit #content .main-content #profile-data .modal-body,
100 118 .modal-body {
101 119 position: relative;
102 120 padding: 15px;
103 121 }
104 122  
  123 +#noosfero_profile-content #content .main-content #profile-data .modal-footer,
105 124 .action-profile_editor-edit #content .main-content #profile-data .modal-footer,
106 125 .modal-footer {
107 126 padding: 15px;
... ... @@ -111,23 +130,31 @@
111 130  
112 131  
113 132 /* Bootstrap modal override */
  133 +#noosfero_profile-content #content .main-content #profile-data .modal-title,
114 134 .action-profile_editor-edit #content .main-content #profile-data .modal-title,
115 135 .modal-title {
116 136 font-family: 'open_sansregular', Arial, Helvetica, sans-serif;
117 137 }
118 138  
  139 +#noosfero_profile-content #content .main-header h4,
119 140 .action-profile_editor-edit #content .main-header h4,
120 141 .modal-header h4 {
121 142 color: #333 !important;
122 143 font-size: 17px !important;
123 144 }
124 145  
  146 +#noosfero_profile-content #content .main-content #profile-data .modal-body,
125 147 .action-profile_editor-edit #content .main-content #profile-data .modal-body,
126 148 .modal-body {
127 149 overflow: hidden;
128 150 }
129 151  
130 152 /* Bootstrap modal form fields */
  153 +#noosfero_profile-content #content .main-content #profile-data .modal,
  154 +#noosfero_profile-content #content .main-content #profile-data .modal input,
  155 +#noosfero_profile-content #content .main-content #profile-data .modal select,
  156 +#noosfero_profile-content #content .main-content #profile-data .modal .formlabel,
  157 +#noosfero_profile-content #content .main-content #profile-data .modal .button.with-text,
131 158 .action-profile_editor-edit #content .main-content #profile-data .modal,
132 159 .action-profile_editor-edit #content .main-content #profile-data .modal input,
133 160 .action-profile_editor-edit #content .main-content #profile-data .modal select,
... ... @@ -142,21 +169,33 @@
142 169 font-style: normal;
143 170 }
144 171  
  172 +#noosfero_profile-content #content .main-content #profile-data .modal .button.with-text.icon-cancel {
  173 + color: #3E67B1;
  174 +}
  175 +
  176 +#noosfero_profile-content #content .main-content #profile-data .modal .button.with-text.icon-cancel:hover {
  177 + color: #fff;
  178 +}
  179 +
  180 +#noosfero_profile-content #content .main-content #profile-data .modal label,
145 181 .action-profile_editor-edit #content .main-content #profile-data .modal label,
146 182 .modal label {
147 183 margin-left: 4px;
148 184 }
149 185  
  186 +#noosfero_profile-content #content .main-content #profile-data .modal .sisp-fields label,
150 187 .action-profile_editor-edit #content .main-content #profile-data .modal .sisp-fields label,
151 188 .modal .sisp-fields label {
152 189 margin-left: 0px;
153 190 }
154 191  
  192 +#noosfero_profile-content #content .main-content #profile-data .modal h2,
155 193 .action-profile_editor-edit #content .main-content #profile-data .modal h2,
156 194 .modal h2 {
157 195 margin-top: 0px !important;
158 196 }
159 197  
  198 +#noosfero_profile-content #content .main-content #profile-data .modal .form-description,
160 199 .action-profile_editor-edit #content .main-content #profile-data .modal .form-description,
161 200 .modal .form-description {
162 201 border-bottom: 1px solid #E5E5E5;
... ... @@ -164,12 +203,15 @@
164 203 overflow: hidden;
165 204 }
166 205  
  206 +#noosfero_profile-content #content .main-content #profile-data .modal .formfieldline,
167 207 .action-profile_editor-edit #content .main-content #profile-data .modal .formfieldline,
168 208 .modal .formfieldline {
169 209 padding: 0px;
170 210 margin: 0px;
171 211 }
172 212  
  213 +#noosfero_profile-content #content .main-content #profile-data .modal input[type="text"],
  214 +#noosfero_profile-content #content .main-content #profile-data .modal select,
173 215 .action-profile_editor-edit #content .main-content #profile-data .modal input[type="text"],
174 216 .action-profile_editor-edit #content .main-content #profile-data .modal select,
175 217 .modal input[type="text"],
... ... @@ -180,12 +222,14 @@
180 222 background-color: #fff;
181 223 }
182 224  
  225 +#noosfero_profile-content #content .main-content form .modal input[type="radio"],
183 226 .action-profile_editor-edit #content .main-content form .modal input[type="radio"],
184 227 .modal input[type="radio"] {
185 228 vertical-align: middle;
186 229 margin: 0;
187 230 }
188 231  
  232 +#noosfero_profile-content #content .main-content #profile-data .modal .explanation,
189 233 .action-profile_editor-edit #content .main-content #profile-data .modal .explanation,
190 234 .modal .explanation {
191 235 color: #3F60C6;
... ... @@ -195,6 +239,8 @@
195 239 letter-spacing: 0.1px;
196 240 }
197 241  
  242 +#noosfero_profile-content #content .main-content #profile-data .modal .required-field,
  243 +#noosfero_profile-content #content .main-content #profile-data .modal .errorExplanation,
198 244 .action-profile_editor-edit #content .main-content #profile-data .modal .required-field,
199 245 .action-profile_editor-edit #content .main-content #profile-data .modal .errorExplanation,
200 246 .modal .required-field,
... ... @@ -204,6 +250,8 @@
204 250 margin-bottom: 20px;
205 251 }
206 252  
  253 +#noosfero_profile-content #content .main-content #profile-data .modal .required-field,
  254 +#noosfero_profile-content #content .main-content #profile-data .modal .errorExplanation:empty,
207 255 .action-profile_editor-edit #content .main-content #profile-data .modal .required-field,
208 256 .action-profile_editor-edit #content .main-content #profile-data .modal .errorExplanation:empty,
209 257 .modal .required-field,
... ... @@ -211,22 +259,26 @@
211 259 margin-bottom: 0px;
212 260 }
213 261  
  262 +#noosfero_profile-content #content .main-content #profile-data .modal .spb-row,
214 263 .action-profile_editor-edit #content .main-content #profile-data .modal .spb-row,
215 264 .modal .spb-row {
216 265 margin-top: 15px;
217 266 letter-spacing: 0.1px;
218 267 }
219 268  
  269 +#noosfero_profile-content #content .main-content #profile-data .no-margin-top,
220 270 .action-profile_editor-edit #content .main-content #profile-data .no-margin-top,
221 271 .no-margin-top {
222 272 margin-top: 0px !important;
223 273 }
224 274  
  275 +#noosfero_profile-content #content .main-content #profile-data .modal .modal-margin-right,
225 276 .action-profile_editor-edit #content .main-content #profile-data .modal .modal-margin-right,
226 277 .modal .modal-margin-right {
227 278 margin-right: 4%;
228 279 }
229 280  
  281 +#noosfero_profile-content #content .main-content #profile-data .modal .modal-margin-left,
230 282 .action-profile_editor-edit #content .main-content #profile-data .modal .modal-margin-left,
231 283 .modal .modal-margin-left {
232 284 margin-left: 4%;
... ... @@ -238,6 +290,8 @@
238 290 width: 392px;
239 291 }
240 292  
  293 +#noosfero_profile-content #content .main-content #profile-data .modal #institutions_cnpj,
  294 +#noosfero_profile-content #content .main-content #profile-data .modal #institutions_corporate_name,
241 295 .action-profile_editor-edit #content .main-content #profile-data .modal #institutions_cnpj,
242 296 .modal #institutions_cnpj{
243 297 height: 16px;
... ... @@ -254,11 +308,13 @@
254 308 width: 220px;
255 309 }
256 310  
  311 +#noosfero_profile-content #content .main-content #profile-data .modal #community_state,
257 312 .action-profile_editor-edit #content .main-content #profile-data .modal #community_state,
258 313 .modal #community_state {
259 314 width: 90px;
260 315 }
261 316  
  317 +#noosfero_profile-content #content .main-content #profile-data .modal #community_city,
262 318 .action-profile_editor-edit #content .main-content #profile-data .modal #community_city,
263 319 .modal #community_city {
264 320 height: 16px;
... ... @@ -272,6 +328,33 @@
272 328 width: 111px;
273 329 }
274 330  
  331 +#noosfero_profile-content #content .main-content #profile-data .modal #community_city,
  332 +#noosfero_profile-content #content .main-content #profile-data .modal #institutions_acronym,
  333 +#noosfero_profile-content #content .main-content #profile-data .modal #community_name,
  334 +#noosfero_profile-content #content .main-content #profile-data .modal #institutions_cnpj,
  335 +#noosfero_profile-content #content .main-content #profile-data .modal #institutions_corporate_name {
  336 + height: 38px;
  337 +}
  338 +
  339 +#noosfero_profile-content #content .main-content #profile-data .modal #institutions_acronym {
  340 + width: 133px;
  341 +}
  342 +
  343 +#noosfero_profile-content #content .main-content #profile-data .modal #community_name {
  344 + width: 410px;
  345 +}
  346 +
  347 +#noosfero_profile-content #content .main-content #profile-data .modal #institutions_cnpj,
  348 +#noosfero_profile-content #content .main-content #profile-data .modal #institutions_corporate_name {
  349 + width: 553px;
  350 +}
  351 +
  352 +#noosfero_profile-content #content .main-content #profile-data .modal #community_city {
  353 + width: 225px;
  354 +}
  355 +
  356 +#noosfero_profile-content #content .main-content #profile-data .modal a.button.with-text.icon-add,
  357 +#noosfero_profile-content #content .main-content #profile-data .modal a.button.with-text.icon-cancel,
275 358 .action-profile_editor-edit #content .main-content #profile-data .modal a.button.with-text.icon-add,
276 359 .action-profile_editor-edit #content .main-content #profile-data .modal a.button.with-text.icon-cancel,
277 360 .modal a.button.with-text.icon-add,
... ... @@ -281,17 +364,20 @@
281 364 font-size: 12px !important;
282 365 }
283 366  
  367 +#noosfero_profile-content #content .main-content #profile-data .modal a.button.with-text.icon-add,
284 368 .action-profile_editor-edit #content .main-content #profile-data .modal a.button.with-text.icon-add,
285 369 .modal a.button.with-text.icon-add {
286 370 background-color: #3E67B1 !important;
287 371 color: #fff !important;
288 372 }
289 373  
  374 +#noosfero_profile-content #content .main-content #profile-data .modal .public-institutions-fields,
290 375 .action-profile_editor-edit #content .main-content #profile-data .modal .public-institutions-fields,
291 376 .modal .public-institutions-fields {
292 377 display: none;
293 378 }
294 379  
  380 +#noosfero_profile-content #content .main-content #profile-data .modal .modal-form-actions,
295 381 .action-profile_editor-edit #content .main-content #profile-data .modal .modal-form-actions,
296 382 .modal .modal-form-actions {
297 383 margin-top: 20px;
... ... @@ -321,3 +407,7 @@
321 407 color: #FFF !important;
322 408 text-transform: none !important;
323 409 }
  410 +
  411 +body .modal-backdrop.fade.in {
  412 + display: none;
  413 +}
... ...