Merge lp:~openerp-dev/openerp-web/trunk-ui-to-boostrap-modal into lp:openerp-web
- trunk-ui-to-boostrap-modal
- Merge into trunk
Status: | Merged |
---|---|
Merge reported by: | Cedric Snauwaert (OpenERP) |
Merged at revision: | not available |
Proposed branch: | lp:~openerp-dev/openerp-web/trunk-ui-to-boostrap-modal |
Merge into: | lp:openerp-web |
Diff against target: |
2038 lines (+474/-567) 10 files modified
addons/web/static/src/css/base.css (+75/-152) addons/web/static/src/css/base.sass (+68/-114) addons/web/static/src/js/chrome.js (+90/-68) addons/web/static/src/js/data_export.js (+1/-2) addons/web/static/src/js/view_form.js (+18/-22) addons/web/static/src/js/views.js (+5/-5) addons/web/static/src/xml/base.xml (+63/-49) addons/web_calendar/static/src/js/web_calendar.js (+148/-148) 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: mp+199936@code.launchpad.net |
This proposal supersedes a proposal from 2013-12-20.
Commit message
Description of the change
[REF] Replace jquery ui-dialog by bootstrap modal
- chrome.js: instance.web.dialog update to use modal
- form_view.js: update crash manager to use modal
- misc updates of modal dialogs
- removed ui-dialog CSS
- added modal CSS
- 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.
Cedric Snauwaert (OpenERP) (csn-openerp) wrote : | # |
Preview Diff
1 | === modified file 'addons/web/static/src/css/base.css' |
2 | --- addons/web/static/src/css/base.css 2014-01-31 00:52:02 +0000 |
3 | +++ addons/web/static/src/css/base.css 2014-02-03 18:22:10 +0000 |
4 | @@ -113,7 +113,7 @@ |
5 | font-weight: bold; |
6 | font-size: inherit; |
7 | } |
8 | -.openerp a.button:link, .openerp a.button:visited, .openerp button, .openerp .oe_button, .openerp input[type='submit'], .openerp .ui-dialog-buttonpane .ui-dialog-buttonset .ui-button { |
9 | +.openerp a.button:link, .openerp a.button:visited, .openerp button, .openerp .oe_button, .openerp input[type='submit'] { |
10 | display: inline-block; |
11 | border: 1px solid rgba(0, 0, 0, 0.4); |
12 | color: #4c4c4c; |
13 | @@ -138,7 +138,7 @@ |
14 | -webkit-font-smoothing: antialiased; |
15 | outline: none; |
16 | } |
17 | -.openerp a.button:hover, .openerp button:hover, .openerp .oe_button:hover, .openerp input[type='submit']:hover, .openerp .ui-dialog-buttonpane .ui-dialog-buttonset .ui-button.ui-state-hover { |
18 | +.openerp a.button:hover, .openerp button:hover, .openerp .oe_button:hover, .openerp input[type='submit']:hover { |
19 | background-color: #ececec; |
20 | background-image: -webkit-gradient(linear, left top, left bottom, from(#f6f6f6), to(#e3e3e3)); |
21 | background-image: -webkit-linear-gradient(top, #f6f6f6, #e3e3e3); |
22 | @@ -149,7 +149,7 @@ |
23 | cursor: pointer; |
24 | background-position: 0; |
25 | } |
26 | -.openerp a.button:focus, .openerp button:focus, .openerp .oe_button:focus, .openerp input[type='submit']:focus, .openerp .ui-dialog-buttonpane .ui-dialog-buttonset .ui-button.ui-state-focus { |
27 | +.openerp a.button:focus, .openerp button:focus, .openerp .oe_button:focus, .openerp input[type='submit']:focus { |
28 | border: 1px solid #80bfff; |
29 | background-position: 0; |
30 | background-color: #ececec; |
31 | @@ -163,7 +163,7 @@ |
32 | -webkit-box-shadow: 0 0 3px #80bfff, 0 1px 1px rgba(255, 255, 255, 0.8) inset; |
33 | box-shadow: 0 0 3px #80bfff, 0 1px 1px rgba(255, 255, 255, 0.8) inset; |
34 | } |
35 | -.openerp a.button:active, .openerp a.button.active, .openerp button:active, .openerp .oe_button:active, .openerp .oe_button.active, .openerp input[type='submit']:active, .openerp input[type='submit'].active, .openerp .ui-dialog-buttonpane .ui-dialog-buttonset .ui-button.ui-state-active { |
36 | +.openerp a.button:active, .openerp a.button.active, .openerp button:active, .openerp button.active, .openerp .oe_button:active, .openerp .oe_button.active, .openerp input[type='submit']:active, .openerp input[type='submit'].active { |
37 | background-color: #ececec; |
38 | background-image: -webkit-gradient(linear, left top, left bottom, from(#e3e3e3), to(#f6f6f6)); |
39 | background-image: -webkit-linear-gradient(top, #e3e3e3, #f6f6f6); |
40 | @@ -198,148 +198,6 @@ |
41 | .openerp .ui-tabs { |
42 | position: static; |
43 | } |
44 | -.openerp.ui-dialog { |
45 | - display: none; |
46 | - height: auto !important; |
47 | - padding: 6px; |
48 | - background-color: rgba(60, 60, 60, 0.7); |
49 | - border: 1px solid; |
50 | - border-color: #888888 #555555 #444444; |
51 | - -moz-border-radius: 8px; |
52 | - -webkit-border-radius: 8px; |
53 | - border-radius: 8px; |
54 | - -moz-box-shadow: 0 1px 12px rgba(0, 0, 0, 0.6); |
55 | - -webkit-box-shadow: 0 1px 12px rgba(0, 0, 0, 0.6); |
56 | - box-shadow: 0 1px 12px rgba(0, 0, 0, 0.6); |
57 | - -webkit-background-clip: padding-box; |
58 | - -moz-background-clip: padding-box; |
59 | - background-clip: padding-box; |
60 | -} |
61 | -.openerp.ui-dialog .ui-dialog-content { |
62 | - padding: 0; |
63 | -} |
64 | -.openerp.ui-dialog .ui-dialog-titlebar, .openerp.ui-dialog .ui-dialog-content, .openerp.ui-dialog .ui-dialog-buttonpane { |
65 | - padding: 16px; |
66 | -} |
67 | -.openerp.ui-dialog .ui-dialog-titlebar { |
68 | - border-top: none; |
69 | - border-left: none; |
70 | - border-right: none; |
71 | - border-bottom: 1px solid #cacaca; |
72 | - -moz-border-radius: 2px 2px 0 0; |
73 | - -webkit-border-radius: 2px 2px 0 0; |
74 | - border-radius: 2px 2px 0 0; |
75 | - background-color: #ededed; |
76 | - background-image: -webkit-gradient(linear, left top, left bottom, from(#fcfcfc), to(#dedede)); |
77 | - background-image: -webkit-linear-gradient(top, #fcfcfc, #dedede); |
78 | - background-image: -moz-linear-gradient(top, #fcfcfc, #dedede); |
79 | - background-image: -ms-linear-gradient(top, #fcfcfc, #dedede); |
80 | - background-image: -o-linear-gradient(top, #fcfcfc, #dedede); |
81 | - background-image: linear-gradient(to bottom, #fcfcfc, #dedede); |
82 | -} |
83 | -.openerp.ui-dialog .ui-dialog-titlebar .ui-dialog-title { |
84 | - margin: 0; |
85 | - padding: 0; |
86 | -} |
87 | -.openerp.ui-dialog .ui-dialog-content { |
88 | - background: white; |
89 | - width: auto !important; |
90 | -} |
91 | -.openerp.ui-dialog .ui-dialog-buttonpane { |
92 | - border-top: 1px solid #e0e0e0; |
93 | - background: #f5f7f9; |
94 | - margin: 0; |
95 | - -moz-border-radius: 0 0 2px 2px; |
96 | - -webkit-border-radius: 0 0 2px 2px; |
97 | - border-radius: 0 0 2px 2px; |
98 | -} |
99 | -.openerp.ui-dialog .ui-dialog-buttonpane button { |
100 | - margin: 0 4px 0 0; |
101 | -} |
102 | -.openerp.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { |
103 | - float: left; |
104 | -} |
105 | -.openerp.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset .ui-button { |
106 | - margin-right: 4px; |
107 | -} |
108 | -.openerp.ui-dialog .ui-dialog-titlebar-close { |
109 | - padding: 0; |
110 | -} |
111 | -.openerp.ui-dialog .ui-dialog-titlebar-close .ui-icon-closethick { |
112 | - display: none; |
113 | -} |
114 | -.openerp.ui-dialog .ui-dialog-titlebar-close:before { |
115 | - content: "×"; |
116 | - font-size: 18px; |
117 | - font-weight: bold; |
118 | - line-height: 16px; |
119 | - color: black; |
120 | - text-shadow: 0 1px 0 white; |
121 | - padding: 0; |
122 | - cursor: pointer; |
123 | - background: transparent; |
124 | - border: 0; |
125 | -} |
126 | -.openerp.ui-dialog .ui-dialog-titlebar-close:before:hover { |
127 | - color: black; |
128 | - text-decoration: none; |
129 | -} |
130 | -.openerp.ui-dialog .oe_about { |
131 | - background-color: white; |
132 | - background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAAGCAYAAADgzO9IAAAAKUlEQVQIHWO8e/fufwYsgAUkJigoiCIF5DMyoYggcUiXgNnBiGQKmAkARpcEQeriln4AAAAASUVORK5CYII=); |
133 | - -moz-border-radius: 0 0 2px 2px; |
134 | - -webkit-border-radius: 0 0 2px 2px; |
135 | - border-radius: 0 0 2px 2px; |
136 | -} |
137 | -.openerp.ui-dialog .oe_about a { |
138 | - color: #7c7bad; |
139 | -} |
140 | -.openerp.ui-dialog .oe_about a:hover { |
141 | - text-decoration: underline; |
142 | -} |
143 | -.openerp.ui-dialog .oe_about a:focus { |
144 | - outline: none; |
145 | -} |
146 | -.openerp.ui-dialog .oe_about .oe_logo { |
147 | - margin-left: -6px; |
148 | -} |
149 | -.openerp.ui-dialog .oe_about .oe_bottom { |
150 | - position: absolute; |
151 | - top: 50%; |
152 | - left: 0; |
153 | - right: 0; |
154 | - bottom: 0; |
155 | - text-shadow: 0 1px 1px #999999; |
156 | - background-color: #8a0e0e; |
157 | - background-image: -webkit-gradient(linear, left top, left bottom, from(#b41616), to(#600606)); |
158 | - background-image: -webkit-linear-gradient(top, #b41616, #600606); |
159 | - background-image: -moz-linear-gradient(top, #b41616, #600606); |
160 | - background-image: -ms-linear-gradient(top, #b41616, #600606); |
161 | - background-image: -o-linear-gradient(top, #b41616, #600606); |
162 | - background-image: linear-gradient(to bottom, #b41616, #600606); |
163 | - color: #eeeeee; |
164 | - padding: 0 16px; |
165 | - -moz-border-radius: 0 0 2px 2px; |
166 | - -webkit-border-radius: 0 0 2px 2px; |
167 | - border-radius: 0 0 2px 2px; |
168 | -} |
169 | -.openerp.ui-dialog .oe_about .oe_bottom a { |
170 | - color: #eeeeee; |
171 | -} |
172 | -.openerp.ui-dialog.oe_act_window .ui-dialog-content { |
173 | - padding: 0px; |
174 | -} |
175 | -.openerp .modal-backdrop { |
176 | - position: fixed; |
177 | - top: 0; |
178 | - right: 0; |
179 | - bottom: 0; |
180 | - left: 0; |
181 | - z-index: 1040; |
182 | - background-color: black; |
183 | - filter: alpha(opacity=30); |
184 | - opacity: 0.3; |
185 | -} |
186 | .openerp .oe_i { |
187 | font-family: "mnmliconsRegular" !important; |
188 | font-size: 21px; |
189 | @@ -893,7 +751,7 @@ |
190 | background-image: -moz-linear-gradient(top, #fc8787, maroon); |
191 | background-image: -ms-linear-gradient(top, #fc8787, maroon); |
192 | background-image: -o-linear-gradient(top, #fc8787, maroon); |
193 | - background-image: linear-gradient(to bottom, #fc8787, #800000); |
194 | + background-image: linear-gradient(to bottom, #fc8787, maroon); |
195 | } |
196 | .openerp .navbar .oe_topbar_anonymous_login a { |
197 | display: block; |
198 | @@ -1164,6 +1022,7 @@ |
199 | margin-left: 20px; |
200 | } |
201 | .openerp .oe_about { |
202 | + padding: 15px; |
203 | background-color: white; |
204 | background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAAGCAYAAADgzO9IAAAAKUlEQVQIHWO8e/fufwYsgAUkJigoiCIF5DMyoYggcUiXgNnBiGQKmAkARpcEQeriln4AAAAASUVORK5CYII=); |
205 | -moz-border-radius: 0 0 2px 2px; |
206 | @@ -1184,7 +1043,7 @@ |
207 | } |
208 | .openerp .oe_about .oe_bottom { |
209 | position: absolute; |
210 | - top: 50%; |
211 | + top: 59%; |
212 | left: 0; |
213 | right: 0; |
214 | bottom: 0; |
215 | @@ -2142,7 +2001,7 @@ |
216 | } |
217 | .openerp .oe_form .oe_form_label_help[for] span, .openerp .oe_form .oe_form_label[for] span { |
218 | font-size: 80%; |
219 | - color: darkGreen; |
220 | + color: darkgreen; |
221 | vertical-align: top; |
222 | position: relative; |
223 | top: -4px; |
224 | @@ -2485,6 +2344,7 @@ |
225 | line-height: 14px; |
226 | float: right; |
227 | padding-left: 2px; |
228 | + color: #7c7bad; |
229 | } |
230 | .openerp .oe_form_field_many2one input { |
231 | padding-right: 13px; |
232 | @@ -3390,9 +3250,6 @@ |
233 | .openerp_ie ul.oe_form_status li.oe_active > .arrow span, .openerp_ie ul.oe_form_status_clickable li.oe_active > .arrow span { |
234 | background-color: #729fcf !important; |
235 | } |
236 | -.openerp_ie .ui-dialog-buttonpane .ui-dialog-buttonset .ui-button { |
237 | - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#EFEFEF', endColorstr='#D8D8D8'); |
238 | -} |
239 | |
240 | @media print { |
241 | .openerp { |
242 | @@ -3439,6 +3296,72 @@ |
243 | height: 18px; |
244 | } |
245 | |
246 | +.modal { |
247 | + overflow-y: auto; |
248 | + overflow-x: hidden; |
249 | +} |
250 | +.modal a { |
251 | + color: #7c7bad; |
252 | +} |
253 | +.modal .ui-icon-gripsmall-diagonal-se { |
254 | + background-position: -77px -220px; |
255 | +} |
256 | +.modal .in pre { |
257 | + margin: 15px; |
258 | +} |
259 | +.modal .modal-header { |
260 | + cursor: move; |
261 | + font-size: 18px; |
262 | + background-color: #ededed; |
263 | + background-image: -webkit-linear-gradient(top, #fcfcfc, #dedede); |
264 | + border-top-right-radius: 4px; |
265 | + border-top-left-radius: 4px; |
266 | + min-height: 54px; |
267 | +} |
268 | +.modal .modal-header button.close { |
269 | + border: none; |
270 | + background: none; |
271 | + padding: 1px; |
272 | + height: 18px; |
273 | + font-size: 20px; |
274 | +} |
275 | +.modal .modal-footer { |
276 | + text-align: left; |
277 | + background-color: whitesmoke; |
278 | +} |
279 | +.modal .modal-footer footer .oe_button { |
280 | + margin-right: 3px; |
281 | +} |
282 | +.modal .modal-body { |
283 | + position: initial; |
284 | + padding: 0; |
285 | +} |
286 | +.modal .modal-body .in { |
287 | + min-height: 70px; |
288 | +} |
289 | +.modal .modal-body dl.in { |
290 | + margin-bottom: -14px; |
291 | +} |
292 | +.modal .modal-body dl.in, .modal .modal-body dd { |
293 | + margin-left: 20px; |
294 | +} |
295 | +.modal .modal-body dl.in dl dd, .modal .modal-body dd dl dd { |
296 | + margin-left: 60px; |
297 | +} |
298 | +.modal .modal-body dl.in dd dt, .modal .modal-body dd dd dt { |
299 | + margin-left: 15px; |
300 | +} |
301 | +.modal .modal-body dl.in dt, .modal .modal-body dd dt { |
302 | + font-weight: normal !important; |
303 | +} |
304 | +.modal .modal-content { |
305 | + min-height: 185px; |
306 | + min-width: 230px; |
307 | + border: none; |
308 | + border-radius: 3px; |
309 | + box-shadow: rgba(0, 0, 0, 0.29804) 0px 0px 0px 7px; |
310 | +} |
311 | + |
312 | input[type="radio"], input[type="checkbox"] { |
313 | margin-right: 4px; |
314 | margin-left: 4px; |
315 | |
316 | === modified file 'addons/web/static/src/css/base.sass' |
317 | --- addons/web/static/src/css/base.sass 2014-01-31 00:52:02 +0000 |
318 | +++ addons/web/static/src/css/base.sass 2014-02-03 18:22:10 +0000 |
319 | @@ -207,7 +207,7 @@ |
320 | font-size: inherit |
321 | // }}} |
322 | // Button style {{{ |
323 | - a.button:link, a.button:visited, button, .oe_button, input[type='submit'], .ui-dialog-buttonpane .ui-dialog-buttonset .ui-button |
324 | + a.button:link, a.button:visited, button, .oe_button, input[type='submit'] |
325 | display: inline-block |
326 | border: 1px solid rgba(0,0,0,0.4) |
327 | color: #4c4c4c |
328 | @@ -222,18 +222,18 @@ |
329 | -webkit-font-smoothing: antialiased |
330 | outline: none |
331 | |
332 | - a.button:hover, button:hover,.oe_button:hover, input[type='submit']:hover, .ui-dialog-buttonpane .ui-dialog-buttonset .ui-button.ui-state-hover |
333 | + a.button:hover, button:hover, .oe_button:hover, input[type='submit']:hover |
334 | @include vertical-gradient(#f6f6f6, #e3e3e3) |
335 | cursor: pointer |
336 | background-position: 0 |
337 | |
338 | - a.button:focus, button:focus, .oe_button:focus, input[type='submit']:focus, .ui-dialog-buttonpane .ui-dialog-buttonset .ui-button.ui-state-focus |
339 | + a.button:focus, button:focus, .oe_button:focus, input[type='submit']:focus |
340 | border: 1px solid #80bfff |
341 | background-position: 0 |
342 | @include vertical-gradient(#f6f6f6, #e3e3e3) |
343 | @include box-shadow((0 0 3px #80bfff, 0 1px 1px rgba(255, 255, 255, .8) inset)) |
344 | |
345 | - a.button:active, a.button.active, button:active, .oe_button:active, .oe_button.active, input[type='submit']:active, input[type='submit'].active, .ui-dialog-buttonpane .ui-dialog-buttonset .ui-button.ui-state-active |
346 | + a.button:active, a.button.active, button:active, button.active, .oe_button:active, .oe_button.active, input[type='submit']:active, input[type='submit'].active |
347 | @include vertical-gradient(#e3e3e3, #f6f6f6) |
348 | @include box-shadow(none) |
349 | |
350 | @@ -261,105 +261,6 @@ |
351 | .ui-tabs |
352 | position: static |
353 | |
354 | - // Modal box |
355 | - &.ui-dialog |
356 | - display: none |
357 | - height: auto !important |
358 | - padding: 6px |
359 | - //overflow: hidden |
360 | - background-color: rgba(60,60,60,0.7) |
361 | - border: 1px solid |
362 | - border-color: #888 #555 #444 |
363 | - //overflow: hidden |
364 | - @include radius(8px) |
365 | - @include box-shadow(0 1px 12px rgba(0, 0, 0, 0.6)) |
366 | - @include background-clip() |
367 | - .ui-dialog-content |
368 | - padding: 0 |
369 | - .ui-dialog-titlebar, .ui-dialog-content, .ui-dialog-buttonpane |
370 | - padding: 16px |
371 | - .ui-dialog-titlebar |
372 | - border-top: none |
373 | - border-left: none |
374 | - border-right: none |
375 | - border-bottom: 1px solid #cacaca |
376 | - @include radius(2px 2px 0 0) |
377 | - @include vertical-gradient(#FCFCFC, #DEDEDE) |
378 | - .ui-dialog-title |
379 | - margin: 0 |
380 | - padding: 0 |
381 | - .ui-dialog-content |
382 | - background: white |
383 | - width: auto !important |
384 | - .ui-dialog-buttonpane |
385 | - border-top: 1px solid #e0e0e0 |
386 | - background: #f5f7f9 |
387 | - margin: 0 |
388 | - @include radius(0 0 2px 2px) |
389 | - button |
390 | - margin: 0 4px 0 0 |
391 | - .ui-dialog-buttonset |
392 | - float: left |
393 | - .ui-button |
394 | - margin-right: 4px |
395 | - .ui-dialog-titlebar-close |
396 | - padding: 0 |
397 | - .ui-icon-closethick |
398 | - display: none |
399 | - &:before |
400 | - content: "×" |
401 | - font-size: 18px |
402 | - font-weight: bold |
403 | - line-height: 16px |
404 | - color: black |
405 | - text-shadow: 0 1px 0 white |
406 | - padding: 0 |
407 | - cursor: pointer |
408 | - background: transparent |
409 | - border: 0 |
410 | - &:hover |
411 | - color: black |
412 | - text-decoration: none |
413 | - .oe_about |
414 | - background-color: white |
415 | - background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAAGCAYAAADgzO9IAAAAKUlEQVQIHWO8e/fufwYsgAUkJigoiCIF5DMyoYggcUiXgNnBiGQKmAkARpcEQeriln4AAAAASUVORK5CYII=) |
416 | - @include radius(0 0 2px 2px) |
417 | - a |
418 | - color: $link-color |
419 | - &:hover |
420 | - text-decoration: underline |
421 | - &:focus |
422 | - outline: none |
423 | - .oe_logo |
424 | - margin-left: -6px |
425 | - .oe_bottom |
426 | - position: absolute |
427 | - top: 50% |
428 | - left: 0 |
429 | - right: 0 |
430 | - bottom: 0 |
431 | - text-shadow: 0 1px 1px #999999 |
432 | - @include vertical-gradient(#b41616, #600606) |
433 | - color: #eee |
434 | - padding: 0 16px |
435 | - @include radius(0 0 2px 2px) |
436 | - a |
437 | - color: #eee |
438 | - |
439 | - &.ui-dialog.oe_act_window |
440 | - .ui-dialog-content |
441 | - padding: 0px |
442 | - |
443 | - .modal-backdrop |
444 | - position: fixed |
445 | - top: 0 |
446 | - right: 0 |
447 | - bottom: 0 |
448 | - left: 0 |
449 | - z-index: 1040 |
450 | - background-color: black |
451 | - @include opacity(.3) |
452 | - |
453 | // }}} |
454 | // Generic classes {{{ |
455 | .oe_i |
456 | @@ -464,7 +365,7 @@ |
457 | .oe_grey |
458 | color: #aaa |
459 | // Added for generic error message and customize bootstrap3 <pre>,<hr> |
460 | - .oe_error_detail |
461 | + .oe_error_detail |
462 | hr |
463 | display: block |
464 | -webkit-margin-before: 0.5em |
465 | @@ -600,7 +501,7 @@ |
466 | //Customize label weight according bootstrap3 |
467 | > label:not([for]) |
468 | font-weight: normal !important |
469 | - // End of customize |
470 | + // End of customize |
471 | div.ui-tabs |
472 | padding: 3px 0px 3px 0px |
473 | .ui-tabs-hide |
474 | @@ -976,6 +877,7 @@ |
475 | // }}} |
476 | // About openerp {{{ |
477 | .oe_about |
478 | + padding: 15px // Customize according bootstrap3 modal |
479 | background-color: white |
480 | background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAAGCAYAAADgzO9IAAAAKUlEQVQIHWO8e/fufwYsgAUkJigoiCIF5DMyoYggcUiXgNnBiGQKmAkARpcEQeriln4AAAAASUVORK5CYII=) |
481 | @include radius(0 0 2px 2px) |
482 | @@ -989,7 +891,7 @@ |
483 | margin-left: -6px |
484 | .oe_bottom |
485 | position: absolute |
486 | - top: 50% |
487 | + top: 59% // Customize according bootstrap3 modal |
488 | left: 0 |
489 | right: 0 |
490 | bottom: 0 |
491 | @@ -1188,7 +1090,7 @@ |
492 | display: none |
493 | // }}} |
494 | // FormPopup {{{ |
495 | - .oe_popup_form |
496 | + .oe_popup_form |
497 | .oe_formview .oe_form_pager |
498 | display: none !important |
499 | // Customize label weight for popup wizard appear from another wizard according bootstrap3 |
500 | @@ -1222,7 +1124,7 @@ |
501 | input[type="checkbox"] |
502 | margin: 3px 3px 3px 4px |
503 | select |
504 | - margin: 2px 4px 2px 0 |
505 | + margin: 2px 4px 2px 0 |
506 | //End of customize |
507 | &.oe_focused |
508 | border-color: $tag-border-selected |
509 | @@ -1648,8 +1550,8 @@ |
510 | padding-left: 2px |
511 | @include vertical-gradient(#fcfcfc, #dedede) |
512 | > span |
513 | - margin-left: 4px |
514 | - |
515 | + margin-left: 4px |
516 | + |
517 | // }}} |
518 | // FormView.custom tags and classes {{{ |
519 | .oe_form |
520 | @@ -1977,7 +1879,7 @@ |
521 | .oe_e |
522 | position: relative |
523 | top: -1px |
524 | - left: -9px |
525 | + left: -9px |
526 | input.oe_form_binary_file |
527 | display: inline-block |
528 | margin-left: -85px |
529 | @@ -2021,6 +1923,7 @@ |
530 | line-height: 14px |
531 | float: right |
532 | padding-left: 2px |
533 | + color: #7c7bad |
534 | input |
535 | padding-right: 13px |
536 | &.ui-autocomplete |
537 | @@ -2721,7 +2624,7 @@ |
538 | filter: alpha(opacity = 0) |
539 | border: none |
540 | width: 0 |
541 | - border-right: none |
542 | + border-right: none |
543 | > .label |
544 | border-bottom: 1px solid #cacaca |
545 | background: transparent |
546 | @@ -2735,8 +2638,8 @@ |
547 | background-color: #729fcf !important |
548 | |
549 | // jquery ui for ie |
550 | - .ui-dialog-buttonpane .ui-dialog-buttonset .ui-button |
551 | - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#EFEFEF', endColorstr='#D8D8D8') |
552 | + //.ui-dialog-buttonpane .ui-dialog-buttonset .ui-button |
553 | + // filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#EFEFEF', endColorstr='#D8D8D8') |
554 | // }}} |
555 | |
556 | // @media print {{{ |
557 | @@ -2781,6 +2684,57 @@ |
558 | height: 18px |
559 | // End hack}}} |
560 | |
561 | +// Customized modal according bootstrap3 |
562 | +.modal |
563 | + overflow-y: auto |
564 | + overflow-x: hidden |
565 | + a |
566 | + color: #7c7bad |
567 | + .ui-icon-gripsmall-diagonal-se |
568 | + background-position: -77px -220px |
569 | + .in pre |
570 | + margin: 15px |
571 | + .modal-header |
572 | + cursor: move |
573 | + font-size: 18px |
574 | + background-color: #ededed |
575 | + background-image: -webkit-linear-gradient(top, #fcfcfc, #dedede) |
576 | + border-top-right-radius: 4px |
577 | + border-top-left-radius: 4px |
578 | + min-height: 54px |
579 | + button.close |
580 | + border: none |
581 | + background: none |
582 | + padding: 1px |
583 | + height: 18px |
584 | + font-size: 20px |
585 | + .modal-footer |
586 | + text-align: left |
587 | + background-color: #f5f5f5 |
588 | + footer .oe_button |
589 | + margin-right: 3px |
590 | + .modal-body |
591 | + position: initial |
592 | + padding: 0 |
593 | + .in |
594 | + min-height: 70px |
595 | + dl.in |
596 | + margin-bottom: -14px |
597 | + dl.in, dd |
598 | + margin-left: 20px |
599 | + dl dd |
600 | + margin-left: 60px |
601 | + dd dt |
602 | + margin-left: 15px |
603 | + dt |
604 | + font-weight: normal !important |
605 | + .modal-content |
606 | + min-height: 185px |
607 | + min-width: 230px |
608 | + border: none |
609 | + border-radius: 3px |
610 | + box-shadow: rgba(0, 0, 0, 0.298039) 0px 0px 0px 7px |
611 | +// End fo customize |
612 | input[type="radio"], input[type="checkbox"] |
613 | margin-right: 4px |
614 | margin-left: 4px |
615 | |
616 | === modified file 'addons/web/static/src/js/chrome.js' |
617 | --- addons/web/static/src/js/chrome.js 2014-01-16 18:15:19 +0000 |
618 | +++ addons/web/static/src/js/chrome.js 2014-02-03 18:22:10 +0000 |
619 | @@ -60,10 +60,32 @@ |
620 | * The very minimal function everything should call to create a dialog |
621 | * in OpenERP Web Client. |
622 | */ |
623 | -instance.web.dialog = function(element) { |
624 | - var result = element.dialog.apply(element, _.rest(_.toArray(arguments))); |
625 | - result.dialog("widget").openerpClass(); |
626 | - return result; |
627 | +instance.web.dialog = function(element, options) { |
628 | + $dialog_box = $(QWeb.render('web.prompt', options)).appendTo("body"); |
629 | + element.modal({ |
630 | + 'backdrop': false, |
631 | + 'keyboard': true, |
632 | + }); |
633 | + element.appendTo($dialog_box.find(".modal-body")); |
634 | + var dialog_body = $dialog_box.find('.modal-content'); |
635 | + if(options.layout){ |
636 | + dialog_body.css(options.layout); |
637 | + } |
638 | + dialog_body.openerpClass(); |
639 | + dialog_body.draggable({ handle: ".modal-header", containment: "window" }); |
640 | + $dialog_box.on('shown.bs.modal', function (e){ |
641 | + $('body').css({overflow: 'hidden'}); |
642 | + }) |
643 | + .on('hidden.bs.modal', function(e){ |
644 | + if($('.in .modal-content').length != 0){ |
645 | + $('.modal').focus(); |
646 | + $('body').css('overflow','hidden'); |
647 | + }else{ |
648 | + $('body').css('overflow','scroll'); |
649 | + } |
650 | + }); |
651 | + $dialog_box.modal('show'); |
652 | + return $dialog_box; |
653 | }; |
654 | |
655 | /** |
656 | @@ -94,29 +116,22 @@ |
657 | this._super(parent); |
658 | this.content_to_set = content; |
659 | this.dialog_options = { |
660 | - modal: true, |
661 | - destroy_on_close: true, |
662 | - width: 900, |
663 | - min_width: 0, |
664 | - max_width: '95%', |
665 | - height: 'auto', |
666 | - min_height: 0, |
667 | - max_height: $(window.top).height() - 200, |
668 | - autoOpen: false, |
669 | - position: [false, 40], |
670 | + layout: { |
671 | + 'width': 900, |
672 | + 'min_width': 0, |
673 | + 'max_width': '95%', |
674 | + 'height': 'auto', |
675 | + 'min_height': 0, |
676 | + 'max_height': $(window.top).height() - 200, |
677 | + 'right': 158 |
678 | + }, |
679 | + resizable: true, |
680 | buttons: null, |
681 | - beforeClose: function () { |
682 | - self.trigger("closing"); |
683 | - }, |
684 | - resizeStop: function() { |
685 | - self.trigger("resized"); |
686 | - }, |
687 | }; |
688 | if (options) { |
689 | - _.extend(this.dialog_options, options); |
690 | + $.extend(true, this.dialog_options, options); |
691 | } |
692 | - this.on("closing", this, this._closing); |
693 | - this.$buttons = $('<div class="ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"><span class="oe_dialog_custom_buttons"/></div>'); |
694 | + this.$buttons = $('<div class="modal-footer"><span class="oe_dialog_custom_buttons"/></div>'); |
695 | }, |
696 | _get_options: function() { |
697 | var self = this; |
698 | @@ -126,14 +141,14 @@ |
699 | height: $(window.top).height(), |
700 | }; |
701 | _.each(sizes, function(available_size, unit) { |
702 | - o[unit] = self._get_size(o[unit], available_size); |
703 | - o['min_' + unit] = self._get_size(o['min_' + unit] || 0, available_size); |
704 | - o['max_' + unit] = self._get_size(o['max_' + unit] || 0, available_size); |
705 | - if (o[unit] !== 'auto' && o['min_' + unit] && o[unit] < o['min_' + unit]) { |
706 | - o[unit] = o['min_' + unit]; |
707 | + o.layout[unit] = self._get_size(o.layout[unit], available_size); |
708 | + o.layout['min_' + unit] = self._get_size(o.layout['min_' + unit] || 0, available_size); |
709 | + o.layout['max_' + unit] = self._get_size(o.layout['max_' + unit] || 0, available_size); |
710 | + if (o.layout[unit] !== 'auto' && o.layout['min_' + unit] && o.layout[unit] < o.layout['min_' + unit]) { |
711 | + o.layout[unit] = o.layout['min_' + unit]; |
712 | } |
713 | - if (o[unit] !== 'auto' && o['max_' + unit] && o[unit] > o['max_' + unit]) { |
714 | - o[unit] = o['max_' + unit]; |
715 | + if (o.layout[unit] !== 'auto' && o.layout['max_' + unit] && o.layout[unit] > o.layout['max_' + unit]) { |
716 | + o.layout[unit] = o.layout['max_' + unit]; |
717 | } |
718 | }); |
719 | o.title = o.title || this.dialog_title; |
720 | @@ -165,8 +180,7 @@ |
721 | if (!this.dialog_inited) { |
722 | this.init_dialog(); |
723 | } |
724 | - this.$el.dialog('open'); |
725 | - this.$el.dialog("widget").append(this.$buttons); |
726 | + this.$buttons.insertAfter($dialog_box.find(".modal-body")); |
727 | return this; |
728 | }, |
729 | _add_buttons: function(buttons) { |
730 | @@ -198,9 +212,20 @@ |
731 | } |
732 | this.renderElement(); |
733 | instance.web.dialog(this.$el, options); |
734 | - if (options.height === 'auto' && options.max_height) { |
735 | - this.$el.css({ 'max-height': options.max_height, 'overflow-y': 'auto' }); |
736 | - } |
737 | + if (options.layout.height === 'auto' && options.layout.max_height) { |
738 | + this.$el.css({ 'max-height': options.layout.max_height, 'overflow-y': 'auto' }); |
739 | + } |
740 | + var dialog_body = $dialog_box.find('.modal-content'); |
741 | + if (options.resizable){ |
742 | + dialog_body.resizable({ handles: 'n, e, s, w, ne, se, sw, nw' }); |
743 | + } |
744 | + dialog_body.resize(function() { |
745 | + main_modal = dialog_body.parent(); |
746 | + modal_body = main_modal.find(".modal-body .in"); |
747 | + modal_content = main_modal.find(".modal-content").height(); |
748 | + modal_body.height(modal_content - 150); |
749 | + main_modal.find(".modal-content").height((modal_body.height() + main_modal.find(".modal-header").height() + main_modal.find(".modal-footer").height()) + 85); |
750 | + }); |
751 | this.dialog_inited = true; |
752 | var res = this.start(); |
753 | return res; |
754 | @@ -209,17 +234,8 @@ |
755 | Closes the popup, if destroy_on_close was passed to the constructor, it is also destroyed. |
756 | */ |
757 | close: function() { |
758 | - if (this.dialog_inited && this.$el.is(":data(dialog)")) { |
759 | - this.$el.dialog('close'); |
760 | - } |
761 | - }, |
762 | - _closing: function() { |
763 | - if (this.__tmp_dialog_destroying) |
764 | - return; |
765 | - if (this.dialog_options.destroy_on_close) { |
766 | - this.__tmp_dialog_closing = true; |
767 | - this.destroy(); |
768 | - this.__tmp_dialog_closing = undefined; |
769 | + if (this.dialog_inited && this.$el.is(":data(bs.modal)")) { |
770 | + this.$el.parents('.modal').modal('hide'); |
771 | } |
772 | }, |
773 | /** |
774 | @@ -235,8 +251,8 @@ |
775 | this.close(); |
776 | this.__tmp_dialog_destroying = undefined; |
777 | } |
778 | - if (this.dialog_inited && !this.isDestroyed() && this.$el.is(":data(dialog)")) { |
779 | - this.$el.dialog('destroy'); |
780 | + if (this.dialog_inited && !this.isDestroyed() && this.$el.is(":data(bs.modal)")) { |
781 | + this.$el.parents('.modal').modal('hide'); |
782 | } |
783 | this._super(); |
784 | } |
785 | @@ -274,12 +290,14 @@ |
786 | if (error.data.exception_type === "except_osv") { |
787 | error = _.extend({}, error, {data: _.extend({}, error.data, {message: error.data.arguments[0] + "\n\n" + error.data.arguments[1]})}); |
788 | } |
789 | - instance.web.dialog($('<div>' + QWeb.render('CrashManager.warning', {error: error}) + '</div>'), { |
790 | + var dialog = new instance.web.Dialog(this, { |
791 | title: "OpenERP " + (_.str.capitalize(error.type) || "Warning"), |
792 | buttons: [ |
793 | - {text: _t("Ok"), click: function() { $(this).dialog("close"); }} |
794 | - ] |
795 | - }); |
796 | + {text: _t("Ok"), click: function() { this.parents('.modal').modal('hide'); }} |
797 | + ], |
798 | + layout: { 'width': 300, 'top': 175, 'left': 135 } |
799 | + }).open(); |
800 | + dialog.$el.html(QWeb.render('CrashManager.warning', {error: error})); |
801 | }, |
802 | show_error: function(error) { |
803 | if (!this.active) { |
804 | @@ -287,14 +305,15 @@ |
805 | } |
806 | var buttons = {}; |
807 | buttons[_t("Ok")] = function() { |
808 | - $(this).dialog("close"); |
809 | + this.parents('.modal').modal('hide'); |
810 | }; |
811 | var dialog = new instance.web.Dialog(this, { |
812 | title: "OpenERP " + _.str.capitalize(error.type), |
813 | - width: '80%', |
814 | - height: '50%', |
815 | - min_width: '800px', |
816 | - min_height: '600px', |
817 | + layout: { |
818 | + height: 'auto', |
819 | + min_width: '800px', |
820 | + min_height: '600px', |
821 | + }, |
822 | buttons: buttons |
823 | }).open(); |
824 | dialog.$el.html(QWeb.render('CrashManager.error', {session: instance.session, error: error})); |
825 | @@ -344,16 +363,18 @@ |
826 | error = this.error; |
827 | error.data.message = error.data.arguments[0]; |
828 | |
829 | - instance.web.dialog($('<div>' + QWeb.render('CrashManager.warning', {error: error}) + '</div>'), { |
830 | + var dialog = new instance.web.Dialog(this, { |
831 | title: "OpenERP " + (_.str.capitalize(error.type) || "Warning"), |
832 | buttons: [ |
833 | - {text: _t("Ok"), click: function() { $(this).dialog("close"); }}, |
834 | + {text: _t("Ok"), click: function() { this.$el.parents('.modal').modal('hide'); }}, |
835 | {text: error.data.arguments[2], click: function() { |
836 | window.location.href='#action='+error.data.arguments[1]; |
837 | - $(this).dialog("close"); |
838 | + this.$el.parents('.modal').modal('hide'); |
839 | }} |
840 | - ] |
841 | - }); |
842 | + ], |
843 | + layout: { 'width': 300, 'top': 175, 'left': 135 } |
844 | + }).open(); |
845 | + dialog.$el.html(QWeb.render('CrashManager.warning', {error: error})); |
846 | this.destroy(); |
847 | } |
848 | }); |
849 | @@ -501,10 +522,9 @@ |
850 | */ |
851 | display_error: function (error) { |
852 | return instance.web.dialog($('<div>'), { |
853 | - modal: true, |
854 | title: error.title, |
855 | buttons: [ |
856 | - {text: _t("Ok"), click: function() { $(this).dialog("close"); }} |
857 | + {text: _t("Ok"), click: function() { this.$el.parents('.modal').modal('hide'); }} |
858 | ] |
859 | }).html(error.error); |
860 | }, |
861 | @@ -734,10 +754,9 @@ |
862 | }, |
863 | display_error: function (error) { |
864 | return instance.web.dialog($('<div>'), { |
865 | - modal: true, |
866 | title: error.title, |
867 | buttons: [ |
868 | - {text: _t("Ok"), click: function() { $(this).dialog("close"); }} |
869 | + {text: _t("Ok"), click: function() { this.$el.parents('.modal').modal('hide'); }} |
870 | ] |
871 | }).html(error.error); |
872 | }, |
873 | @@ -1054,8 +1073,11 @@ |
874 | e.preventDefault(); |
875 | window.location = $.param.querystring( window.location.href, 'debug'); |
876 | }); |
877 | - instance.web.dialog($help, {autoOpen: true, |
878 | - modal: true, width: 507, height: 290, resizable: false, title: _t("About")}); |
879 | + instance.web.dialog($help, { |
880 | + resizable: false, |
881 | + title: _t("About"), |
882 | + layout: { 'width': 507, 'height': 290, 'top': 175, 'left': 40 } |
883 | + }); |
884 | }); |
885 | }, |
886 | }); |
887 | |
888 | === modified file 'addons/web/static/src/js/data_export.js' |
889 | --- addons/web/static/src/js/data_export.js 2013-10-17 09:44:57 +0000 |
890 | +++ addons/web/static/src/js/data_export.js 2014-02-03 18:22:10 +0000 |
891 | @@ -46,7 +46,6 @@ |
892 | start: function() { |
893 | var self = this; |
894 | this._super.apply(this, arguments); |
895 | - self.$el.removeClass('ui-dialog-content ui-widget-content'); |
896 | |
897 | var got_fields = new $.Deferred(); |
898 | this.$el.find('#import_compat').change(function() { |
899 | @@ -414,7 +413,7 @@ |
900 | }); |
901 | }, |
902 | close: function() { |
903 | - this.$el.remove(); |
904 | + this.$el.parents('.modal').modal('hide'); |
905 | this._super(); |
906 | } |
907 | }); |
908 | |
909 | === modified file 'addons/web/static/src/js/view_form.js' |
910 | --- addons/web/static/src/js/view_form.js 2014-01-31 00:52:02 +0000 |
911 | +++ addons/web/static/src/js/view_form.js 2014-02-03 18:22:10 +0000 |
912 | @@ -586,13 +586,14 @@ |
913 | this._internal_set_values(result.value, processed); |
914 | } |
915 | if (!_.isEmpty(result.warning)) { |
916 | - instance.web.dialog($(QWeb.render("CrashManager.warning", result.warning)), { |
917 | + var dialog = new instance.web.Dialog(this, { |
918 | title:result.warning.title, |
919 | - modal: true, |
920 | buttons: [ |
921 | - {text: _t("Ok"), click: function() { $(this).dialog("close"); }} |
922 | - ] |
923 | - }); |
924 | + {text: _t("Ok"), click: function() { this.parents('.modal').modal('hide'); }} |
925 | + ], |
926 | + layout: { 'width': 300, 'top': 175, 'left': 135 } |
927 | + }).open(); |
928 | + dialog.$el.html(QWeb.render("CrashManager.warning", result.warning)); |
929 | } |
930 | |
931 | return $.Deferred().resolve(); |
932 | @@ -1033,7 +1034,7 @@ |
933 | if (field instanceof instance.web.form.FieldSelection) { |
934 | return _(field.values).find(function (option) { |
935 | return option[0] === value; |
936 | - })[1]; |
937 | + }); |
938 | } else if (field instanceof instance.web.form.FieldMany2One) { |
939 | return field.get_displayed(); |
940 | } |
941 | @@ -1942,23 +1943,19 @@ |
942 | var def = $.Deferred(); |
943 | var dialog = instance.web.dialog($('<div/>').text(self.node.attrs.confirm), { |
944 | title: _t('Confirm'), |
945 | - modal: true, |
946 | buttons: [ |
947 | {text: _t("Cancel"), click: function() { |
948 | - $(this).dialog("close"); |
949 | + this.parents('.modal').modal('hide'); |
950 | } |
951 | }, |
952 | {text: _t("Ok"), click: function() { |
953 | var self2 = this; |
954 | self.on_confirmed().always(function() { |
955 | - $(self2).dialog("close"); |
956 | + self2.parents('.modal').modal('hide'); |
957 | }); |
958 | } |
959 | } |
960 | ], |
961 | - beforeClose: function() { |
962 | - def.resolve(); |
963 | - }, |
964 | }); |
965 | return def.promise(); |
966 | } else { |
967 | @@ -3172,7 +3169,9 @@ |
968 | init: function(parent) { |
969 | this._super(parent, { |
970 | title: _.str.sprintf(_t("Add %s"), parent.string), |
971 | - width: 312, |
972 | + layout: { |
973 | + 'width': 312 |
974 | + } |
975 | }); |
976 | }, |
977 | start: function() { |
978 | @@ -3240,7 +3239,7 @@ |
979 | delete this.$drop_down; |
980 | } |
981 | if (this.$input) { |
982 | - this.$input.closest(".ui-dialog .ui-dialog-content").off('scroll'); |
983 | + this.$input.closest(".modal .modal-content").off('scroll'); |
984 | this.$input.off('keyup blur autocompleteclose autocompleteopen ' + |
985 | 'focus focusout change keydown'); |
986 | delete this.$input; |
987 | @@ -3333,7 +3332,7 @@ |
988 | self.$input.autocomplete("close"); |
989 | } |
990 | }, 50); |
991 | - this.$input.closest(".ui-dialog .ui-dialog-content").on('scroll', this, close_autocomplete); |
992 | + this.$input.closest(".modal .modal-content").on('scroll', this, close_autocomplete); |
993 | |
994 | self.ed_def = $.Deferred(); |
995 | self.uned_def = $.Deferred(); |
996 | @@ -4855,8 +4854,7 @@ |
997 | var self = this; |
998 | this.renderElement(); |
999 | var dialog = new instance.web.Dialog(this, { |
1000 | - min_width: '800px', |
1001 | - dialogClass: 'oe_act_window', |
1002 | + layout: { 'min_width': 800 }, |
1003 | close: function() { |
1004 | self.check_exit(true); |
1005 | }, |
1006 | @@ -4923,14 +4921,12 @@ |
1007 | this.select_elements(this.created_elements); |
1008 | this.created_elements = []; |
1009 | } |
1010 | - this.trigger('closed'); |
1011 | this.destroy(); |
1012 | }, |
1013 | destroy: function () { |
1014 | - this.trigger('closed'); |
1015 | - if (this.$el.is(":data(dialog)")) { |
1016 | - this.$el.dialog('close'); |
1017 | - } |
1018 | + if (this.$el.is(":data(bs.modal)")) { |
1019 | + this.$el.parents('.modal').modal('hide'); |
1020 | + } |
1021 | this._super(); |
1022 | }, |
1023 | }); |
1024 | |
1025 | === modified file 'addons/web/static/src/js/views.js' |
1026 | --- addons/web/static/src/js/views.js 2014-01-13 17:43:38 +0000 |
1027 | +++ addons/web/static/src/js/views.js 2014-02-03 18:22:10 +0000 |
1028 | @@ -412,7 +412,7 @@ |
1029 | this.dialog = new instance.web.Dialog(this, { |
1030 | dialogClass: executor.klass, |
1031 | }); |
1032 | - this.dialog.on("closing", null, options.on_close); |
1033 | + this.dialog.$el.parents('.modal').on("hidden.bs.modal", options.on_close); |
1034 | this.dialog.dialog_title = executor.action.name; |
1035 | if (widget instanceof instance.web.ViewManager) { |
1036 | _.extend(widget.flags, { |
1037 | @@ -921,7 +921,7 @@ |
1038 | current_view = this.views[this.active_view].controller; |
1039 | switch (val) { |
1040 | case 'fvg': |
1041 | - var dialog = new instance.web.Dialog(this, { title: _t("Fields View Get"), width: '95%' }).open(); |
1042 | + var dialog = new instance.web.Dialog(this, { title: _t("Fields View Get"), layout : { 'width': '95%', 'right': 190 } }).open(); |
1043 | $('<pre>').text(instance.web.json_node_to_xml(current_view.fields_view.arch, true)).appendTo(dialog.$el); |
1044 | break; |
1045 | case 'tests': |
1046 | @@ -938,7 +938,7 @@ |
1047 | this.dataset.call('perm_read', [ids]).done(function(result) { |
1048 | var dialog = new instance.web.Dialog(this, { |
1049 | title: _.str.sprintf(_t("View Log (%s)"), self.dataset.model), |
1050 | - width: 400 |
1051 | + layout: { 'width': 400 , right: 0, left: 90 } |
1052 | }, QWeb.render('ViewManagerDebugViewLog', { |
1053 | perm : result[0], |
1054 | format : instance.web.format_value |
1055 | @@ -981,7 +981,7 @@ |
1056 | new instance.web.Dialog(self, { |
1057 | title: _.str.sprintf(_t("Model %s fields"), |
1058 | self.dataset.model), |
1059 | - width: '95%'}, $root).open(); |
1060 | + layout: { 'width': '95%', 'right': 190 }}, $root).open(); |
1061 | }); |
1062 | break; |
1063 | case 'edit_workflow': |
1064 | @@ -1218,7 +1218,7 @@ |
1065 | domain = $.Deferred().resolve(undefined); |
1066 | } |
1067 | if (ids.length === 0) { |
1068 | - instance.web.dialog($("<div />").text(_t("You must choose at least one record.")), { title: _t("Warning"), modal: true }); |
1069 | + instance.web.dialog($("<div />").text(_t("You must choose at least one record.")), { title: _t("Warning")}); |
1070 | return false; |
1071 | } |
1072 | var active_ids_context = { |
1073 | |
1074 | === modified file 'addons/web/static/src/xml/base.xml' |
1075 | --- addons/web/static/src/xml/base.xml 2014-01-14 13:39:53 +0000 |
1076 | +++ addons/web/static/src/xml/base.xml 2014-02-03 18:22:10 +0000 |
1077 | @@ -32,7 +32,20 @@ |
1078 | <t t-esc="message"/> |
1079 | </div> |
1080 | </t> |
1081 | - |
1082 | +<t t-name="web.prompt"> |
1083 | + <div class="modal" tabindex="-1" data-backdrop="static" role="dialog" aria-hidden="true"> |
1084 | + <div class="modal-dialog"> |
1085 | + <div class="modal-content"> |
1086 | + <div class="modal-header"> |
1087 | + <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> |
1088 | + <h3 class="modal-title"><t t-raw="title"/></h3> |
1089 | + </div> |
1090 | + <div class="modal-body"> |
1091 | + </div> |
1092 | + </div> |
1093 | + </div> |
1094 | + </div> |
1095 | +</t> |
1096 | <t t-name="CrashManager.warning"> |
1097 | <table cellspacing="0" cellpadding="0" border="0" class="oe_dialog_warning"> |
1098 | <tr> |
1099 | @@ -1690,54 +1703,55 @@ |
1100 | <t t-name="ExportView"> |
1101 | <a id="exportview" href="javascript: void(0)" style="text-decoration: none;color: #3D3D3D;">Export</a> |
1102 | </t> |
1103 | -<table t-name="ExportTreeView" class="oe_export" |
1104 | - style="background-color: #F3F3F3;"> |
1105 | - <tr> |
1106 | - <td colspan="3"> |
1107 | - This wizard will export all data that matches the current search criteria to a CSV file. |
1108 | - You can export all data or only the fields that can be reimported after modification. |
1109 | - </td> |
1110 | - </tr> |
1111 | - <tr> |
1112 | - <td colspan="3"> |
1113 | - <label for="import_compat">Export Type:</label> |
1114 | - <select id="import_compat" name="import_compat"> |
1115 | - <option value="yes">Import-Compatible Export</option> |
1116 | - <option value="">Export all Data</option> |
1117 | - </select> |
1118 | - |
1119 | - <label for="export_format">Export Formats</label> |
1120 | - <select id="export_format" name="export_format"></select> |
1121 | - </td> |
1122 | - </tr> |
1123 | - |
1124 | - <tr> |
1125 | - <th>Available fields</th> |
1126 | - <th/> |
1127 | - <th> |
1128 | - Fields to export |
1129 | - <a style="color: blue; text-decoration: none;" href="#" id="export_new_list">Save fields list</a> |
1130 | - <div id="savenewlist"></div> |
1131 | - <div id="ExistsExportList"></div> |
1132 | - </th> |
1133 | - </tr> |
1134 | - <tr style="height: 400px;"> |
1135 | - <td class="oe_export_fields_selector_left"> |
1136 | - <div id="left_field_panel"> |
1137 | - </div> |
1138 | - </td> |
1139 | - <td class="oe_export_fields_selector_center"> |
1140 | - <!-- TODO: replace ids by 'oe_*' classes --> |
1141 | - <button class="oe_button" id="add_field">Add</button> |
1142 | - <button class="oe_button" id="remove_field">Remove</button> |
1143 | - <button class="oe_button" id="remove_all_field">Remove All</button> |
1144 | - </td> |
1145 | - <td class="oe_export_fields_selector_right"> |
1146 | - <select name="fields_list" id="fields_list" |
1147 | - multiple="multiple"></select> |
1148 | - </td> |
1149 | - </tr> |
1150 | -</table> |
1151 | +<div t-name="ExportTreeView"> |
1152 | + <table class="oe_export" style="background-color: #F3F3F3;"> |
1153 | + <tr> |
1154 | + <td colspan="3"> |
1155 | + This wizard will export all data that matches the current search criteria to a CSV file. |
1156 | + You can export all data or only the fields that can be reimported after modification. |
1157 | + </td> |
1158 | + </tr> |
1159 | + <tr> |
1160 | + <td colspan="3"> |
1161 | + <label for="import_compat">Export Type:</label> |
1162 | + <select id="import_compat" name="import_compat"> |
1163 | + <option value="yes">Import-Compatible Export</option> |
1164 | + <option value="">Export all Data</option> |
1165 | + </select> |
1166 | + |
1167 | + <label for="export_format">Export Formats</label> |
1168 | + <select id="export_format" name="export_format"></select> |
1169 | + </td> |
1170 | + </tr> |
1171 | + |
1172 | + <tr> |
1173 | + <th>Available fields</th> |
1174 | + <th/> |
1175 | + <th> |
1176 | + Fields to export |
1177 | + <a style="color: blue; text-decoration: none;" href="#" id="export_new_list">Save fields list</a> |
1178 | + <div id="savenewlist"></div> |
1179 | + <div id="ExistsExportList"></div> |
1180 | + </th> |
1181 | + </tr> |
1182 | + <tr style="height: 400px;"> |
1183 | + <td class="oe_export_fields_selector_left"> |
1184 | + <div id="left_field_panel"> |
1185 | + </div> |
1186 | + </td> |
1187 | + <td class="oe_export_fields_selector_center"> |
1188 | + <!-- TODO: replace ids by 'oe_*' classes --> |
1189 | + <button class="oe_button" id="add_field">Add</button> |
1190 | + <button class="oe_button" id="remove_field">Remove</button> |
1191 | + <button class="oe_button" id="remove_all_field">Remove All</button> |
1192 | + </td> |
1193 | + <td class="oe_export_fields_selector_right"> |
1194 | + <select name="fields_list" id="fields_list" |
1195 | + multiple="multiple"></select> |
1196 | + </td> |
1197 | + </tr> |
1198 | + </table> |
1199 | +</div> |
1200 | <t t-name="ExportTreeView-Domain"> |
1201 | <t t-if="! record.ids_to_export"> |
1202 | <p><strong>Please pay attention that all records matching your search filter will be exported. Not only the selected ids.</strong></p> |
1203 | |
1204 | === modified file 'addons/web_calendar/static/src/js/web_calendar.js' |
1205 | --- addons/web_calendar/static/src/js/web_calendar.js 2014-01-28 10:27:42 +0000 |
1206 | +++ addons/web_calendar/static/src/js/web_calendar.js 2014-02-03 18:22:10 +0000 |
1207 | @@ -39,7 +39,7 @@ |
1208 | function isNullOrUndef(value) { |
1209 | return _.isUndefined(value) || _.isNull(value) |
1210 | } |
1211 | - |
1212 | + |
1213 | instance.web.views.add('calendar', 'instance.web_calendar.CalendarView'); |
1214 | |
1215 | instance.web_calendar.CalendarView = instance.web.View.extend({ |
1216 | @@ -60,7 +60,7 @@ |
1217 | this.range_start = null; |
1218 | this.range_stop = null; |
1219 | this.selected_filters = []; |
1220 | - |
1221 | + |
1222 | }, |
1223 | |
1224 | set_default_options: function(options) { |
1225 | @@ -112,73 +112,73 @@ |
1226 | this.date_start = attrs.date_start; // Field name of starting date field |
1227 | this.date_delay = attrs.date_delay; // duration |
1228 | this.date_stop = attrs.date_stop; |
1229 | - this.all_day = attrs.all_day; |
1230 | - this.attendee_people = attrs.attendee; |
1231 | + this.all_day = attrs.all_day; |
1232 | + this.attendee_people = attrs.attendee; |
1233 | this.how_display_event = ''; |
1234 | - |
1235 | + |
1236 | if (!isNullOrUndef(attrs.quick_create_instance)) { |
1237 | - self.quick_create_instance = 'instance.' + attrs.quick_create_instance; |
1238 | + self.quick_create_instance = 'instance.' + attrs.quick_create_instance; |
1239 | } |
1240 | - |
1241 | + |
1242 | //if quick_add = False, we don't allow quick_add |
1243 | //if quick_add = not specified in view, we use the default quick_create_instance |
1244 | - //if quick_add = is NOT False and IS specified in view, we this one for quick_create_instance' |
1245 | - |
1246 | - this.quick_add_pop = (isNullOrUndef(attrs.quick_add) || _.str.toBoolElse(attrs.quick_add,true) ); |
1247 | + //if quick_add = is NOT False and IS specified in view, we this one for quick_create_instance' |
1248 | + |
1249 | + this.quick_add_pop = (isNullOrUndef(attrs.quick_add) || _.str.toBoolElse(attrs.quick_add,true) ); |
1250 | if (this.quick_add_pop && !isNullOrUndef(attrs.quick_add)) { |
1251 | - self.quick_create_instance = 'instance.' + attrs.quick_add; |
1252 | + self.quick_create_instance = 'instance.' + attrs.quick_add; |
1253 | } |
1254 | // The display format which will be used to display the event where fields are between "[" and "]" |
1255 | if (!isNullOrUndef(attrs.display)) { |
1256 | this.how_display_event = attrs.display; // String with [FIELD] |
1257 | } |
1258 | - |
1259 | + |
1260 | // If this field is set ot true, we don't open the event in form view, but in a popup with the view_id passed by this parameter |
1261 | if (isNullOrUndef(attrs.event_open_popup) || !_.str.toBoolElse(attrs.event_open_popup,true)) { |
1262 | - this.open_popup_action = false; |
1263 | + this.open_popup_action = false; |
1264 | } |
1265 | else { |
1266 | this.open_popup_action = attrs.event_open_popup; |
1267 | } |
1268 | - |
1269 | + |
1270 | // If this field is set to true, we will use de calendar_friends model as filter and not the color field. |
1271 | - this.useContacts = (!isNullOrUndef(attrs.use_contacts) && _.str.toBool(attrs.use_contacts)); |
1272 | + this.useContacts = (!isNullOrUndef(attrs.use_contacts) && _.str.toBool(attrs.use_contacts)); |
1273 | |
1274 | // If this field is set ot true, we don't add itself as an attendee when we use attendee_people to add each attendee icon on an event |
1275 | // The color is the color of the attendee, so don't need to show again that it will be present |
1276 | - this.colorIsAttendee = (!(isNullOrUndef(attrs.color_is_attendee) || !_.str.toBoolElse(attrs.color_is_attendee,true))); |
1277 | - |
1278 | + this.colorIsAttendee = (!(isNullOrUndef(attrs.color_is_attendee) || !_.str.toBoolElse(attrs.color_is_attendee,true))); |
1279 | + |
1280 | /* |
1281 | Will be more logic to do it in futur, but see below to stay Retro-compatible |
1282 | - |
1283 | + |
1284 | if (isNull(attrs.avatar_model)) { |
1285 | - this.avatar_model = 'res.partner'; |
1286 | + this.avatar_model = 'res.partner'; |
1287 | } |
1288 | else { |
1289 | if (attrs.avatar_model == 'False') { |
1290 | this.avatar_model = null; |
1291 | } |
1292 | - else { |
1293 | + else { |
1294 | this.avatar_model = attrs.avatar_model; |
1295 | } |
1296 | - } |
1297 | + } |
1298 | */ |
1299 | if (isNullOrUndef(attrs.avatar_model)) { |
1300 | - this.avatar_model = null; |
1301 | + this.avatar_model = null; |
1302 | } |
1303 | else { |
1304 | this.avatar_model = attrs.avatar_model; |
1305 | } |
1306 | - |
1307 | + |
1308 | if (isNullOrUndef(attrs.avatar_title)) { |
1309 | - this.avatar_title = this.avatar_model; |
1310 | + this.avatar_title = this.avatar_model; |
1311 | } |
1312 | else { |
1313 | this.avatar_title = attrs.avatar_title; |
1314 | } |
1315 | - |
1316 | + |
1317 | this.color_field = attrs.color; |
1318 | - |
1319 | + |
1320 | if (this.color_field && this.selected_filters.length === 0) { |
1321 | var default_filter; |
1322 | if ((default_filter = this.dataset.context['calendar_default_' + this.color_field])) { |
1323 | @@ -190,12 +190,12 @@ |
1324 | for (var fld = 0; fld < fv.arch.children.length; fld++) { |
1325 | this.info_fields.push(fv.arch.children[fld].attrs.name); |
1326 | } |
1327 | - |
1328 | + |
1329 | return (new instance.web.Model(this.dataset.model)) |
1330 | .call("check_access_rights", ["create", false]) |
1331 | .then(function (create_right) { |
1332 | self.create_right = create_right; |
1333 | - self.init_calendar().then(function() { |
1334 | + self.init_calendar().then(function() { |
1335 | self.trigger('calendar_view_loaded', fv); |
1336 | self.ready.resolve(); |
1337 | }); |
1338 | @@ -206,7 +206,7 @@ |
1339 | //Documentation here : http://arshaw.com/fullcalendar/docs/ |
1340 | var self = this; |
1341 | return $.extend({}, fc_defaultOptions, { |
1342 | - |
1343 | + |
1344 | defaultView: (this.mode == "month")?"month": |
1345 | (this.mode == "week"?"agendaWeek": |
1346 | (this.mode == "day"?"agendaDay":"month")), |
1347 | @@ -231,15 +231,15 @@ |
1348 | self.proxy('update_record')(event._id, data); |
1349 | }, |
1350 | eventRender: function (event, element, view) { |
1351 | - element.find('.fc-event-title').html(event.title); |
1352 | + element.find('.fc-event-title').html(event.title); |
1353 | }, |
1354 | - eventAfterRender: function (event, element, view) { |
1355 | + eventAfterRender: function (event, element, view) { |
1356 | if ((view.name !== 'month') && (((event.end-event.start)/60000)<=30)) { |
1357 | //if duration is too small, we see the html code of img |
1358 | var current_title = $(element.find('.fc-event-time')).text(); |
1359 | var new_title = current_title.substr(0,current_title.indexOf("<img")>0?current_title.indexOf("<img"):current_title.length) |
1360 | element.find('.fc-event-time').html(new_title); |
1361 | - } |
1362 | + } |
1363 | }, |
1364 | eventClick: function (event) { self.open_event(event._id,event.title); }, |
1365 | select: function (start_date, end_date, all_day, _js_event, _view) { |
1366 | @@ -272,7 +272,7 @@ |
1367 | weekNumbers: true, |
1368 | snapMinutes: 15, |
1369 | timeFormat : { |
1370 | - |
1371 | + |
1372 | // for agendaWeek and agendaDay |
1373 | agenda: 'h:mm{ - h:mm}', // 5:00 - 6:30 |
1374 | |
1375 | @@ -303,18 +303,18 @@ |
1376 | |
1377 | init_calendar: function() { |
1378 | var self = this; |
1379 | - |
1380 | + |
1381 | if (!this.sidebar && this.options.$sidebar) { |
1382 | this.sidebar = new instance.web_calendar.Sidebar(this); |
1383 | this.sidebar.appendTo(this.$el.find('.oe_calendar_sidebar_container')); |
1384 | |
1385 | this.$small_calendar = self.$el.find(".oe_calendar_mini"); |
1386 | this.$small_calendar.datepicker({ onSelect: self.calendarMiniChanged(self) }); |
1387 | - |
1388 | + |
1389 | if (this.useContacts) { |
1390 | new instance.web.Model("res.users").query(["partner_id"]).filter([["id", "=",this.dataset.context.uid]]).first() |
1391 | .done( |
1392 | - function(result) { |
1393 | + function(result) { |
1394 | var sidebar_items = {}; |
1395 | var filter_value = result.partner_id[0]; |
1396 | var filter_item = { |
1397 | @@ -343,22 +343,22 @@ |
1398 | }; |
1399 | sidebar_items[filter_value] = filter_item ; |
1400 | }); |
1401 | - |
1402 | + |
1403 | self.allFilters = sidebar_items; |
1404 | self.sidebar.filter.events_loaded(sidebar_items); |
1405 | self.sidebar.filter.addUpdateButton(); |
1406 | - }).done(function () { |
1407 | - self.$calendar.fullCalendar('refetchEvents'); |
1408 | + }).done(function () { |
1409 | + self.$calendar.fullCalendar('refetchEvents'); |
1410 | }); |
1411 | } |
1412 | - ); |
1413 | + ); |
1414 | }; |
1415 | this.extraSideBar(); |
1416 | - |
1417 | + |
1418 | } |
1419 | self.$calendar.fullCalendar(self.get_fc_init_options()); |
1420 | |
1421 | - |
1422 | + |
1423 | return $.when(); |
1424 | }, |
1425 | extraSideBar: function() { |
1426 | @@ -369,9 +369,9 @@ |
1427 | return this.quick.trigger('close'); |
1428 | } |
1429 | var QuickCreate = get_class(this.quick_create_instance); |
1430 | - |
1431 | + |
1432 | this.options.disable_quick_create = this.options.disable_quick_create || !this.quick_add_pop; |
1433 | - |
1434 | + |
1435 | this.quick = new QuickCreate(this, this.dataset, true, this.options, data_template); |
1436 | this.quick.on('added', this, this.quick_created) |
1437 | .on('slowadded', this, this.slow_created) |
1438 | @@ -382,7 +382,7 @@ |
1439 | }); |
1440 | this.quick.replace($(".oe_calendar_qc_placeholder")); |
1441 | this.quick.focus(); |
1442 | - |
1443 | + |
1444 | }, |
1445 | |
1446 | /** |
1447 | @@ -429,7 +429,7 @@ |
1448 | this.color_map[key] = index; |
1449 | return index; |
1450 | }, |
1451 | - |
1452 | + |
1453 | |
1454 | /** |
1455 | * In o2m case, records from dataset won't have names attached to their *2o values. |
1456 | @@ -479,7 +479,7 @@ |
1457 | }); |
1458 | return def; |
1459 | }, |
1460 | - |
1461 | + |
1462 | /** |
1463 | * Transform OpenERP event object to fullcalendar event object |
1464 | */ |
1465 | @@ -492,7 +492,7 @@ |
1466 | all_day = this.all_day ? evt[this.all_day] : false, |
1467 | res_computed_text = '', |
1468 | the_title = '', |
1469 | - attendees = []; |
1470 | + attendees = []; |
1471 | |
1472 | if (this.date_stop && this.fields[this.date_stop].type == 'date') { |
1473 | date_stop.addDay(1); |
1474 | @@ -501,7 +501,7 @@ |
1475 | if (this.info_fields) { |
1476 | var temp_ret = {}; |
1477 | res_computed_text = this.how_display_event; |
1478 | - |
1479 | + |
1480 | _.each(this.info_fields, function (fieldname) { |
1481 | var value = evt[fieldname]; |
1482 | if (_.contains(["many2one", "one2one"], self.fields[fieldname].type)) { |
1483 | @@ -530,57 +530,57 @@ |
1484 | temp_ret[fieldname] = value; |
1485 | } |
1486 | res_computed_text = res_computed_text.replace("["+fieldname+"]",temp_ret[fieldname]); |
1487 | - }); |
1488 | - |
1489 | - |
1490 | + }); |
1491 | + |
1492 | + |
1493 | if (res_computed_text.length) { |
1494 | the_title = res_computed_text; |
1495 | } |
1496 | else { |
1497 | var res_text= []; |
1498 | _.each(temp_ret, function(val,key) { res_text.push(val)} ); |
1499 | - the_title = res_text.join(', '); |
1500 | + the_title = res_text.join(', '); |
1501 | } |
1502 | the_title = _.escape(the_title); |
1503 | - |
1504 | - |
1505 | + |
1506 | + |
1507 | the_title_avatar = ''; |
1508 | - |
1509 | + |
1510 | if (! _.isUndefined(this.attendee_people)) { |
1511 | var MAX_ATTENDEES = 3; |
1512 | var attendee_showed = 0; |
1513 | var attendee_other = ''; |
1514 | |
1515 | - _.each(temp_ret[this.attendee_people], |
1516 | - function (the_attendee_people) { |
1517 | + _.each(temp_ret[this.attendee_people], |
1518 | + function (the_attendee_people) { |
1519 | attendees.push(the_attendee_people); |
1520 | attendee_showed += 1; |
1521 | - if (attendee_showed<= MAX_ATTENDEES) { |
1522 | + if (attendee_showed<= MAX_ATTENDEES) { |
1523 | if (self.avatar_model != null) { |
1524 | - the_title_avatar += '<img title="' + self.all_attendees[the_attendee_people] + '" class="attendee_head" src="/web/binary/image?model=' + self.avatar_model + '&field=image_small&id=' + the_attendee_people + '"></img>'; |
1525 | + the_title_avatar += '<img title="' + self.all_attendees[the_attendee_people] + '" class="attendee_head" src="/web/binary/image?model=' + self.avatar_model + '&field=image_small&id=' + the_attendee_people + '"></img>'; |
1526 | } |
1527 | else { |
1528 | if (!self.colorIsAttendee || the_attendee_people != temp_ret[self.color_field]) { |
1529 | - tempColor = (self.all_filters[the_attendee_people] != undefined) |
1530 | + tempColor = (self.all_filters[the_attendee_people] != undefined) |
1531 | ? self.all_filters[the_attendee_people].color |
1532 | : self.all_filters[-1].color; |
1533 | - |
1534 | - the_title_avatar += '<i class="fa fa-user attendee_head color_'+tempColor+'" title="' + self.all_attendees[the_attendee_people] + '" ></i>' |
1535 | + |
1536 | + the_title_avatar += '<i class="fa fa-user attendee_head color_'+tempColor+'" title="' + self.all_attendees[the_attendee_people] + '" ></i>' |
1537 | }//else don't add myself |
1538 | } |
1539 | } |
1540 | else { |
1541 | attendee_other += self.all_attendees[the_attendee_people] +", "; |
1542 | - } |
1543 | + } |
1544 | } |
1545 | ); |
1546 | if (attendee_other.length>2) { |
1547 | - the_title_avatar += '<span class="attendee_head" title="' + attendee_other.slice(0, -2) + '">+</span>'; |
1548 | + the_title_avatar += '<span class="attendee_head" title="' + attendee_other.slice(0, -2) + '">+</span>'; |
1549 | } |
1550 | the_title = the_title_avatar + the_title; |
1551 | - } |
1552 | + } |
1553 | } |
1554 | - |
1555 | + |
1556 | if (!date_stop && date_delay) { |
1557 | date_stop = date_start.clone().addHours(date_delay); |
1558 | } |
1559 | @@ -595,7 +595,7 @@ |
1560 | 'id': evt.id, |
1561 | 'attendees':attendees |
1562 | }; |
1563 | - |
1564 | + |
1565 | |
1566 | if (!self.useContacts || self.all_filters[evt[this.color_field]] != undefined) { |
1567 | if (this.color_field && evt[this.color_field]) { |
1568 | @@ -603,17 +603,17 @@ |
1569 | if (typeof color_key === "object") { |
1570 | color_key = color_key[0]; |
1571 | } |
1572 | - r.className = 'cal_opacity calendar_color_'+ this.get_color(color_key); |
1573 | + r.className = 'cal_opacity calendar_color_'+ this.get_color(color_key); |
1574 | } |
1575 | } |
1576 | else { // if form all, get color -1 |
1577 | |
1578 | r.className = 'cal_opacity calendar_color_'+ self.all_filters[-1].color; |
1579 | } |
1580 | - |
1581 | + |
1582 | return r; |
1583 | }, |
1584 | - |
1585 | + |
1586 | /** |
1587 | * Transform fullcalendar event object to OpenERP Data object |
1588 | */ |
1589 | @@ -623,10 +623,10 @@ |
1590 | var data = { |
1591 | name: event.title |
1592 | }; |
1593 | - |
1594 | - |
1595 | + |
1596 | + |
1597 | var event_end = event.end; |
1598 | - //Bug when we move an all_day event from week or day view, we don't have a dateend or duration... |
1599 | + //Bug when we move an all_day event from week or day view, we don't have a dateend or duration... |
1600 | if (event_end == null) { |
1601 | event_end = new Date(event.start).addHours(2); |
1602 | } |
1603 | @@ -637,32 +637,32 @@ |
1604 | event_end = new Date(event.start); |
1605 | } |
1606 | if (this.all_day) { |
1607 | - event_end = (new Date(event_end.getTime())).addDays(1); |
1608 | + event_end = (new Date(event_end.getTime())).addDays(1); |
1609 | date_start_day = new Date(Date.UTC(event.start.getFullYear(),event.start.getMonth(),event.start.getDate())) |
1610 | - date_stop_day = new Date(Date.UTC(event_end.getFullYear(),event_end.getMonth(),event_end.getDate())) |
1611 | + date_stop_day = new Date(Date.UTC(event_end.getFullYear(),event_end.getMonth(),event_end.getDate())) |
1612 | } |
1613 | else { |
1614 | date_start_day = new Date(Date.UTC(event.start.getFullYear(),event.start.getMonth(),event.start.getDate(),7)) |
1615 | - date_stop_day = new Date(Date.UTC(event_end.getFullYear(),event_end.getMonth(),event_end.getDate(),19)) |
1616 | - } |
1617 | + date_stop_day = new Date(Date.UTC(event_end.getFullYear(),event_end.getMonth(),event_end.getDate(),19)) |
1618 | + } |
1619 | data[this.date_start] = instance.web.parse_value(date_start_day, this.fields[this.date_start]); |
1620 | if (this.date_stop) { |
1621 | data[this.date_stop] = instance.web.parse_value(date_stop_day, this.fields[this.date_stop]); |
1622 | } |
1623 | - |
1624 | + |
1625 | } |
1626 | else { |
1627 | - |
1628 | + |
1629 | data[this.date_start] = instance.web.parse_value(event.start, this.fields[this.date_start]); |
1630 | if (this.date_stop) { |
1631 | data[this.date_stop] = instance.web.parse_value(event_end, this.fields[this.date_stop]); |
1632 | - } |
1633 | + } |
1634 | |
1635 | } |
1636 | |
1637 | |
1638 | if (this.all_day) { |
1639 | - data[this.all_day] = event.allDay; |
1640 | + data[this.all_day] = event.allDay; |
1641 | } |
1642 | |
1643 | if (this.date_delay) { |
1644 | @@ -689,28 +689,28 @@ |
1645 | return; |
1646 | } |
1647 | // We should make sure that *2many used in title of event have their extended form [ID, NAME]... |
1648 | - |
1649 | + |
1650 | events = $.map(events, function (e) { |
1651 | - |
1652 | + |
1653 | if (self.attendee_people != undefined) { //If we filter on contacts... |
1654 | if (_.intersection(self.selected_filters,e[self.attendee_people]).length || (self.selected_filters.indexOf(-1) > -1)) { |
1655 | return e; |
1656 | } |
1657 | else { |
1658 | return null; |
1659 | - } |
1660 | + } |
1661 | } |
1662 | - else { //We adds all events |
1663 | + else { //We adds all events |
1664 | return e; |
1665 | - } |
1666 | - return null; |
1667 | + } |
1668 | + return null; |
1669 | }); |
1670 | - |
1671 | + |
1672 | if (!self.useContacts) { // If we use all peoples as filter in sidebars |
1673 | var now_filters = {}; |
1674 | var filter_value; |
1675 | var filter_item; |
1676 | - |
1677 | + |
1678 | _.each(events, function (e) { |
1679 | filter_value = e[self.color_field][0]; |
1680 | filter_item = { |
1681 | @@ -723,42 +723,42 @@ |
1682 | now_filters[e[self.color_field][0]] = filter_item; |
1683 | } |
1684 | }); |
1685 | - |
1686 | + |
1687 | self.allFilters = now_filters; |
1688 | - self.sidebar.filter.events_loaded(now_filters); |
1689 | - |
1690 | + self.sidebar.filter.events_loaded(now_filters); |
1691 | + |
1692 | return self.perform_necessary_name_gets(events).then(callback); |
1693 | } |
1694 | else { |
1695 | var all_attendees = []; |
1696 | - |
1697 | + |
1698 | _.each(events, function (e) { |
1699 | - all_attendees.push(e[self.attendee_people]); |
1700 | + all_attendees.push(e[self.attendee_people]); |
1701 | }); |
1702 | - |
1703 | + |
1704 | self.all_attendees = {} |
1705 | - |
1706 | + |
1707 | all_attendees = _.chain(all_attendees).flatten().uniq().value(); |
1708 | - |
1709 | + |
1710 | if (self.avatar_title != null) { |
1711 | new instance.web.Model(self.avatar_title).query(["name"]).filter([["id", "in",all_attendees]]).all().then(function(result) { |
1712 | _.each(result, function(item) { |
1713 | self.all_attendees[item.id] = item.name; |
1714 | }); |
1715 | - }).done(function() { |
1716 | + }).done(function() { |
1717 | return self.perform_necessary_name_gets(events).then(callback); |
1718 | }); |
1719 | - } |
1720 | + } |
1721 | else { |
1722 | _.each(all_attendees,function(item){ |
1723 | self.all_attendees[item] = ''; |
1724 | }); |
1725 | return self.perform_necessary_name_gets(events).then(callback); |
1726 | - |
1727 | + |
1728 | } |
1729 | - |
1730 | + |
1731 | } |
1732 | - |
1733 | + |
1734 | |
1735 | }); |
1736 | }, |
1737 | @@ -805,11 +805,11 @@ |
1738 | }, |
1739 | open_event: function(id,title) { |
1740 | var self = this; |
1741 | - if (! this.open_popup_action) { |
1742 | + if (! this.open_popup_action) { |
1743 | var index = this.dataset.get_id_index(id); |
1744 | this.dataset.index = index; |
1745 | this.do_switch_view('form', null, { mode: "edit" }); |
1746 | - } |
1747 | + } |
1748 | else { |
1749 | |
1750 | var self = this; |
1751 | @@ -822,26 +822,26 @@ |
1752 | res_id: id, |
1753 | target: 'new', |
1754 | readonly:true |
1755 | - }); |
1756 | + }); |
1757 | |
1758 | var form_controller = pop.view_form; |
1759 | form_controller.on("load_record", self, function(){ |
1760 | button_delete = _.str.sprintf("<button class='oe_button oe_bold delme'><span> %s </span></button>",_t("Delete")); |
1761 | button_edit = _.str.sprintf("<button class='oe_button oe_bold editme oe_highlight'><span> %s </span></button>",_t("Edit Event")); |
1762 | - |
1763 | - |
1764 | + |
1765 | + |
1766 | pop.$el.closest(".ui-dialog").find(".ui-dialog-buttonpane").prepend(button_delete) |
1767 | pop.$el.closest(".ui-dialog").find(".ui-dialog-buttonpane").prepend(button_edit) |
1768 | - |
1769 | + |
1770 | $('.delme').click( |
1771 | - function() { |
1772 | - $('.oe_form_button_cancel').trigger('click'); |
1773 | - self.remove_event(id); |
1774 | + function() { |
1775 | + $('.oe_form_button_cancel').trigger('click'); |
1776 | + self.remove_event(id); |
1777 | } |
1778 | ); |
1779 | $('.editme').click( |
1780 | - function() { |
1781 | - $('.oe_form_button_cancel').trigger('click'); |
1782 | + function() { |
1783 | + $('.oe_form_button_cancel').trigger('click'); |
1784 | |
1785 | var index = self.dataset.get_id_index(id); |
1786 | self.dataset.index = index; |
1787 | @@ -849,14 +849,14 @@ |
1788 | |
1789 | } |
1790 | ); |
1791 | - |
1792 | - |
1793 | + |
1794 | + |
1795 | }); |
1796 | - |
1797 | - } |
1798 | - |
1799 | - return false; |
1800 | - |
1801 | + |
1802 | + } |
1803 | + |
1804 | + return false; |
1805 | + |
1806 | }, |
1807 | |
1808 | do_show: function() { |
1809 | @@ -931,9 +931,9 @@ |
1810 | */ |
1811 | instance.web_calendar.QuickCreate = instance.web.Widget.extend({ |
1812 | template: 'CalendarView.quick_create', |
1813 | - |
1814 | + |
1815 | init: function(parent, dataset, buttons, options, data_template) { |
1816 | - this._super(parent); |
1817 | + this._super(parent); |
1818 | this.dataset = dataset; |
1819 | this._buttons = buttons || false; |
1820 | this.options = options; |
1821 | @@ -965,23 +965,23 @@ |
1822 | if(event.keyCode == 13){ |
1823 | self.$input.off('keyup', enterHandler); |
1824 | if (!self.quick_add()){ |
1825 | - self.$input.on('keyup', enterHandler); |
1826 | + self.$input.on('keyup', enterHandler); |
1827 | } |
1828 | } |
1829 | }); |
1830 | - |
1831 | + |
1832 | var submit = this.$el.find(".oe_calendar_quick_create_add"); |
1833 | submit.click(function clickHandler() { |
1834 | submit.off('click', clickHandler); |
1835 | if (!self.quick_add()){ |
1836 | - submit.on('click', clickHandler); |
1837 | + submit.on('click', clickHandler); |
1838 | } |
1839 | self.focus(); |
1840 | }); |
1841 | this.$el.find(".oe_calendar_quick_create_edit").click(function () { |
1842 | self.slow_add(); |
1843 | self.focus(); |
1844 | - }); |
1845 | + }); |
1846 | this.$el.find(".oe_calendar_quick_create_close").click(function (ev) { |
1847 | ev.preventDefault(); |
1848 | self.trigger('close'); |
1849 | @@ -995,7 +995,7 @@ |
1850 | self.on('added', self, function() { |
1851 | self.trigger('close'); |
1852 | }); |
1853 | - |
1854 | + |
1855 | self.$el.on('dialogclose', self, function() { |
1856 | console.log("dialogclose"); |
1857 | self.trigger('close'); |
1858 | @@ -1011,12 +1011,12 @@ |
1859 | */ |
1860 | quick_add: function() { |
1861 | var val = this.$input.val(); |
1862 | - if (/^\s*$/.test(val)) { |
1863 | - return false; |
1864 | + if (/^\s*$/.test(val)) { |
1865 | + return false; |
1866 | } |
1867 | return this.quick_create({'name': val}).always(function() { return true }); |
1868 | }, |
1869 | - |
1870 | + |
1871 | slow_add: function() { |
1872 | var val = this.$input.val(); |
1873 | this.slow_create({'name': val}); |
1874 | @@ -1059,7 +1059,7 @@ |
1875 | _.each($.extend({}, this.data_template, data), function(val, field_name) { |
1876 | defaults['default_' + field_name] = val; |
1877 | }); |
1878 | - |
1879 | + |
1880 | if (defaults['default_allday'] && (defaults['default_date_deadline'] || defaults['default_duration'])) { |
1881 | delete defaults['default_date_deadline']; |
1882 | delete defaults['default_duration']; |
1883 | @@ -1092,7 +1092,7 @@ |
1884 | }); |
1885 | pop.on('closed', self, function() { |
1886 | // ``self.trigger('close')`` would itself destroy all child element including |
1887 | - // the slow create popup, which would then re-trigger recursively the 'closed' signal. |
1888 | + // the slow create popup, which would then re-trigger recursively the 'closed' signal. |
1889 | // Thus, here, we use a deferred and its state to cut the endless recurrence. |
1890 | if (def.state() === "pending") { |
1891 | def.resolve(); |
1892 | @@ -1310,8 +1310,8 @@ |
1893 | $.async_when().done(function () { |
1894 | self.calendar_view.appendTo(self.$el); |
1895 | }); |
1896 | - |
1897 | - |
1898 | + |
1899 | + |
1900 | return loaded; |
1901 | }, |
1902 | |
1903 | @@ -1369,7 +1369,7 @@ |
1904 | |
1905 | instance.web_calendar.Sidebar = instance.web.Widget.extend({ |
1906 | template: 'CalendarView.sidebar', |
1907 | - |
1908 | + |
1909 | start: function() { |
1910 | this._super(); |
1911 | this.filter = new instance.web_calendar.SidebarFilter(this, this.getParent()); |
1912 | @@ -1382,14 +1382,14 @@ |
1913 | }, |
1914 | init: function(parent, view) { |
1915 | this._super(parent); |
1916 | - this.view = view; |
1917 | + this.view = view; |
1918 | }, |
1919 | events_loaded: function(filters) { |
1920 | var self = this; |
1921 | self.selected_filters = []; |
1922 | self.view.all_filters = filters; |
1923 | this.$el.html(QWeb.render('CalendarView.sidebar.responsible', { filters: filters })); |
1924 | - this.filter_click(null); |
1925 | + this.filter_click(null); |
1926 | }, |
1927 | filter_click: function(e) { |
1928 | var self = this, |
1929 | @@ -1397,29 +1397,29 @@ |
1930 | self.view.selected_filters = []; |
1931 | this.$('div.oe_calendar_responsible input:checked').each(function() { |
1932 | responsibles.push($(this).val()); |
1933 | - |
1934 | + |
1935 | if (e==null && parseInt($(this).val())<0) { |
1936 | $(this).prop('checked',false); |
1937 | return; |
1938 | - } |
1939 | + } |
1940 | self.view.selected_filters.push(parseInt($(this).val())); |
1941 | }); |
1942 | - |
1943 | - if (e !== null) { //First intialize |
1944 | - self.view.$calendar.fullCalendar('refetchEvents'); |
1945 | + |
1946 | + if (e !== null) { //First intialize |
1947 | + self.view.$calendar.fullCalendar('refetchEvents'); |
1948 | } |
1949 | |
1950 | - |
1951 | + |
1952 | }, |
1953 | addUpdateButton: function() { |
1954 | var self=this; |
1955 | this.$('div.oe_calendar_all_responsibles').append(QWeb.render('CalendarView.sidebar.button_add_contact')); |
1956 | - this.$(".add_contacts_link_btn").on('click', function() { |
1957 | - self.rpc("/web/action/load", { |
1958 | - action_id: "calendar.action_calendar_contacts" |
1959 | + this.$(".add_contacts_link_btn").on('click', function() { |
1960 | + self.rpc("/web/action/load", { |
1961 | + action_id: "calendar.action_calendar_contacts" |
1962 | }).then( function(result) { return self.do_action(result); }); |
1963 | }); |
1964 | - |
1965 | + |
1966 | }, |
1967 | }); |
1968 | |
1969 | |
1970 | === modified file 'addons/web_diagram/static/src/js/diagram.js' |
1971 | --- addons/web_diagram/static/src/js/diagram.js 2012-12-13 14:09:14 +0000 |
1972 | +++ addons/web_diagram/static/src/js/diagram.js 2014-02-03 18:22:10 +0000 |
1973 | @@ -181,7 +181,6 @@ |
1974 | var graph = new CuteGraph(r,style,canvas.parentNode); |
1975 | |
1976 | var confirm_dialog = $('#dialog').dialog({ |
1977 | - autoOpen: false, |
1978 | title: _t("Are you sure?") }); |
1979 | |
1980 | |
1981 | @@ -344,7 +343,7 @@ |
1982 | }); |
1983 | // We want to destroy the dummy edge after a creation cancel. This destroys it even if we save the changes. |
1984 | // This is not a problem since the diagram is completely redrawn on saved changes. |
1985 | - pop.$el.bind("dialogbeforeclose",function(){ |
1986 | + pop.$el.parents('.modal').on('hidden.bs.modal', function (e){ |
1987 | if(dummy_cuteedge){ |
1988 | dummy_cuteedge.remove(); |
1989 | } |
1990 | |
1991 | === modified file 'addons/web_view_editor/static/src/js/view_editor.js' |
1992 | --- addons/web_view_editor/static/src/js/view_editor.js 2013-04-05 08:52:24 +0000 |
1993 | +++ addons/web_view_editor/static/src/js/view_editor.js 2014-02-03 18:22:10 +0000 |
1994 | @@ -58,7 +58,7 @@ |
1995 | }; |
1996 | this.view_edit_dialog = new instance.web.Dialog(this, { |
1997 | title: action_title, |
1998 | - width: 850, |
1999 | + layout:{ 'width': 850, 'right': 135 }, |
2000 | buttons: [ |
2001 | {text: _t("Create"), click: function() { self.on_create_view(); }}, |
2002 | {text: _t("Edit"), click: function() { self.xml_element_id = 0; self.get_arch(); }}, |
2003 | @@ -66,7 +66,7 @@ |
2004 | {text: _t("Close"), click: function() { self.view_edit_dialog.close(); window.location.reload(); }} |
2005 | ] |
2006 | }).open(); |
2007 | - this.view_edit_dialog.on("closing", this, function(){window.location.reload();}); |
2008 | + this.view_edit_dialog.$el.parents('.modal').on("hidden.bs.modal", function(){window.location.reload();}); |
2009 | this.main_view_id = this.parent.fields_view.view_id; |
2010 | this.action_manager = new instance.web.ActionManager(this); |
2011 | this.action_manager.appendTo(this.view_edit_dialog.$el); |
2012 | @@ -378,7 +378,7 @@ |
2013 | this.one_object = one_object; |
2014 | this.edit_xml_dialog = new instance.web.Dialog(this, { |
2015 | title: _.str.sprintf(_t("View Editor %d - %s"), self.main_view_id, self.model), |
2016 | - height: '90%', |
2017 | + layout: { 'max_height': '90%' }, |
2018 | buttons: [ |
2019 | {text: _t("Inherited View"), click: function(){ |
2020 | var selected_row = self.edit_xml_dialog.$el.find('.ui-selected'); |
2021 | @@ -831,7 +831,7 @@ |
2022 | var self = this; |
2023 | this.edit_node_dialog = new instance.web.Dialog(this,{ |
2024 | title: _t("Properties"), |
2025 | - width: 450, |
2026 | + layout: { 'width': 450 }, |
2027 | buttons: [ |
2028 | {text: _t("Update"), click: function () { |
2029 | var warn = false, update_values = []; |
2030 | @@ -957,7 +957,7 @@ |
2031 | this.add_widget = []; |
2032 | this.add_node_dialog = new instance.web.Dialog(this,{ |
2033 | title: _t("Properties"), |
2034 | - width: 450, |
2035 | + layout: { 'width': 450 }, |
2036 | buttons: [ |
2037 | {text: _t("Update"), click: function() { |
2038 | var check_add_node = true, values = {}; |
branch refactored in lp:~openerp-dev/openerp-web/trunk-bootstrap-modal-csn
merged in trunk at web revision 3972
Thanks