Merge lp:~openerp-dev/openerp-web/trunk-ui-to-boostrap-modal into lp:openerp-web
- trunk-ui-to-boostrap-modal
- Merge into trunk
Status: | Superseded |
---|---|
Proposed branch: | lp:~openerp-dev/openerp-web/trunk-ui-to-boostrap-modal |
Merge into: | lp:openerp-web |
Diff against target: |
841 lines (+277/-150) 9 files modified
addons/web/static/src/css/base.css (+59/-1) addons/web/static/src/css/base.sass (+52/-6) addons/web/static/src/js/chrome.js (+78/-62) addons/web/static/src/js/data_export.js (+1/-2) addons/web/static/src/js/view_form.js (+13/-18) addons/web/static/src/js/views.js (+5/-5) addons/web/static/src/xml/base.xml (+63/-49) addons/web_diagram/static/src/js/diagram.js (+1/-2) addons/web_view_editor/static/src/js/view_editor.js (+5/-5) |
To merge this branch: | bzr merge lp:~openerp-dev/openerp-web/trunk-ui-to-boostrap-modal |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
OpenERP R&D Web Team | Pending | ||
Review via email:
|
This proposal has been superseded by a proposal from 2013-12-23.
Commit message
Description of the change
- 3917. By Ishwar Malvi(OpenERP)
-
[REM]removed unused code.
- 3918. By Ishwar Malvi(OpenERP)
-
[IMP]improved code and alignment.
- 3919. By Ishwar Malvi(OpenERP)
-
[IMP]improved code for view editor.
- 3920. By Ishwar Malvi(OpenERP)
-
[IMP]improved right margin for debug mode modals.
- 3921. By Ishwar Malvi(OpenERP)
-
[IMP]improved css for modal pre tag.
- 3922. By Ishwar Malvi(OpenERP)
-
[FIX]fixed issue in calendar view on create event and also for warning modal.
- 3923. By Ishwar Malvi(OpenERP)
-
[IMP]improved code for error modal and removed ui-dialog css class.
- 3924. By Ishwar Malvi(OpenERP)
-
[IMP]improved code due to linked in integration modal advanced search.
- 3925. By Ishwar Malvi(OpenERP)
-
[IMP]improved code for configuration error in sale stock.
- 3926. By Ishwar Malvi(OpenERP)
-
[IMP]improved code.
- 3927. By Ishwar Malvi(OpenERP)
-
[IMP]improved code for modal destoy on esc key.
- 3928. By Ishwar Malvi(OpenERP)
-
[IMP]improved code to destroy modal.
- 3929. By Ishwar Malvi(OpenERP)
-
[IMP]improved code for modal resizable.
- 3930. By Ishwar Malvi(OpenERP)
-
[MERGE]with trunk.
- 3931. By Ishwar Malvi(OpenERP)
-
[MERGE]with trunk.
- 3932. By Ishwar Malvi(OpenERP)
-
[MERGE]with trunk.
- 3933. By Kunal Chavda
-
[MERGE]with latest and resolved conflicts.
Unmerged revisions
- 3933. By Kunal Chavda
-
[MERGE]with latest and resolved conflicts.
- 3932. By Ishwar Malvi(OpenERP)
-
[MERGE]with trunk.
- 3931. By Ishwar Malvi(OpenERP)
-
[MERGE]with trunk.
- 3930. By Ishwar Malvi(OpenERP)
-
[MERGE]with trunk.
- 3929. By Ishwar Malvi(OpenERP)
-
[IMP]improved code for modal resizable.
- 3928. By Ishwar Malvi(OpenERP)
-
[IMP]improved code to destroy modal.
- 3927. By Ishwar Malvi(OpenERP)
-
[IMP]improved code for modal destoy on esc key.
- 3926. By Ishwar Malvi(OpenERP)
-
[IMP]improved code.
- 3925. By Ishwar Malvi(OpenERP)
-
[IMP]improved code for configuration error in sale stock.
- 3924. By Ishwar Malvi(OpenERP)
-
[IMP]improved code due to linked in integration modal advanced search.
Preview Diff
1 | === modified file 'addons/web/static/src/css/base.css' |
2 | --- addons/web/static/src/css/base.css 2013-12-19 13:40:55 +0000 |
3 | +++ addons/web/static/src/css/base.css 2013-12-23 09:09:30 +0000 |
4 | @@ -1318,6 +1318,7 @@ |
5 | margin-left: 20px; |
6 | } |
7 | .openerp .oe_about { |
8 | + padding: 15px; |
9 | background-color: white; |
10 | background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAAGCAYAAADgzO9IAAAAKUlEQVQIHWO8e/fufwYsgAUkJigoiCIF5DMyoYggcUiXgNnBiGQKmAkARpcEQeriln4AAAAASUVORK5CYII=); |
11 | -moz-border-radius: 0 0 2px 2px; |
12 | @@ -1338,7 +1339,7 @@ |
13 | } |
14 | .openerp .oe_about .oe_bottom { |
15 | position: absolute; |
16 | - top: 50%; |
17 | + top: 59%; |
18 | left: 0; |
19 | right: 0; |
20 | bottom: 0; |
21 | @@ -2633,6 +2634,7 @@ |
22 | line-height: 14px; |
23 | float: right; |
24 | padding-left: 2px; |
25 | + color: #7c7bad; |
26 | } |
27 | .openerp .oe_form_field_many2one input { |
28 | padding-right: 13px; |
29 | @@ -3574,6 +3576,62 @@ |
30 | height: 18px; |
31 | } |
32 | |
33 | +.modal { |
34 | + overflow-y: auto; |
35 | + overflow-x: hidden; |
36 | +} |
37 | +.modal a { |
38 | + color: #7c7bad; |
39 | +} |
40 | +.modal .ui-icon-gripsmall-diagonal-se { |
41 | + background-position: -77px -220px; |
42 | +} |
43 | +.modal .in pre { |
44 | + margin: 15px; |
45 | +} |
46 | +.modal .modal-header { |
47 | + cursor: move; |
48 | + font-size: 18px; |
49 | + background-color: #ededed; |
50 | + background-image: -webkit-linear-gradient(top, #fcfcfc, #dedede); |
51 | + border-top-right-radius: 4px; |
52 | + border-top-left-radius: 4px; |
53 | + min-height: 54px; |
54 | +} |
55 | +.modal .modal-header button.close { |
56 | + border: none; |
57 | + background: none; |
58 | + padding: 1px; |
59 | + height: 18px; |
60 | + font-size: 20px; |
61 | +} |
62 | +.modal .modal-footer { |
63 | + text-align: left; |
64 | +} |
65 | +.modal .modal-body { |
66 | + position: initial; |
67 | + padding: 0; |
68 | +} |
69 | +.modal .modal-body dl.in, .modal .modal-body dd { |
70 | + margin-left: 20px; |
71 | +} |
72 | +.modal .modal-body dl.in dl dd, .modal .modal-body dd dl dd { |
73 | + margin-left: 60px; |
74 | +} |
75 | +.modal .modal-body dl.in dd dt, .modal .modal-body dd dd dt { |
76 | + margin-left: 15px; |
77 | +} |
78 | +.modal .modal-body dl.in dt, .modal .modal-body dd dt { |
79 | + font-weight: normal !important; |
80 | +} |
81 | +.modal .modal-content { |
82 | + min-height: 185px; |
83 | + min-width: 230px; |
84 | + border: none; |
85 | + border-radius: 3px; |
86 | + box-shadow: rgba(0, 0, 0, 0.298039) 0px 0px 0px 7px; |
87 | +} |
88 | + |
89 | input[type="radio"], input[type="checkbox"] { |
90 | margin-right: 4px; |
91 | margin-left: 4px; |
92 | |
93 | === modified file 'addons/web/static/src/css/base.sass' |
94 | --- addons/web/static/src/css/base.sass 2013-12-19 13:40:55 +0000 |
95 | +++ addons/web/static/src/css/base.sass 2013-12-23 09:09:30 +0000 |
96 | @@ -472,7 +472,7 @@ |
97 | .oe_grey |
98 | color: #aaa |
99 | // Added for generic error message and customize bootstrap3 <pre>,<hr> |
100 | - .oe_error_detail |
101 | + .oe_error_detail |
102 | hr |
103 | display: block |
104 | -webkit-margin-before: 0.5em |
105 | @@ -605,7 +605,7 @@ |
106 | //Customize label weight according bootstrap3 |
107 | > label:not([for]) |
108 | font-weight: normal !important |
109 | - // End of customize |
110 | + // End of customize |
111 | div.ui-tabs |
112 | padding: 3px 0px 3px 0px |
113 | .ui-tabs-hide |
114 | @@ -1083,6 +1083,7 @@ |
115 | // }}} |
116 | // About openerp {{{ |
117 | .oe_about |
118 | + padding: 15px // Customize according bootstrap3 modal |
119 | background-color: white |
120 | background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAAGCAYAAADgzO9IAAAAKUlEQVQIHWO8e/fufwYsgAUkJigoiCIF5DMyoYggcUiXgNnBiGQKmAkARpcEQeriln4AAAAASUVORK5CYII=) |
121 | @include radius(0 0 2px 2px) |
122 | @@ -1096,7 +1097,7 @@ |
123 | margin-left: -6px |
124 | .oe_bottom |
125 | position: absolute |
126 | - top: 50% |
127 | + top: 59% // Customize according bootstrap3 modal |
128 | left: 0 |
129 | right: 0 |
130 | bottom: 0 |
131 | @@ -1293,7 +1294,7 @@ |
132 | display: none |
133 | // }}} |
134 | // FormPopup {{{ |
135 | - .oe_popup_form |
136 | + .oe_popup_form |
137 | .oe_formview .oe_form_pager |
138 | display: none !important |
139 | // Customize label weight for popup wizard appear from another wizard according bootstrap3 |
140 | @@ -1327,7 +1328,7 @@ |
141 | input[type="checkbox"] |
142 | margin: 3px 3px 3px 4px |
143 | select |
144 | - margin: 2px 4px 2px 0 |
145 | + margin: 2px 4px 2px 0 |
146 | //End of customize |
147 | &.oe_focused |
148 | border-color: $tag-border-selected |
149 | @@ -2122,6 +2123,7 @@ |
150 | line-height: 14px |
151 | float: right |
152 | padding-left: 2px |
153 | + color: #7c7bad |
154 | input |
155 | padding-right: 13px |
156 | &.ui-autocomplete |
157 | @@ -2687,7 +2689,7 @@ |
158 | filter: alpha(opacity = 0) |
159 | border: none |
160 | width: 0 |
161 | - border-right: none |
162 | + border-right: none |
163 | > .label |
164 | border-bottom: 1px solid #cacaca |
165 | background: transparent |
166 | @@ -2851,6 +2853,50 @@ |
167 | height: 18px |
168 | // End hack}}} |
169 | |
170 | +// Customized modal according bootstrap3 |
171 | +.modal |
172 | + overflow-y: auto |
173 | + overflow-x: hidden |
174 | + a |
175 | + color: #7c7bad |
176 | + .ui-icon-gripsmall-diagonal-se |
177 | + background-position: -77px -220px |
178 | + .in pre |
179 | + margin: 15px |
180 | + .modal-header |
181 | + cursor: move |
182 | + font-size: 18px |
183 | + background-color: #ededed |
184 | + background-image: -webkit-linear-gradient(top, #fcfcfc, #dedede) |
185 | + border-top-right-radius: 4px |
186 | + border-top-left-radius: 4px |
187 | + min-height: 54px |
188 | + button.close |
189 | + border: none |
190 | + background: none |
191 | + padding: 1px |
192 | + height: 18px |
193 | + font-size: 20px |
194 | + .modal-footer |
195 | + text-align: left |
196 | + .modal-body |
197 | + position: initial |
198 | + padding: 0 |
199 | + dl.in, dd |
200 | + margin-left: 20px |
201 | + dl dd |
202 | + margin-left: 60px |
203 | + dd dt |
204 | + margin-left: 15px |
205 | + dt |
206 | + font-weight: normal !important |
207 | + .modal-content |
208 | + min-height: 185px |
209 | + min-width: 230px |
210 | + border: none |
211 | + border-radius: 3px |
212 | + box-shadow: rgba(0, 0, 0, 0.298039) 0px 0px 0px 7px |
213 | +// End fo customize |
214 | input[type="radio"], input[type="checkbox"] |
215 | margin-right: 4px |
216 | margin-left: 4px |
217 | |
218 | === modified file 'addons/web/static/src/js/chrome.js' |
219 | --- addons/web/static/src/js/chrome.js 2013-12-18 16:50:33 +0000 |
220 | +++ addons/web/static/src/js/chrome.js 2013-12-23 09:09:30 +0000 |
221 | @@ -60,10 +60,29 @@ |
222 | * The very minimal function everything should call to create a dialog |
223 | * in OpenERP Web Client. |
224 | */ |
225 | -instance.web.dialog = function(element) { |
226 | - var result = element.dialog.apply(element, _.rest(_.toArray(arguments))); |
227 | - result.dialog("widget").openerpClass(); |
228 | - return result; |
229 | +instance.web.dialog = function(element, options) { |
230 | + $dialog_box = $(QWeb.render('web.prompt', options)); |
231 | + element.modal({ |
232 | + 'backdrop': false, |
233 | + 'keyboard': true, |
234 | + }); |
235 | + element.appendTo($dialog_box.find(".modal-body")); |
236 | + var dialog_body = $dialog_box.find('.modal-content'); |
237 | + dialog_body.css(options.layout); |
238 | + dialog_body.openerpClass(); |
239 | + dialog_body.draggable({ handle: ".modal-header", containment: "window" }); |
240 | + $dialog_box.on('shown.bs.modal', function (e){ |
241 | + $('body').css({overflow: 'hidden'}); |
242 | + }) |
243 | + .on('hidden.bs.modal', function(e){ |
244 | + if($('.in .modal-content').length != 0){ |
245 | + $('body').css('overflow','hidden'); |
246 | + }else{ |
247 | + $('body').css('overflow','scroll'); |
248 | + } |
249 | + }); |
250 | + $dialog_box.modal('show'); |
251 | + return $dialog_box; |
252 | }; |
253 | |
254 | /** |
255 | @@ -94,29 +113,22 @@ |
256 | this._super(parent); |
257 | this.content_to_set = content; |
258 | this.dialog_options = { |
259 | - modal: true, |
260 | - destroy_on_close: true, |
261 | - width: 900, |
262 | - min_width: 0, |
263 | - max_width: '95%', |
264 | - height: 'auto', |
265 | - min_height: 0, |
266 | - max_height: $(window.top).height() - 200, |
267 | - autoOpen: false, |
268 | - position: [false, 40], |
269 | + layout: { |
270 | + 'width': 900, |
271 | + 'min_width': 0, |
272 | + 'max_width': '95%', |
273 | + 'height': 'auto', |
274 | + 'min_height': 0, |
275 | + 'max_height': $(window.top).height() - 200, |
276 | + 'right': 158 |
277 | + }, |
278 | + resizable: true, |
279 | buttons: null, |
280 | - beforeClose: function () { |
281 | - self.trigger("closing"); |
282 | - }, |
283 | - resizeStop: function() { |
284 | - self.trigger("resized"); |
285 | - }, |
286 | }; |
287 | if (options) { |
288 | - _.extend(this.dialog_options, options); |
289 | + $.extend(true, this.dialog_options, options); |
290 | } |
291 | - this.on("closing", this, this._closing); |
292 | - this.$buttons = $('<div class="ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"><span class="oe_dialog_custom_buttons"/></div>'); |
293 | + this.$buttons = $('<div class="modal-footer"><span class="oe_dialog_custom_buttons"/></div>'); |
294 | }, |
295 | _get_options: function() { |
296 | var self = this; |
297 | @@ -126,14 +138,14 @@ |
298 | height: $(window.top).height(), |
299 | }; |
300 | _.each(sizes, function(available_size, unit) { |
301 | - o[unit] = self._get_size(o[unit], available_size); |
302 | - o['min_' + unit] = self._get_size(o['min_' + unit] || 0, available_size); |
303 | - o['max_' + unit] = self._get_size(o['max_' + unit] || 0, available_size); |
304 | - if (o[unit] !== 'auto' && o['min_' + unit] && o[unit] < o['min_' + unit]) { |
305 | - o[unit] = o['min_' + unit]; |
306 | + o.layout[unit] = self._get_size(o.layout[unit], available_size); |
307 | + o.layout['min_' + unit] = self._get_size(o.layout['min_' + unit] || 0, available_size); |
308 | + o.layout['max_' + unit] = self._get_size(o.layout['max_' + unit] || 0, available_size); |
309 | + if (o.layout[unit] !== 'auto' && o.layout['min_' + unit] && o.layout[unit] < o.layout['min_' + unit]) { |
310 | + o.layout[unit] = o.layout['min_' + unit]; |
311 | } |
312 | - if (o[unit] !== 'auto' && o['max_' + unit] && o[unit] > o['max_' + unit]) { |
313 | - o[unit] = o['max_' + unit]; |
314 | + if (o.layout[unit] !== 'auto' && o.layout['max_' + unit] && o.layout[unit] > o.layout['max_' + unit]) { |
315 | + o.layout[unit] = o.layout['max_' + unit]; |
316 | } |
317 | }); |
318 | o.title = o.title || this.dialog_title; |
319 | @@ -165,8 +177,7 @@ |
320 | if (!this.dialog_inited) { |
321 | this.init_dialog(); |
322 | } |
323 | - this.$el.dialog('open'); |
324 | - this.$el.dialog("widget").append(this.$buttons); |
325 | + this.$buttons.insertAfter($dialog_box.find(".modal-body")); |
326 | return this; |
327 | }, |
328 | _add_buttons: function(buttons) { |
329 | @@ -198,9 +209,19 @@ |
330 | } |
331 | this.renderElement(); |
332 | instance.web.dialog(this.$el, options); |
333 | - if (options.height === 'auto' && options.max_height) { |
334 | - this.$el.css({ 'max-height': options.max_height, 'overflow-y': 'auto' }); |
335 | - } |
336 | + if (options.layout.height === 'auto' && options.layout.max_height) { |
337 | + this.$el.css({ 'max-height': options.layout.max_height, 'overflow-y': 'auto' }); |
338 | + } |
339 | + var dialog_body = $dialog_box.find('.modal-content'); |
340 | + if (options.resizable){ |
341 | + dialog_body.resizable({ handles: 'n, e, s, w, ne, se, sw, nw' }); |
342 | + } |
343 | + dialog_body.resize(function() { |
344 | + main_modal = dialog_body.parent(); |
345 | + modal_content = main_modal.find(".modal-content").height(); |
346 | + main_modal.find(".modal-body .in").height(modal_content - 150); |
347 | + main_modal.find(".modal-content").height(modal_content + main_modal.find(".modal-footer").height()); |
348 | + }); |
349 | this.dialog_inited = true; |
350 | var res = this.start(); |
351 | return res; |
352 | @@ -209,17 +230,8 @@ |
353 | Closes the popup, if destroy_on_close was passed to the constructor, it is also destroyed. |
354 | */ |
355 | close: function() { |
356 | - if (this.dialog_inited && this.$el.is(":data(dialog)")) { |
357 | - this.$el.dialog('close'); |
358 | - } |
359 | - }, |
360 | - _closing: function() { |
361 | - if (this.__tmp_dialog_destroying) |
362 | - return; |
363 | - if (this.dialog_options.destroy_on_close) { |
364 | - this.__tmp_dialog_closing = true; |
365 | - this.destroy(); |
366 | - this.__tmp_dialog_closing = undefined; |
367 | + if (this.dialog_inited && this.$el.is(":data(bs.modal)")) { |
368 | + this.$el.parents('.modal').modal('hide'); |
369 | } |
370 | }, |
371 | /** |
372 | @@ -235,8 +247,8 @@ |
373 | this.close(); |
374 | this.__tmp_dialog_destroying = undefined; |
375 | } |
376 | - if (this.dialog_inited && !this.isDestroyed() && this.$el.is(":data(dialog)")) { |
377 | - this.$el.dialog('destroy'); |
378 | + if (this.dialog_inited && !this.isDestroyed() && this.$el.is(":data(bs.modal)")) { |
379 | + this.$el.parents('.modal').modal('hide'); |
380 | } |
381 | this._super(); |
382 | } |
383 | @@ -277,7 +289,7 @@ |
384 | instance.web.dialog($('<div>' + QWeb.render('CrashManager.warning', {error: error}) + '</div>'), { |
385 | title: "OpenERP " + (_.str.capitalize(error.type) || "Warning"), |
386 | buttons: [ |
387 | - {text: _t("Ok"), click: function() { $(this).dialog("close"); }} |
388 | + {text: _t("Ok"), click: function() { this.$el.parents('.modal').modal('hide'); }} |
389 | ] |
390 | }); |
391 | }, |
392 | @@ -287,14 +299,17 @@ |
393 | } |
394 | var buttons = {}; |
395 | buttons[_t("Ok")] = function() { |
396 | - $(this).dialog("close"); |
397 | + this.parents('.modal').modal('hide'); |
398 | }; |
399 | var dialog = new instance.web.Dialog(this, { |
400 | title: "OpenERP " + _.str.capitalize(error.type), |
401 | - width: '80%', |
402 | - height: '50%', |
403 | - min_width: '800px', |
404 | - min_height: '600px', |
405 | + layout: { |
406 | + width: '80%', |
407 | + height: '50%', |
408 | + min_width: '800px', |
409 | + min_height: '600px', |
410 | + right: 110 |
411 | + }, |
412 | buttons: buttons |
413 | }).open(); |
414 | dialog.$el.html(QWeb.render('CrashManager.error', {session: instance.session, error: error})); |
415 | @@ -347,10 +362,10 @@ |
416 | instance.web.dialog($('<div>' + QWeb.render('CrashManager.warning', {error: error}) + '</div>'), { |
417 | title: "OpenERP " + (_.str.capitalize(error.type) || "Warning"), |
418 | buttons: [ |
419 | - {text: _t("Ok"), click: function() { $(this).dialog("close"); }}, |
420 | + {text: _t("Ok"), click: function() { this.$el.parents('.modal').modal('hide'); }}, |
421 | {text: error.data.arguments[2], click: function() { |
422 | window.location.href='#action='+error.data.arguments[1]; |
423 | - $(this).dialog("close"); |
424 | + this.$el.parents('.modal').modal('hide'); |
425 | }} |
426 | ] |
427 | }); |
428 | @@ -514,10 +529,9 @@ |
429 | */ |
430 | display_error: function (error) { |
431 | return instance.web.dialog($('<div>'), { |
432 | - modal: true, |
433 | title: error.title, |
434 | buttons: [ |
435 | - {text: _t("Ok"), click: function() { $(this).dialog("close"); }} |
436 | + {text: _t("Ok"), click: function() { this.$el.parents('.modal').modal('hide'); }} |
437 | ] |
438 | }).html(error.error); |
439 | }, |
440 | @@ -897,10 +911,9 @@ |
441 | }, |
442 | display_error: function (error) { |
443 | return instance.web.dialog($('<div>'), { |
444 | - modal: true, |
445 | title: error.title, |
446 | buttons: [ |
447 | - {text: _t("Ok"), click: function() { $(this).dialog("close"); }} |
448 | + {text: _t("Ok"), click: function() { this.$el.parents('.modal').modal('hide'); }} |
449 | ] |
450 | }).html(error.error); |
451 | }, |
452 | @@ -1217,8 +1230,11 @@ |
453 | e.preventDefault(); |
454 | window.location = $.param.querystring( window.location.href, 'debug'); |
455 | }); |
456 | - instance.web.dialog($help, {autoOpen: true, |
457 | - modal: true, width: 507, height: 290, resizable: false, title: _t("About")}); |
458 | + instance.web.dialog($help, { |
459 | + resizable: false, |
460 | + title: _t("About"), |
461 | + layout: { 'width': 507, 'height': 290, 'top': 175, 'left': 40 } |
462 | + }); |
463 | }); |
464 | }, |
465 | }); |
466 | |
467 | === modified file 'addons/web/static/src/js/data_export.js' |
468 | --- addons/web/static/src/js/data_export.js 2013-10-17 09:44:57 +0000 |
469 | +++ addons/web/static/src/js/data_export.js 2013-12-23 09:09:30 +0000 |
470 | @@ -46,7 +46,6 @@ |
471 | start: function() { |
472 | var self = this; |
473 | this._super.apply(this, arguments); |
474 | - self.$el.removeClass('ui-dialog-content ui-widget-content'); |
475 | |
476 | var got_fields = new $.Deferred(); |
477 | this.$el.find('#import_compat').change(function() { |
478 | @@ -414,7 +413,7 @@ |
479 | }); |
480 | }, |
481 | close: function() { |
482 | - this.$el.remove(); |
483 | + this.$el.parents('.modal').modal('hide'); |
484 | this._super(); |
485 | } |
486 | }); |
487 | |
488 | === modified file 'addons/web/static/src/js/view_form.js' |
489 | --- addons/web/static/src/js/view_form.js 2013-12-19 13:40:55 +0000 |
490 | +++ addons/web/static/src/js/view_form.js 2013-12-23 09:09:30 +0000 |
491 | @@ -588,9 +588,8 @@ |
492 | if (!_.isEmpty(result.warning)) { |
493 | instance.web.dialog($(QWeb.render("CrashManager.warning", result.warning)), { |
494 | title:result.warning.title, |
495 | - modal: true, |
496 | buttons: [ |
497 | - {text: _t("Ok"), click: function() { $(this).dialog("close"); }} |
498 | + {text: _t("Ok"), click: function() { this.$el.parents('.modal').modal('hide'); }} |
499 | ] |
500 | }); |
501 | } |
502 | @@ -1033,7 +1032,7 @@ |
503 | if (field instanceof instance.web.form.FieldSelection) { |
504 | return _(field.values).find(function (option) { |
505 | return option[0] === value; |
506 | - })[1]; |
507 | + }); |
508 | } else if (field instanceof instance.web.form.FieldMany2One) { |
509 | return field.get_displayed(); |
510 | } |
511 | @@ -1942,23 +1941,19 @@ |
512 | var def = $.Deferred(); |
513 | var dialog = instance.web.dialog($('<div/>').text(self.node.attrs.confirm), { |
514 | title: _t('Confirm'), |
515 | - modal: true, |
516 | buttons: [ |
517 | {text: _t("Cancel"), click: function() { |
518 | - $(this).dialog("close"); |
519 | + this.$el.parents('.modal').modal('hide'); |
520 | } |
521 | }, |
522 | {text: _t("Ok"), click: function() { |
523 | var self2 = this; |
524 | self.on_confirmed().always(function() { |
525 | - $(self2).dialog("close"); |
526 | + self2.$el.parents('.modal').modal('hide'); |
527 | }); |
528 | } |
529 | } |
530 | ], |
531 | - beforeClose: function() { |
532 | - def.resolve(); |
533 | - }, |
534 | }); |
535 | return def.promise(); |
536 | } else { |
537 | @@ -3167,7 +3162,9 @@ |
538 | init: function(parent) { |
539 | this._super(parent, { |
540 | title: _.str.sprintf(_t("Add %s"), parent.string), |
541 | - width: 312, |
542 | + layout: { |
543 | + 'width': 312 |
544 | + } |
545 | }); |
546 | }, |
547 | start: function() { |
548 | @@ -3235,7 +3232,7 @@ |
549 | delete this.$drop_down; |
550 | } |
551 | if (this.$input) { |
552 | - this.$input.closest(".ui-dialog .ui-dialog-content").off('scroll'); |
553 | + this.$input.closest(".modal .modal-content").off('scroll'); |
554 | this.$input.off('keyup blur autocompleteclose autocompleteopen ' + |
555 | 'focus focusout change keydown'); |
556 | delete this.$input; |
557 | @@ -3328,7 +3325,7 @@ |
558 | self.$input.autocomplete("close"); |
559 | } |
560 | }, 50); |
561 | - this.$input.closest(".ui-dialog .ui-dialog-content").on('scroll', this, close_autocomplete); |
562 | + this.$input.closest(".modal .modal-content").on('scroll', this, close_autocomplete); |
563 | |
564 | self.ed_def = $.Deferred(); |
565 | self.uned_def = $.Deferred(); |
566 | @@ -4824,7 +4821,7 @@ |
567 | var self = this; |
568 | this.renderElement(); |
569 | var dialog = new instance.web.Dialog(this, { |
570 | - min_width: '800px', |
571 | + layout: { 'min_width': 800 }, |
572 | dialogClass: 'oe_act_window', |
573 | close: function() { |
574 | self.check_exit(true); |
575 | @@ -4892,14 +4889,12 @@ |
576 | this.select_elements(this.created_elements); |
577 | this.created_elements = []; |
578 | } |
579 | - this.trigger('closed'); |
580 | this.destroy(); |
581 | }, |
582 | destroy: function () { |
583 | - this.trigger('closed'); |
584 | - if (this.$el.is(":data(dialog)")) { |
585 | - this.$el.dialog('close'); |
586 | - } |
587 | + if (this.$el.is(":data(bs.modal)")) { |
588 | + this.$el.parents('.modal').modal('hide'); |
589 | + } |
590 | this._super(); |
591 | }, |
592 | }); |
593 | |
594 | === modified file 'addons/web/static/src/js/views.js' |
595 | --- addons/web/static/src/js/views.js 2013-12-18 16:50:33 +0000 |
596 | +++ addons/web/static/src/js/views.js 2013-12-23 09:09:30 +0000 |
597 | @@ -411,7 +411,7 @@ |
598 | this.dialog = new instance.web.Dialog(this, { |
599 | dialogClass: executor.klass, |
600 | }); |
601 | - this.dialog.on("closing", null, options.on_close); |
602 | + this.dialog.$el.parents('.modal').on("hidden.bs.modal", options.on_close); |
603 | this.dialog.dialog_title = executor.action.name; |
604 | if (widget instanceof instance.web.ViewManager) { |
605 | _.extend(widget.flags, { |
606 | @@ -920,7 +920,7 @@ |
607 | current_view = this.views[this.active_view].controller; |
608 | switch (val) { |
609 | case 'fvg': |
610 | - var dialog = new instance.web.Dialog(this, { title: _t("Fields View Get"), width: '95%' }).open(); |
611 | + var dialog = new instance.web.Dialog(this, { title: _t("Fields View Get"), layout : { 'width': '95%', 'right': 190 } }).open(); |
612 | $('<pre>').text(instance.web.json_node_to_xml(current_view.fields_view.arch, true)).appendTo(dialog.$el); |
613 | break; |
614 | case 'tests': |
615 | @@ -937,7 +937,7 @@ |
616 | this.dataset.call('perm_read', [ids]).done(function(result) { |
617 | var dialog = new instance.web.Dialog(this, { |
618 | title: _.str.sprintf(_t("View Log (%s)"), self.dataset.model), |
619 | - width: 400 |
620 | + layout: { 'width': 400 , right: 0, left: 90 } |
621 | }, QWeb.render('ViewManagerDebugViewLog', { |
622 | perm : result[0], |
623 | format : instance.web.format_value |
624 | @@ -980,7 +980,7 @@ |
625 | new instance.web.Dialog(self, { |
626 | title: _.str.sprintf(_t("Model %s fields"), |
627 | self.dataset.model), |
628 | - width: '95%'}, $root).open(); |
629 | + layout: { 'width': '95%', 'right': 190 }}, $root).open(); |
630 | }); |
631 | break; |
632 | case 'edit_workflow': |
633 | @@ -1217,7 +1217,7 @@ |
634 | domain = $.Deferred().resolve(undefined); |
635 | } |
636 | if (ids.length === 0) { |
637 | - instance.web.dialog($("<div />").text(_t("You must choose at least one record.")), { title: _t("Warning"), modal: true }); |
638 | + instance.web.dialog($("<div />").text(_t("You must choose at least one record.")), { title: _t("Warning")}); |
639 | return false; |
640 | } |
641 | var active_ids_context = { |
642 | |
643 | === modified file 'addons/web/static/src/xml/base.xml' |
644 | --- addons/web/static/src/xml/base.xml 2013-12-02 13:19:43 +0000 |
645 | +++ addons/web/static/src/xml/base.xml 2013-12-23 09:09:30 +0000 |
646 | @@ -32,7 +32,20 @@ |
647 | <t t-esc="message"/> |
648 | </div> |
649 | </t> |
650 | - |
651 | +<t t-name="web.prompt"> |
652 | + <div class="modal" tabindex="-1" data-backdrop="static" role="dialog" aria-hidden="true"> |
653 | + <div class="modal-dialog"> |
654 | + <div class="modal-content"> |
655 | + <div class="modal-header"> |
656 | + <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> |
657 | + <h3 class="modal-title"><t t-esc="title"/></h3> |
658 | + </div> |
659 | + <div class="modal-body"> |
660 | + </div> |
661 | + </div> |
662 | + </div> |
663 | + </div> |
664 | +</t> |
665 | <t t-name="CrashManager.warning"> |
666 | <table cellspacing="0" cellpadding="0" border="0" class="oe_dialog_warning"> |
667 | <tr> |
668 | @@ -1730,54 +1743,55 @@ |
669 | <t t-name="ExportView"> |
670 | <a id="exportview" href="javascript: void(0)" style="text-decoration: none;color: #3D3D3D;">Export</a> |
671 | </t> |
672 | -<table t-name="ExportTreeView" class="oe_export" |
673 | - style="background-color: #F3F3F3;"> |
674 | - <tr> |
675 | - <td colspan="3"> |
676 | - This wizard will export all data that matches the current search criteria to a CSV file. |
677 | - You can export all data or only the fields that can be reimported after modification. |
678 | - </td> |
679 | - </tr> |
680 | - <tr> |
681 | - <td colspan="3"> |
682 | - <label for="import_compat">Export Type:</label> |
683 | - <select id="import_compat" name="import_compat"> |
684 | - <option value="yes">Import-Compatible Export</option> |
685 | - <option value="">Export all Data</option> |
686 | - </select> |
687 | - |
688 | - <label for="export_format">Export Formats</label> |
689 | - <select id="export_format" name="export_format"></select> |
690 | - </td> |
691 | - </tr> |
692 | - |
693 | - <tr> |
694 | - <th>Available fields</th> |
695 | - <th/> |
696 | - <th> |
697 | - Fields to export |
698 | - <a style="color: blue; text-decoration: none;" href="#" id="export_new_list">Save fields list</a> |
699 | - <div id="savenewlist"></div> |
700 | - <div id="ExistsExportList"></div> |
701 | - </th> |
702 | - </tr> |
703 | - <tr style="height: 400px;"> |
704 | - <td class="oe_export_fields_selector_left"> |
705 | - <div id="left_field_panel"> |
706 | - </div> |
707 | - </td> |
708 | - <td class="oe_export_fields_selector_center"> |
709 | - <!-- TODO: replace ids by 'oe_*' classes --> |
710 | - <button class="oe_button" id="add_field">Add</button> |
711 | - <button class="oe_button" id="remove_field">Remove</button> |
712 | - <button class="oe_button" id="remove_all_field">Remove All</button> |
713 | - </td> |
714 | - <td class="oe_export_fields_selector_right"> |
715 | - <select name="fields_list" id="fields_list" |
716 | - multiple="multiple"></select> |
717 | - </td> |
718 | - </tr> |
719 | -</table> |
720 | +<div t-name="ExportTreeView"> |
721 | + <table class="oe_export" style="background-color: #F3F3F3;"> |
722 | + <tr> |
723 | + <td colspan="3"> |
724 | + This wizard will export all data that matches the current search criteria to a CSV file. |
725 | + You can export all data or only the fields that can be reimported after modification. |
726 | + </td> |
727 | + </tr> |
728 | + <tr> |
729 | + <td colspan="3"> |
730 | + <label for="import_compat">Export Type:</label> |
731 | + <select id="import_compat" name="import_compat"> |
732 | + <option value="yes">Import-Compatible Export</option> |
733 | + <option value="">Export all Data</option> |
734 | + </select> |
735 | + |
736 | + <label for="export_format">Export Formats</label> |
737 | + <select id="export_format" name="export_format"></select> |
738 | + </td> |
739 | + </tr> |
740 | + |
741 | + <tr> |
742 | + <th>Available fields</th> |
743 | + <th/> |
744 | + <th> |
745 | + Fields to export |
746 | + <a style="color: blue; text-decoration: none;" href="#" id="export_new_list">Save fields list</a> |
747 | + <div id="savenewlist"></div> |
748 | + <div id="ExistsExportList"></div> |
749 | + </th> |
750 | + </tr> |
751 | + <tr style="height: 400px;"> |
752 | + <td class="oe_export_fields_selector_left"> |
753 | + <div id="left_field_panel"> |
754 | + </div> |
755 | + </td> |
756 | + <td class="oe_export_fields_selector_center"> |
757 | + <!-- TODO: replace ids by 'oe_*' classes --> |
758 | + <button class="oe_button" id="add_field">Add</button> |
759 | + <button class="oe_button" id="remove_field">Remove</button> |
760 | + <button class="oe_button" id="remove_all_field">Remove All</button> |
761 | + </td> |
762 | + <td class="oe_export_fields_selector_right"> |
763 | + <select name="fields_list" id="fields_list" |
764 | + multiple="multiple"></select> |
765 | + </td> |
766 | + </tr> |
767 | + </table> |
768 | +</div> |
769 | <t t-name="ExportTreeView-Domain"> |
770 | <t t-if="! record.ids_to_export"> |
771 | <p><strong>Please pay attention that all records matching your search filter will be exported. Not only the selected ids.</strong></p> |
772 | |
773 | === modified file 'addons/web_diagram/static/src/js/diagram.js' |
774 | --- addons/web_diagram/static/src/js/diagram.js 2012-12-13 14:09:14 +0000 |
775 | +++ addons/web_diagram/static/src/js/diagram.js 2013-12-23 09:09:30 +0000 |
776 | @@ -181,7 +181,6 @@ |
777 | var graph = new CuteGraph(r,style,canvas.parentNode); |
778 | |
779 | var confirm_dialog = $('#dialog').dialog({ |
780 | - autoOpen: false, |
781 | title: _t("Are you sure?") }); |
782 | |
783 | |
784 | @@ -344,7 +343,7 @@ |
785 | }); |
786 | // We want to destroy the dummy edge after a creation cancel. This destroys it even if we save the changes. |
787 | // This is not a problem since the diagram is completely redrawn on saved changes. |
788 | - pop.$el.bind("dialogbeforeclose",function(){ |
789 | + pop.$el.parents('.modal').on('hidden.bs.modal', function (e){ |
790 | if(dummy_cuteedge){ |
791 | dummy_cuteedge.remove(); |
792 | } |
793 | |
794 | === modified file 'addons/web_view_editor/static/src/js/view_editor.js' |
795 | --- addons/web_view_editor/static/src/js/view_editor.js 2013-04-05 08:52:24 +0000 |
796 | +++ addons/web_view_editor/static/src/js/view_editor.js 2013-12-23 09:09:30 +0000 |
797 | @@ -58,7 +58,7 @@ |
798 | }; |
799 | this.view_edit_dialog = new instance.web.Dialog(this, { |
800 | title: action_title, |
801 | - width: 850, |
802 | + layout:{ 'width': 850, 'right': 135 }, |
803 | buttons: [ |
804 | {text: _t("Create"), click: function() { self.on_create_view(); }}, |
805 | {text: _t("Edit"), click: function() { self.xml_element_id = 0; self.get_arch(); }}, |
806 | @@ -66,7 +66,7 @@ |
807 | {text: _t("Close"), click: function() { self.view_edit_dialog.close(); window.location.reload(); }} |
808 | ] |
809 | }).open(); |
810 | - this.view_edit_dialog.on("closing", this, function(){window.location.reload();}); |
811 | + this.view_edit_dialog.$el.parents('.modal').on("hidden.bs.modal", function(){window.location.reload();}); |
812 | this.main_view_id = this.parent.fields_view.view_id; |
813 | this.action_manager = new instance.web.ActionManager(this); |
814 | this.action_manager.appendTo(this.view_edit_dialog.$el); |
815 | @@ -378,7 +378,7 @@ |
816 | this.one_object = one_object; |
817 | this.edit_xml_dialog = new instance.web.Dialog(this, { |
818 | title: _.str.sprintf(_t("View Editor %d - %s"), self.main_view_id, self.model), |
819 | - height: '90%', |
820 | + layout: { 'max_height': '90%' }, |
821 | buttons: [ |
822 | {text: _t("Inherited View"), click: function(){ |
823 | var selected_row = self.edit_xml_dialog.$el.find('.ui-selected'); |
824 | @@ -831,7 +831,7 @@ |
825 | var self = this; |
826 | this.edit_node_dialog = new instance.web.Dialog(this,{ |
827 | title: _t("Properties"), |
828 | - width: 450, |
829 | + layout: { 'width': 450 }, |
830 | buttons: [ |
831 | {text: _t("Update"), click: function () { |
832 | var warn = false, update_values = []; |
833 | @@ -957,7 +957,7 @@ |
834 | this.add_widget = []; |
835 | this.add_node_dialog = new instance.web.Dialog(this,{ |
836 | title: _t("Properties"), |
837 | - width: 450, |
838 | + layout: { 'width': 450 }, |
839 | buttons: [ |
840 | {text: _t("Update"), click: function() { |
841 | var check_add_node = true, values = {}; |