diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index b3082126142..2714925583b 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -1,4 +1,4 @@ -@charset "utf-8"; +@charset "UTF-8"; @font-face { font-family: "mnmliconsRegular"; src: url("/web/static/src/font/mnmliconsv21-webfont.eot") format("eot"); @@ -9,6 +9,17 @@ font-style: normal; } +@font-face { + font-family: "EntypoRegular"; + src: url("/web/static/src/font/entypo-webfont.eot") format("eot"); + src: url("/web/static/src/font/entypo-webfont.eot?#iefix") format("embedded-opentype"); + src: url("/web/static/src/font/entypo-webfont.woff") format("woff"); + src: url("/web/static/src/font/entypo-webfont.ttf") format("truetype"); + src: url("/web/static/src/font/entypo-webfont.svg") format("svg") active; + font-weight: normal; + font-style: normal; +} + .openerp.openerp-web-client-container { height: 100%; position: relative; @@ -93,6 +104,11 @@ font-size: 21px; font-weight: 300 !important; } +.openerp .oe_e { + font-family: "entypoRegular" !important; + font-size: 34px; + font-weight: 300 !important; +} .openerp .oe_left { float: left; margin-right: 8px; @@ -107,6 +123,12 @@ .openerp .oe_wait { cursor: wait; } +.openerp .oe_fade { + color: #888888; +} +.openerp .oe_bold { + font-weight: bold; +} .openerp a.button:link, .openerp a.button:visited, .openerp button, .openerp input[type='submit'] { display: inline-block; border: 1px solid #ababab; @@ -426,7 +448,6 @@ width: 100%; height: 31px; border-top: solid 1px #d3d3d3; - border-bottom: solid 1px black; background-color: #646060; background-image: -webkit-gradient(linear, left top, left bottom, from(#646060), to(#262626)); background-image: -webkit-linear-gradient(top, #646060, #262626); @@ -435,13 +456,6 @@ background-image: -o-linear-gradient(top, #646060, #262626); background-image: linear-gradient(to bottom, #646060, #262626); } -.openerp .oe_topbar .oe_systray { - float: right; -} -.openerp .oe_topbar .oe_systray > div { - float: left; - padding: 0 4px 0 4px; -} .openerp .oe_topbar .oe_topbar_item li { float: left; } @@ -500,6 +514,7 @@ background: #f0eeee; border-right: 1px solid #afafb6; text-shadow: 0 1px 1px white; + padding-bottom: 16px; } .openerp a.oe_logo { width: 220px; @@ -596,6 +611,72 @@ -webkit-box-shadow: none; -box-shadow: none; } +.openerp .oe_user_menu .oe_dropdown_options li hr { + border-top: 1px solid #999999; + border-bottom: 0; +} +.openerp .oe_systray > div { + float: left; + padding: 0 4px 0 4px; +} +.openerp .oe_systray { + float: right; +} +.openerp .oe_systray .oe_systray_dropdown { + position: relative; +} +.openerp .oe_systray .oe_systray_dropdown:hover .oe_systray_dropdown_options { + display: block; +} +.openerp .oe_systray .oe_systray_dropdown_options { + background: #333333; + background: rgba(37, 37, 37, 0.9); + display: none; + position: absolute; + z-index: 900; + border: 0; + margin-left: 0; + margin-right: 0; + padding: 6px 0; + border-color: #999999; + border-color: rgba(0, 0, 0, 0.2); + border-style: solid; + border-width: 0 1px 1px; + -moz-border-radius: 0 0 6px 6px; + -webkit-border-radius: 0 0 6px 6px; + border-radius: 0 0 6px 6px; + -moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); + -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); + -box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); + -webkit-background-clip: padding-box; + -moz-background-clip: padding-box; + background-clip: padding-box; +} +.openerp .oe_systray .oe_systray_dropdown_options li { + float: none; + display: block; + background-color: none; +} +.openerp .oe_systray .oe_systray_dropdown_options li a { + display: block; + padding: 4px 15px; + clear: both; + font-weight: normal; + line-height: 18px; + color: #eeeeee; +} +.openerp .oe_systray .oe_systray_dropdown_options li a:hover { + background-color: #292929; + background-image: -webkit-gradient(linear, left top, left bottom, from(#292929), to(#191919)); + background-image: -webkit-linear-gradient(top, #292929, #191919); + background-image: -moz-linear-gradient(top, #292929, #191919); + background-image: -ms-linear-gradient(top, #292929, #191919); + background-image: -o-linear-gradient(top, #292929, #191919); + background-image: linear-gradient(to bottom, #292929, #191919); + -moz-box-shadow: none; + -webkit-box-shadow: none; + -box-shadow: none; +} .openerp .oe_menu { float: left; padding: 0; @@ -657,16 +738,16 @@ width: 100%; display: inline-block; } -.openerp .oe_secondary_submenu li { +.openerp .oe_secondary_submenu > li { position: relative; - padding: 1px 0 1px 16px; + padding: 1px 0 1px 20px; } -.openerp .oe_secondary_submenu li a { +.openerp .oe_secondary_submenu > li a { display: block; color: #4c4c4c; padding: 2px 4px 2px 0; } -.openerp .oe_secondary_submenu li .oe_menu_label { +.openerp .oe_secondary_submenu > li .oe_menu_label { position: absolute; top: 1px; right: 1px; @@ -728,7 +809,7 @@ content: "&darr"; text-indent: -99999px; vertical-align: top; - margin-left: -8px; + margin-left: -12px; margin-top: 4px; margin-right: 4px; border-top: 4px solid transparent; @@ -739,7 +820,7 @@ } .openerp .oe_secondary_submenu .oe_menu_opened:before { margin-top: 6px; - margin-left: -12px; + margin-left: -16px; margin-right: 4px; border-left: 4px solid transparent; border-right: 4px solid transparent; @@ -844,7 +925,7 @@ color: white; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4); } -.openerp .oe_view_manager_header2 { +.openerp .oe_view_manager_header { width: 100%; border-top: 1px solid #cacaca; border-bottom: 1px solid #cacaca; @@ -859,54 +940,74 @@ -webkit-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4), 0 0 9px rgba(0, 0, 0, 0.1); -box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4), 0 0 9px rgba(0, 0, 0, 0.1); } -.openerp .oe_view_manager_header2 h2 { - float: left; - font-size: 18px; - margin: 1px 0; +.openerp .oe_view_manager_header .oe_header_row { + clear: both; + text-shadow: 0 1px 1px white; } -.openerp .oe_view_manager_header2 h2 a { - color: #8a89ba; +.openerp .oe_view_manager_header .oe_header_row td { + padding: 8px; } -.openerp .oe_view_manager_header2 td { - padding: 4px 8px; +.openerp .oe_view_manager_header .oe_header_row:last-child td { + padding-top: 0; +} +.openerp .oe_view_manager_header .oe_header_row:first-child td { + padding-top: 8px; +} +.openerp .oe_view_manager_header .oe_view_manager_sidebar { + margin: 0px auto; + width: 400px; + text-align: center; +} +.openerp .oe_view_manager_header td { line-height: 26px; } -.openerp .oe_view_manager_header2 .oe_button_group { +.openerp .oe_view_manager_header h2 { + font-size: 18px; + margin: 0; + float: left; +} +.openerp .oe_view_manager_header h2 a { + color: #8a89ba; +} +.openerp .oe_view_manager_header .oe_button_group { display: inline-block; border: 1px solid #ababab; -moz-border-radius: 5px; -webkit-border-radius: 5px; border-radius: 5px; } -.openerp .oe_view_manager_header2 .oe_button_group li { +.openerp .oe_view_manager_header .oe_button_group li { float: left; border-right: 1px solid #ababab; } -.openerp .oe_view_manager_header2 .oe_button_group li:last-child { +.openerp .oe_view_manager_header .oe_button_group li:last-child { border: none; } -.openerp .oe_view_manager_header2 .oe_button_group a { +.openerp .oe_view_manager_header .oe_button_group a { color: #4c4c4c; } -.openerp .oe_view_manager_header2 .oe_button_group a:hover { +.openerp .oe_view_manager_header .oe_button_group a:hover { text-decoration: none; } -.openerp .oe_view_manager_header2 .oe_button_group .active { +.openerp .oe_view_manager_header .oe_button_group .active { background: #999999; -moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3) inset; -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3) inset; -box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3) inset; } -.openerp .oe_view_manager_header2 .oe_button_group .active a { +.openerp .oe_view_manager_header .oe_button_group .active a { color: white; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4); } -.openerp .oe_view_manager_header2 .oe_view_manager_buttons { +.openerp .oe_view_manager_header .oe_view_manager_buttons { white-space: nowrap; } .openerp .oe_view_manager_body h4 { margin: 8px 0; } +.openerp .oe_view_manager_pager { + line-height: 26px; +} .openerp .oe_pager_value { float: left; margin-right: 8px; @@ -950,34 +1051,41 @@ text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4); } .openerp .oe_view_manager_switch li { - padding-left: 1px; text-align: center; width: 24px; height: 24px; - line-height: 24px; + line-height: 16px; +} +.openerp .oe_view_manager_switch li a { + position: relative; } .openerp .oe_view_manager_switch .oe_vm_switch_list:after, .openerp .oe_view_manager_switch .oe_vm_switch_tree:after { - content: "ö"; + padding: 2px; + content: "i"; } .openerp .oe_view_manager_switch .oe_vm_switch_graph:after { - content: "ó"; + font-family: "mnmliconsRegular" !important; + font-size: 21px; + font-weight: 300 !important; + content: "}"; + top: -2px; + position: relative; } .openerp .oe_view_manager_switch .oe_vm_switch_gantt:after { - content: "y"; + content: "c"; } .openerp .oe_view_manager_switch .oe_vm_switch_calendar:after { - content: "b"; + content: "P"; } .openerp .oe_view_manager_switch .oe_vm_switch_kanban:after { - content: "ó"; + content: "k"; } .openerp .oe_view_manager_switch .oe_vm_switch_diagram:after { - content: "}"; + content: "f"; } .openerp .oe_form_dropdown_section { position: relative; display: inline-block; - margin-right: 4px; } .openerp .oe_dropdown_toggle:after { width: 0; @@ -1028,6 +1136,7 @@ line-height: 14px; color: #4c4c4c; text-decoration: none; + cursor: pointer; } .openerp .oe_dropdown_menu li a:hover { text-decoration: none; @@ -1051,18 +1160,28 @@ } .openerp .oe_searchview .VS-search .VS-search-box { min-height: 0; - border-width: 1px; padding: 0; - width: 410px; + width: 480px; + border: 1px solid #ababab; + -moz-border-radius: 13px; + -webkit-border-radius: 13px; + border-radius: 13px; + -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) inset; + -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) inset; + -box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) inset; } .openerp .oe_searchview .VS-search .VS-icon { - top: 5px; + top: 6px; } .openerp .oe_searchview .VS-search .VS-icon-search { - left: 5px; + left: 2px; + top: 3px; + height: 18px; + width: 18px; } .openerp .oe_searchview .VS-search .VS-search-inner { margin: 0 40px 0 17px; + padding: 1px 0; font-size: 13px; } .openerp .oe_searchview .VS-search .VS-search-inner input { @@ -1080,7 +1199,6 @@ height: 22px; } .openerp .oe_searchview .VS-search .VS-search-inner .search_input input, .openerp .oe_searchview .VS-search .VS-search-inner .search_input .VS-input-width-tester { - padding: 0 2px; height: inherit; margin: 0; } @@ -1140,11 +1258,23 @@ height: 100%; line-height: 23px; padding: 0 7px 0 4px; - color: #cccccc; + color: #4c4c4c; cursor: pointer; } .openerp .oe_searchview .VS-search .oe_vs_unfold_drawer:before { - content: "▾"; + position: absolute; + top: 9px; + right: 8px; + width: 0; + height: 0; + display: inline-block; + content: ""; + vertical-align: top; + border-top: 5px solid #4c4c4c; + border-left: 5px solid transparent; + border-right: 5px solid transparent; + filter: alpha(opacity=50); + opacity: 0.5; } .openerp .oe_searchview.oe_searchview_open_drawer .oe_searchview_drawer { display: block; @@ -1155,7 +1285,7 @@ top: 100%; right: 0; background-color: white; - width: 410px; + width: 480px; display: none; border: 1px solid #cccccc; text-align: left; @@ -1221,6 +1351,15 @@ .openerp .oe_searchview .oe_searchview_drawer .oe_searchview_advanced.oe_opened div { display: block; } +.openerp .oe_view_nocontent > img { + float: left; + margin-right: 1.5em; +} +.openerp .oe_view_nocontent > div { + overflow: hidden; + padding: 6px; + font-size: 125%; +} .openerp .oe_view_topbar { border-bottom: 1px solid #cacaca; background-color: #fcfcfc; @@ -1275,7 +1414,7 @@ line-height: 24px; vertical-align: top; padding: 0 10px; - margin: 3px 0; + margin: 3px 4px 3px 0; } .openerp .oe_form_topbar button span.i { line-height: 20px; @@ -1326,9 +1465,28 @@ font-weight: bold; color: #b33630; } +.openerp .oe_form_topbar.oe_form_topbar_hifirst button:first-child, .openerp button.oe_form_button_hi { + color: white; + background: #dc5f59; + background: -moz-linear-gradient(#dc5f59, #b33630); + background: -webkit-gradient(linear, left top, left bottom, from(#dc5f59), to(#b33630)); + background: -webkit-linear-gradient(#dc5f59, #b33630); + -moz-box-shadow: none; + -webkit-box-shadow: none; + -box-shadow: none; +} +.openerp .oe_form_topbar.oe_form_topbar_hifirst button:first-child:hover, .openerp button.oe_form_button_hi:hover { + background: #df6b66; + background: -moz-linear-gradient(#df6b66, #bf3a33); + background: -webkit-gradient(linear, left top, left bottom, from(#df6b66), to(#bf3a33)); + background: -webkit-linear-gradient(#df6b66, #bf3a33); + -moz-box-shadow: 0 0 1px rgba(0, 0, 0, 0.2); + -webkit-box-shadow: 0 0 1px rgba(0, 0, 0, 0.2); + -box-shadow: 0 0 1px rgba(0, 0, 0, 0.2); +} .openerp .oe_application .oe_form_sheetbg { background: url(/web/static/src/img/form_sheetbg.png); - padding: 8px; + padding: 8px 0; border-bottom: 1px solid #dddddd; } .openerp .oe_application .oe_form_sheet_width { @@ -1346,12 +1504,12 @@ -box-shadow: 0 0 10px rgba(0, 0, 0, 0.3); } .openerp .oe_form_autolayout .oe_button { - height: 22px; + height: 20px; } .openerp .oe_form_autolayout .oe_form_group_cell { line-height: 18px; padding: 2px; - height: 25px; + height: 20px; } .openerp .oe_form_autolayout .oe_form_group_cell > .oe_form_field_many2one, .openerp .oe_form_autolayout .oe_form_group_cell > .oe_form_field_many2one input, @@ -1427,11 +1585,22 @@ .openerp .oe_form select[readonly], .openerp .oe_form textarea[readonly], .openerp .oe_form input[disabled], -.openerp .oe_form select[disabled], -.openerp .oe_form textarea[disabled] { +.openerp .oe_form select[disabled] { background: #e5e5e5 !important; color: #666666; } +.openerp .oe_form textarea[disabled] { + border: none; + border-left: 8px solid #eeeeee; + padding-left: 8px; + -moz-box-shadow: none; + -webkit-box-shadow: none; + -box-shadow: none; + -moz-border-radius: 0px; + -webkit-border-radius: 0px; + border-radius: 0px; + color: #666666; +} .openerp .oe_form .oe_form_field_many2one input, .openerp .oe_form .oe_form_field_binary input, .openerp .oe_form .oe_form_field_binary input, @@ -1521,6 +1690,10 @@ right: 5px; top: 3px; } +.openerp .oe_form .oe_form_button > img { + vertical-align: -3px; + padding: 0 2px; +} .openerp .oe_form .oe-binary-file-set { overflow: hidden; position: relative; @@ -1542,10 +1715,8 @@ } .openerp .oe_horizontal_separator { font-weight: bold; - border: 0 solid #666666; - border-bottom-width: 1px; - margin: 3px 4px 3px 1px; - height: 17px; + font-size: 16px; + margin: 4px 0; } .openerp .oe_horizontal_separator:empty { height: 5px; @@ -1647,9 +1818,13 @@ height: auto; line-height: 16px; } +.openerp .oe-select-create-popup-view-form > .oe_formview > .oe_form_pager { + display: none; +} .openerp .oe_form .oe_form_title, .openerp .oe_form .oe_form_title input { font-size: 20px; font-weight: bold; + height: 30px; } .openerp .oe_form .oe_form_group_odd_border > tbody > tr.oe_form_group_row > td.oe_form_group_cell:nth-child(odd), .openerp .oe_form .oe_form_group_label_border > tbody > tr.oe_form_group_row > td.oe_form_group_cell_label { @@ -1664,83 +1839,33 @@ .openerp .oe_form .oe_form_group_label_border > tbody > tr.oe_form_group_row > td.oe_form_group_cell { padding: 2px 2px 2px 8px !important; } -.openerp .oe_listview_nocontent > img { - float: left; - margin-right: 1.5em; -} -.openerp .oe_listview_nocontent > div { - overflow: hidden; - padding: 6px; - font-size: 125%; -} .openerp .oe-listview-content { width: 100%; } -.openerp .oe-listview-content thead, .openerp .oe-listview-content tfoot { - border-bottom: 1px solid #cacaca; +.openerp .oe-listview-content > thead { + border-bottom: 2px solid #cacaca; background: #eeeeee; -} -.openerp .oe-listview-content tfoot { - border-bottom: 1px solid #cacaca; - font-weight: bold; -} -.openerp .oe-listview-content tbody { - cursor: pointer; - background: white; -} -.openerp .oe-listview-content thead { vertical-align: top; } -.openerp .oe-listview-content td.oe_list_checkbox:first-child, .openerp .oe-listview-content th.oe_list_checkbox:first-child { - width: 17px; -} -.openerp .oe-listview-content td.oe_list_checkbox:first-child:after, .openerp .oe-listview-content th.oe_list_checkbox:first-child:after { - border-width: 0; -} -.openerp .oe-listview-content tbody tr:nth-child(odd) td, .openerp .oe-listview-content tbody tr:nth-child(odd) th { - background-color: #f0f0fa; - background-color: #f0f0fa; - background-image: -webkit-gradient(linear, left top, left bottom, from(#f0f0fa), to(#eeeef6)); - background-image: -webkit-linear-gradient(top, #f0f0fa, #eeeef6); - background-image: -moz-linear-gradient(top, #f0f0fa, #eeeef6); - background-image: -ms-linear-gradient(top, #f0f0fa, #eeeef6); - background-image: -o-linear-gradient(top, #f0f0fa, #eeeef6); - background-image: linear-gradient(to bottom, #f0f0fa, #eeeef6); -} -.openerp .oe-listview-content tbody tr:hover td, .openerp .oe-listview-content tbody tr:hover th { - background-color: #eeeeee; - background-image: -webkit-gradient(linear, left top, left bottom, from(#eeeeee), to(#dedede)); - background-image: -webkit-linear-gradient(top, #eeeeee, #dedede); - background-image: -moz-linear-gradient(top, #eeeeee, #dedede); - background-image: -ms-linear-gradient(top, #eeeeee, #dedede); - background-image: -o-linear-gradient(top, #eeeeee, #dedede); - background-image: linear-gradient(to bottom, #eeeeee, #dedede); -} -.openerp .oe-listview-content td, .openerp .oe-listview-content th { +.openerp .oe-listview-content > thead td, .openerp .oe-listview-content > thead th { padding: 3px 6px; line-height: 18px; } -.openerp .oe-listview-content td button, .openerp .oe-listview-content th button { - border: none; - background: transparent; - padding: 0; - -moz-box-shadow: none; - -webkit-box-shadow: none; - -box-shadow: none; +.openerp .oe-listview-content > thead th:after { + content: ""; + float: right; + margin-top: 7px; + border-width: 0 4px 4px; + border-style: solid; + border-color: black transparent; + visibility: hidden; } -.openerp .oe-listview-content .numeric { - text-align: right; - width: 82px; -} -.openerp .oe-listview-content .numeric input { - text-align: right; -} -.openerp .oe-listview-content table .sortdown:after, .openerp .oe-listview-content table .sortdown:hover:after { +.openerp .oe-listview-content > thead th.sortup:after { visibility: visible; filter: alpha(opacity=60); opacity: 0.6; } -.openerp .oe-listview-content table .sortup:after { +.openerp .oe-listview-content > thead th.sortdown:after { border-bottom: none; border-left: 4px solid transparent; border-right: 4px solid transparent; @@ -1752,6 +1877,66 @@ filter: alpha(opacity=60); opacity: 0.6; } +.openerp .oe-listview-content > tbody { + cursor: pointer; + background: white; +} +.openerp .oe-listview-content > tbody > tr { + border-top: 1px solid #dddddd; +} +.openerp .oe-listview-content > tbody > tr > td, .openerp .oe-listview-content > tbody > tr > th { + padding: 3px 6px; + line-height: 18px; +} +.openerp .oe-listview-content > tbody > tr > td > button, .openerp .oe-listview-content > tbody > tr > th > button { + border: none; + background: transparent; + padding: 0; + -moz-box-shadow: none; + -webkit-box-shadow: none; + -box-shadow: none; +} +.openerp .oe-listview-content > tbody > tr > td.oe_list_checkbox:first-child, .openerp .oe-listview-content > tbody > tr th.oe_list_checkbox:first-child { + width: 17px; +} +.openerp .oe-listview-content > tbody > tr > td.oe_list_checkbox:first-child:after, .openerp .oe-listview-content > tbody > tr th.oe_list_checkbox:first-child:after { + border-width: 0; +} +.openerp .oe-listview-content > tbody > tr > td.oe-number { + text-align: right !important; +} +.openerp .oe-listview-content > tbody > tr:nth-child(odd) { + background-color: #f0f0fa; + background-color: #f0f0fa; + background-image: -webkit-gradient(linear, left top, left bottom, from(#f0f0fa), to(#eeeef6)); + background-image: -webkit-linear-gradient(top, #f0f0fa, #eeeef6); + background-image: -moz-linear-gradient(top, #f0f0fa, #eeeef6); + background-image: -ms-linear-gradient(top, #f0f0fa, #eeeef6); + background-image: -o-linear-gradient(top, #f0f0fa, #eeeef6); + background-image: linear-gradient(to bottom, #f0f0fa, #eeeef6); +} +.openerp .oe-listview-content > tfoot { + border-top: 2px solid #cacaca; + border-bottom: 1px solid #cacaca; + background: #eeeeee; + font-weight: bold; +} +.openerp .oe-listview-content > tbody tr:hover td, .openerp .oe-listview-content tbody tr:hover th { + background-color: #eeeeee; + background-image: -webkit-gradient(linear, left top, left bottom, from(#eeeeee), to(#dedede)); + background-image: -webkit-linear-gradient(top, #eeeeee, #dedede); + background-image: -moz-linear-gradient(top, #eeeeee, #dedede); + background-image: -ms-linear-gradient(top, #eeeeee, #dedede); + background-image: -o-linear-gradient(top, #eeeeee, #dedede); + background-image: linear-gradient(to bottom, #eeeeee, #dedede); +} +.openerp .oe-listview-content .numeric { + text-align: right; + width: 82px; +} +.openerp .oe-listview-content .numeric input { + text-align: right; +} .openerp .oe_kanban_group_title { margin: 1px 1px 4px; font-size: 15px; diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index 412c36b3ee5..102e640b918 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -16,6 +16,16 @@ $colour4: #8a89ba font-weight: normal font-style: normal +@font-face + font-family: 'EntypoRegular' + src: url('/web/static/src/font/entypo-webfont.eot') format('eot') + src: url('/web/static/src/font/entypo-webfont.eot?#iefix') format('embedded-opentype') + src: url('/web/static/src/font/entypo-webfont.woff') format('woff') + src: url('/web/static/src/font/entypo-webfont.ttf') format('truetype') + src: url('/web/static/src/font/entypo-webfont.svg') format('svg') active + font-weight: normal + font-style: normal + @mixin vertical-gradient($startColor: #555, $endColor: #333) background-color: $startColor background-image: -webkit-gradient(linear, left top, left bottom, from($startColor), to($endColor)) /* Saf4+, Chrome */ @@ -123,6 +133,10 @@ $colour4: #8a89ba font-family: "mnmliconsRegular" !important font-size: 21px font-weight: 300 !important + .oe_e + font-family: "entypoRegular" !important + font-size: 34px + font-weight: 300 !important .oe_left float: left margin-right: 8px @@ -133,6 +147,11 @@ $colour4: #8a89ba clear: both .oe_wait cursor: wait + .oe_fade + color: #888 + //font-size: 12px + .oe_bold + font-weight: bold // }}} // Button style {{{ a.button:link, a.button:visited, button, input[type='submit'] @@ -351,15 +370,8 @@ $colour4: #8a89ba width: 100% height: 31px border-top: solid 1px #d3d3d3 - border-bottom: solid 1px black @include vertical-gradient(#646060, #262626) - .oe_systray - float: right - .oe_systray > div - float: left - padding: 0 4px 0 4px - .oe_topbar_item li float: left @@ -408,6 +420,7 @@ $colour4: #8a89ba background: #f0eeee border-right: 1px solid #afafb6 text-shadow: 0 1px 1px white + padding-bottom: 16px a.oe_logo width: 220px display: block @@ -444,6 +457,7 @@ $colour4: #8a89ba float: left .oe_dropdown position: relative + .oe_dropdown_options float: left background: #333 @@ -479,6 +493,52 @@ $colour4: #8a89ba &:hover @include vertical-gradient(#292929, #191919) @include box-shadow(none) + hr + border-top: 1px solid #999 + border-bottom: 0 + // }}} + // Systray {{{ + .oe_systray > div + float: left + padding: 0 4px 0 4px + .oe_systray + float: right + + .oe_systray_dropdown + position: relative + .oe_systray_dropdown:hover .oe_systray_dropdown_options + display: block + .oe_systray_dropdown_options + background: #333 + background: rgba(37,37,37,0.9) + display: none + position: absolute + z-index: 900 + border: 0 + margin-left: 0 + margin-right: 0 + padding: 6px 0 + border-color: #999 + border-color: rgba(0, 0, 0, 0.2) + border-style: solid + border-width: 0 1px 1px + @include radius(0 0 6px 6px) + @include box-shadow(0 1px 4px rgba(0,0,0,0.3)) + @include background-clip() + li + float: none + display: block + background-color: none + a + display: block + padding: 4px 15px + clear: both + font-weight: normal + line-height: 18px + color: #eee + &:hover + @include vertical-gradient(#292929, #191919) + @include box-shadow(none) // }}} // Menu {{{ .oe_menu @@ -527,9 +587,9 @@ $colour4: #8a89ba margin: 0 width: 100% display: inline-block - li + > li position: relative - padding: 1px 0 1px 16px + padding: 1px 0 1px 20px a display: block color: #4c4c4c @@ -580,7 +640,7 @@ $colour4: #8a89ba content: "&darr" text-indent: -99999px vertical-align: top - margin-left: -8px + margin-left: -12px margin-top: 4px margin-right: 4px border-top: 4px solid transparent @@ -589,7 +649,7 @@ $colour4: #8a89ba @include opacity(0.5) .oe_menu_opened:before margin-top: 6px - margin-left: -12px + margin-left: -16px margin-right: 4px border-left: 4px solid transparent border-right: 4px solid transparent @@ -669,21 +729,37 @@ $colour4: #8a89ba text-shadow: 0 1px 2px rgba(0,0,0,0.4) // }}} // ViewManager.header {{{ - .oe_view_manager_header2 + .oe_view_manager_header width: 100% border-top: 1px solid #cacaca border-bottom: 1px solid #cacaca @include vertical-gradient(#fcfcfc, #dedede) @include box-shadow((0 1px 0 rgba(255,255,255,0.4), 0 0 9px rgba(0,0,0,0.1))) + .oe_header_row + //min-height: 26px + //line-height: 26px + clear: both + text-shadow: 0 1px 1px white + td + padding: 8px + .oe_header_row:last-child + td + padding-top: 0 + .oe_header_row:first-child + td + padding-top: 8px + .oe_view_manager_sidebar + margin: 0px auto + width: 400px + text-align: center + td + line-height: 26px h2 - float: left font-size: 18px - margin: 1px 0 + margin: 0 + float: left a color: $colour4 - td - padding: 4px 8px - line-height: 26px .oe_button_group display: inline-block border: 1px solid #ababab @@ -712,6 +788,8 @@ $colour4: #8a89ba margin: 8px 0 // }}} // ViewManager.pager {{{ + .oe_view_manager_pager + line-height: 26px .oe_pager_value float: left margin-right: 8px @@ -746,29 +824,47 @@ $colour4: #8a89ba // ViewManager.switches {{{ .oe_view_manager_switch li - padding-left: 1px text-align: center width: 24px height: 24px - line-height: 24px + line-height: 16px + a + position: relative .oe_vm_switch_list:after, .oe_vm_switch_tree:after - content: "ö" + padding: 2px + content: "i" .oe_vm_switch_graph:after - content: "ó" - .oe_vm_switch_gantt:after - content: "y" - .oe_vm_switch_calendar:after - content: "b" - .oe_vm_switch_kanban:after - content: "ó" - .oe_vm_switch_diagram:after + font-family: "mnmliconsRegular" !important + font-size: 21px + font-weight: 300 !important content: "}" + top: -2px + position: relative + .oe_vm_switch_gantt:after + content: "c" + .oe_vm_switch_calendar:after + content: "P" + .oe_vm_switch_kanban:after + content: "k" + .oe_vm_switch_diagram:after + content: "f" + //.oe_vm_switch_list:after, .oe_vm_switch_tree:after + //content: "ö" + //.oe_vm_switch_graph:after + //content: "ó" + //.oe_vm_switch_gantt:after + //content: "y" + //.oe_vm_switch_calendar:after + //content: "b" + //.oe_vm_switch_kanban:after + //content: "ó" + //.oe_vm_switch_diagram:after + //content: "}" // }}} // ViewManager.sidebar {{{ .oe_form_dropdown_section position: relative display: inline-block - margin-right: 4px .oe_dropdown_toggle:after width: 0 height: 0 @@ -810,6 +906,7 @@ $colour4: #8a89ba line-height: 14px color: #4c4c4c text-decoration: none + cursor: pointer &:hover text-decoration: none @include vertical-gradient(#f0f0fa, #eeeef6) @@ -824,26 +921,27 @@ $colour4: #8a89ba .VS-search .VS-search-box min-height: 0 - border-width: 1px padding: 0 - width: 410px - //border: 1px solid #ababab - //margin-top: 0 - //margin-bottom: 0 + width: 480px + border: 1px solid #ababab + @include radius(13px) + @include box-shadow(0 1px 2px rgba(0,0,0,0.2) inset) //padding: 4px 19px //font-size: 13px //background: url('../img/search.png') no-repeat 5px //background-color: white - //@include radius(13px) - //@include box-shadow(0 1px 2px rgba(0,0,0,0.2) inset) .VS-icon - top: 5px + top: 6px .VS-icon-search - left: 5px + left: 2px + top: 3px + height: 18px + width: 18px .VS-search-inner margin: 0 40px 0 17px + padding: 1px 0 font-size: 13px input @@ -860,7 +958,6 @@ $colour4: #8a89ba margin-left: 0 height: 22px input, .VS-input-width-tester - padding: 0 2px height: inherit margin: 0 @@ -915,10 +1012,21 @@ $colour4: #8a89ba height: 100% line-height: 23px padding: 0 7px 0 4px - color: #ccc + color: #4c4c4c cursor: pointer &:before - content: "▾" + position: absolute + top: 9px + right: 8px + width: 0 + height: 0 + display: inline-block + content: "" + vertical-align: top + border-top: 5px solid #4c4c4c + border-left: 5px solid transparent + border-right: 5px solid transparent + @include opacity(0.5) &.oe_searchview_open_drawer .oe_searchview_drawer @@ -930,7 +1038,7 @@ $colour4: #8a89ba top: 100% right: 0 background-color: white - width: 410px + width: 480px display: none border: 1px solid #ccc text-align: left @@ -993,7 +1101,16 @@ $colour4: #8a89ba div display: block // }}} - // View.topbar {{{ + // Views Common {{{ + .oe_view_nocontent + > img + float: left + margin-right: 1.5em + > div + // don't encroach on my arrow + overflow: hidden + padding: 6px + font-size: 125% .oe_view_topbar border-bottom: 1px solid #cacaca @include vertical-gradient(#fcfcfc, #dedede) @@ -1034,7 +1151,7 @@ $colour4: #8a89ba line-height: 24px vertical-align: top padding: 0 10px - margin: 3px 0 + margin: 3px 4px 3px 0 span.i line-height: 20px height: 24px @@ -1074,10 +1191,27 @@ $colour4: #8a89ba .oe_form_steps_active font-weight: bold color: #b33630 + .oe_form_topbar.oe_form_topbar_hifirst button:first-child, button.oe_form_button_hi + color: white + background: #DC5F59 + background: -moz-linear-gradient(#DC5F59, #B33630) + background: -webkit-gradient(linear, left top, left bottom, from(#DC5F59), to(#B33630)) + background: -webkit-linear-gradient(#DC5F59, #B33630) + -moz-box-shadow: none + -webkit-box-shadow: none + -box-shadow: none + .oe_form_topbar.oe_form_topbar_hifirst button:first-child:hover, button.oe_form_button_hi:hover + background: #DF6B66 + background: -moz-linear-gradient( #DF6B66, #BF3A33) + background: -webkit-gradient(linear, left top, left bottom, from( #DF6B66), to( #BF3A33)) + background: -webkit-linear-gradient( #DF6B66, #BF3A33) + -moz-box-shadow: 0 0 1px rgba(0, 0, 0, 0.2) + -webkit-box-shadow: 0 0 1px rgba(0, 0, 0, 0.2) + -box-shadow: 0 0 1px rgba(0, 0, 0, 0.2) .oe_application .oe_form_sheetbg background: url(/web/static/src/img/form_sheetbg.png) - padding: 8px + padding: 8px 0 border-bottom: 1px solid #ddd .oe_form_sheet_width min-width: 650px @@ -1089,30 +1223,15 @@ $colour4: #8a89ba min-height: 420px border: 1px solid #afafb6 @include box-shadow(0 0 10px rgba(0,0,0,0.3)) - //.avatar - // max-height: 52px - //.contacts - // li - // float: left - // width: 33% - // margin-bottom: 4px - // .avatar - // height: 40px - // width: 40px - // border: 1px solid - // border-color: #e5e5e5 #dbdbdb #d2d2d2 - // .data - // padding: 2px - // line-height: 18px // }}} // FormView.autolayout {{{ .oe_form_autolayout .oe_button - height: 22px + height: 20px .oe_form_group_cell line-height: 18px padding: 2px - height: 25px + height: 20px .oe_form_group_cell > .oe_form_field_many2one, .oe_form_group_cell > .oe_form_field_many2one input, .oe_form_group_cell > .oe_form_field_char input, @@ -1184,9 +1303,15 @@ $colour4: #8a89ba textarea[readonly], input[disabled], select[disabled], - textarea[disabled] background: #E5E5E5 !important color: #666 + textarea[disabled] + border: none + border-left: 8px solid #eee + padding-left: 8px + @include box-shadow(none) + @include radius(0px) + color: #666 .oe_form_field_many2one input, .oe_form_field_binary input, .oe_form_field_binary input, @@ -1266,6 +1391,9 @@ $colour4: #8a89ba filter: alpha(opacity=50) right: 5px top: 3px + .oe_form_button > img + vertical-align: -3px + padding: 0 2px // }}} // FormView.binaryfile {{{ /* http://www.quirksmode.org/dom/inputfile.html @@ -1294,10 +1422,8 @@ $colour4: #8a89ba // FormView.separator {{{ .oe_horizontal_separator font-weight: bold - border: 0 solid #666 - border-bottom-width: 1px - margin: 3px 4px 3px 1px - height: 17px + font-size: 16px + margin: 4px 0 .oe_horizontal_separator:empty height: 5px .oe_vertical_separator @@ -1387,6 +1513,8 @@ $colour4: #8a89ba li height: auto line-height: 16px + .oe-select-create-popup-view-form > .oe_formview > .oe_form_pager + display: none // }}} // FormView.classes for openerp views {{{ @@ -1394,6 +1522,7 @@ $colour4: #8a89ba .oe_form_title, .oe_form_title input font-size: 20px font-weight: bold + height: 30px .oe_form_group_odd_border > tbody > tr.oe_form_group_row > td.oe_form_group_cell:nth-child(odd), .oe_form_group_label_border > tbody > tr.oe_form_group_row > td.oe_form_group_cell_label border-right: 1px solid #ddd @@ -1405,69 +1534,79 @@ $colour4: #8a89ba padding: 2px 2px 2px 8px !important // }}} // ListView {{{ - .oe_listview_nocontent - > img - float: left - margin-right: 1.5em - > div - // don't encroach on my arrow - overflow: hidden - padding: 6px - font-size: 125% .oe-listview-content width: 100% - thead, tfoot - border-bottom: 1px solid #cacaca + > thead + border-bottom: 2px solid #cacaca background: #eee - tfoot - border-bottom: 1px solid #cacaca - font-weight: bold - tbody + vertical-align: top + td, th + padding: 3px 6px + line-height: 18px + th:after + content: "" + float: right + margin-top: 7px + border-width: 0 4px 4px + border-style: solid + border-color: #000 transparent + visibility: hidden + th.sortup:after + visibility: visible + @include opacity(0.6) + th.sortdown:after + border-bottom: none + border-left: 4px solid transparent + border-right: 4px solid transparent + border-top: 4px solid #000 + visibility: visible + @include box-shadow(none) + @include opacity(0.6) + // TODO mit + //th:hover:after + // border-bottom: none + // border-left: 4px solid transparent + // border-right: 4px solid transparent + // border-top: 4px solid #000 + // visibility: visible + // @include box-shadow(none) + // @include opacity(0.6) + > tbody cursor: pointer background: white - thead - vertical-align: top - td.oe_list_checkbox:first-child, th.oe_list_checkbox:first-child - width: 17px - &:after - border-width: 0 - tbody tr:nth-child(odd) td, tbody tr:nth-child(odd) th - background-color: #f0f0fa - @include vertical-gradient(#f0f0fa, #eeeef6) - tbody tr:hover td, tbody tr:hover th + > tr + border-top: 1px solid #ddd + > td, > th + padding: 3px 6px + line-height: 18px + > button + border: none + background: transparent + padding: 0 + @include box-shadow(none) + > td.oe_list_checkbox:first-child, th.oe_list_checkbox:first-child + width: 17px + &:after + border-width: 0 + > td.oe-number + text-align: right !important + > tr:nth-child(odd) + background-color: #f0f0fa + @include vertical-gradient(#f0f0fa, #eeeef6) + > tfoot + border-top: 2px solid #cacaca + border-bottom: 1px solid #cacaca + background: #eee + font-weight: bold + + > tbody tr:hover td, tbody tr:hover th @include vertical-gradient(#eee, #dedede) - td, th - padding: 3px 6px - line-height: 18px - button - border: none - background: transparent - padding: 0 - @include box-shadow(none) + .numeric text-align: right width: 82px input text-align: right - //thead th:after - //content: "" - //float: right - //margin-top: 7px - //border-width: 0 4px 4px - //border-style: solid - //border-color: #000 transparent - //visibility: hidden - table .sortdown:after, table .sortdown:hover:after - visibility: visible - @include opacity(0.6) - table .sortup:after - border-bottom: none - border-left: 4px solid transparent - border-right: 4px solid transparent - border-top: 4px solid #000 - visibility: visible - @include box-shadow(none) - @include opacity(0.6) // }}} // KanbanView {{{ .oe_kanban_group_title diff --git a/addons/web/static/src/css/base_old.css b/addons/web/static/src/css/base_old.css index 8f333fae761..74b660f7613 100644 --- a/addons/web/static/src/css/base_old.css +++ b/addons/web/static/src/css/base_old.css @@ -880,60 +880,6 @@ label.error { text-align: left; padding: 4px 5px; } -/* Shortcuts*/ -.oe-shortcut-toggle { - height: 20px; - margin-top: 3px; - padding: 0; - width: 24px; - cursor: pointer; - display: block; - background: url(/web/static/src/img/add-shortcut.png) no-repeat center center; - float: left; -} -.oe-shortcut-remove{ - background: url(/web/static/src/img/remove-shortcut.png) no-repeat center center; -} -.oe-shortcuts { - position: absolute; - margin: 0; - padding: 6px 15px; - top: 37px; - left: 197px; - right: 0; - height: 17px; - line-height: 1.2; -} -.oe-shortcuts ul { - display: block; - overflow: hidden; - list-style: none; - white-space: nowrap; - padding: 0; - margin: 0; -} -.oe-shortcuts li { - cursor: pointer; - display: -moz-inline-stack; - display: inline-block; - display: inline; /*IE7 */ - color: #fff; - text-align: center; - border-left: 1px solid #909090; - padding: 0 4px; - font-size: 80%; - font-weight: normal; - vertical-align: top; -} - -.oe-shortcuts li:hover { - background-color: #666; -} -.oe-shortcuts li:first-child { - border-left: none; - padding-left: 0; -} - ul.oe-arrow-list { padding-left: 1.1em; margin: 0; diff --git a/addons/web/static/src/font/entypo-webfont.eot b/addons/web/static/src/font/entypo-webfont.eot new file mode 100755 index 00000000000..2c09f336d57 Binary files /dev/null and b/addons/web/static/src/font/entypo-webfont.eot differ diff --git a/addons/web/static/src/font/entypo-webfont.svg b/addons/web/static/src/font/entypo-webfont.svg new file mode 100755 index 00000000000..c24d92adb5f --- /dev/null +++ b/addons/web/static/src/font/entypo-webfont.svg @@ -0,0 +1,198 @@ + + + \ No newline at end of file diff --git a/addons/web/static/src/font/entypo-webfont.ttf b/addons/web/static/src/font/entypo-webfont.ttf new file mode 100755 index 00000000000..89b7a194cc7 Binary files /dev/null and b/addons/web/static/src/font/entypo-webfont.ttf differ diff --git a/addons/web/static/src/font/entypo-webfont.woff b/addons/web/static/src/font/entypo-webfont.woff new file mode 100755 index 00000000000..3879f5b811e Binary files /dev/null and b/addons/web/static/src/font/entypo-webfont.woff differ diff --git a/addons/web/static/src/img/list_empty_arrow.png b/addons/web/static/src/img/view_empty_arrow.png similarity index 100% rename from addons/web/static/src/img/list_empty_arrow.png rename to addons/web/static/src/img/view_empty_arrow.png diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index f43da0431ff..b740c61c9df 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -544,34 +544,33 @@ instance.web.Menu = instance.web.Widget.extend({ this._super.apply(this, arguments); this.has_been_loaded = $.Deferred(); this.maximum_visible_links = 'auto'; // # of menu to show. 0 = do not crop, 'auto' = algo + this.data = {data:{children:[]}}; }, start: function() { this._super.apply(this, arguments); this.$secondary_menus = this.getParent().$element.find('.oe_secondary_menus_container'); - this.$secondary_menus.on('click', 'a[data-menu]', this.on_menu_click); - $('html').bind('click', this.do_hide_more); + return this.do_reload(); }, do_reload: function() { - var self = this; - return this.rpc("/web/menu/load", {}, this.on_loaded).then(function () { - if (self.current_menu) { - self.open_menu(self.current_menu); - } - }); + return this.rpc("/web/menu/load", {}).then(this.on_loaded); }, on_loaded: function(data) { var self = this; this.data = data; this.renderElement(); this.limit_entries(); - this.$element.on('click', 'a[data-menu]', this.on_menu_click); + this.$secondary_menus.html(QWeb.render("Menu.secondary", { widget : this })); this.$element.on('click', 'a.oe_menu_more_link', function() { self.$element.find('.oe_menu_more').toggle(); return false; }); - this.$secondary_menus.html(QWeb.render("Menu.secondary", { widget : this })); + this.$element.on('click', 'a[data-menu]', this.on_menu_click); + this.$secondary_menus.on('click', 'a[data-menu]', this.on_menu_click); // Hide second level submenus this.$secondary_menus.find('.oe_menu_toggler').siblings('.oe_secondary_submenu').hide(); + if (self.current_menu) { + self.open_menu(self.current_menu); + } this.has_been_loaded.resolve(); }, limit_entries: function() { @@ -585,6 +584,7 @@ instance.web.Menu = instance.web.Widget.extend({ $index.after($more); $more.find('.oe_menu_more').append($index.next().nextAll()); } + this.do_hide_more(); }, auto_limit_entries: function() { // TODO: auto detect overflow and bind window on resize @@ -603,6 +603,7 @@ instance.web.Menu = instance.web.Widget.extend({ open_menu: function (id) { var $clicked_menu, $sub_menu, $main_menu; $clicked_menu = this.$element.add(this.$secondary_menus).find('a[data-menu=' + id + ']'); + this.trigger('open_menu', id, $clicked_menu); if (this.$secondary_menus.has($clicked_menu).length) { $sub_menu = $clicked_menu.parents('.oe_secondary_menu'); @@ -620,6 +621,9 @@ instance.web.Menu = instance.web.Widget.extend({ this.$secondary_menus.find('.oe_secondary_menu').hide(); $sub_menu.show(); + // Hide/Show the leftbar menu depending of the presence of sub-items + this.$secondary_menus.parent('.oe_leftbar').toggle(!!$sub_menu.children().length); + // Activate current menu item and show parents this.$secondary_menus.find('.oe_active').removeClass('oe_active'); if ($main_menu !== $clicked_menu) { @@ -631,56 +635,60 @@ instance.web.Menu = instance.web.Widget.extend({ } } }, + /** + * Call open_menu with the first menu_item matching an action_id + * + * @param {Number} id the action_id to match + */ open_action: function (id) { var menu_id, $menu = this.$element.add(this.$secondary_menus).find('a[data-action-id=' + id + ']'); if (menu_id = $menu.data('menu')) { this.open_menu(menu_id); } }, - on_menu_click: function(ev, id) { - // TODO If first level menu doesnt have action trigger first leaf - this.do_hide_more(); - id = id || 0; - var $clicked_menu, manual = false; - + /** + * Process a click on a menu item + * + * @param {Number} id the menu_id + */ + menu_click: function(id) { if (id) { - // We can manually activate a menu with it's id (for hash url mapping) - manual = true; - $clicked_menu = this.$element.find('a[data-menu=' + id + ']'); - if (!$clicked_menu.length) { - $clicked_menu = this.$secondary_menus.find('a[data-menu=' + id + ']'); + this.do_hide_more(); + // find back the menuitem in dom to get the action + var $item = this.$element.find('a[data-menu=' + id + ']'); + if (!$item.length) { + $item = this.$secondary_menus.find('a[data-menu=' + id + ']'); + } + var action_id = $item.data('action-id'); + // If first level menu doesnt have action trigger first leaf + if (!action_id) { + if(this.$element.has($item).length) { + $sub_menu = this.$secondary_menus.find('.oe_secondary_menu[data-menu-parent=' + id + ']'); + $items = $sub_menu.find('a[data-action-id]').filter('[data-action-id!=""]'); + if($items.length) { + action_id = $items.data('action-id'); + id = $items.data('menu'); + } + } } - } else { - $clicked_menu = $(ev.currentTarget); - id = $clicked_menu.data('menu'); - } - - this.trigger('menuClicked', id, $clicked_menu); - - if (id) { this.open_menu(id); this.current_menu = id; this.session.active_id = id; - var action_id = $clicked_menu.data('action-id'); if (action_id) { - this.on_action(action_id); + this.trigger('menu_click', action_id, id, $item); } } - if (ev) { - ev.stopPropagation(); - } + }, + /** + * Jquery event handler for menu click + * + * @param {Event} ev the jquery event + */ + on_menu_click: function(ev) { + this.menu_click($(ev.currentTarget).data('menu')); + ev.stopPropagation(); return false; }, - do_show_secondary: function($sub_menu, $main_menu) { - var self = this; - this.$secondary_menus.show(); - if (!arguments.length) { - return; - } - $sub_menu.show(); - }, - on_action: function(action) { - } }); instance.web.UserMenu = instance.web.Widget.extend({ @@ -712,7 +720,7 @@ instance.web.UserMenu = instance.web.Widget.extend({ title: _t("Change Password"), width : 'auto' }).open(); - this.dialog.$element.html(QWeb.render("Change_Pwd", self)); + this.dialog.$element.html(QWeb.render("UserMenu.password", self)); this.dialog.$element.find("form[name=change_password_form]").validate({ submitHandler: function (form) { self.rpc("/web/session/change_password",{ @@ -746,64 +754,20 @@ instance.web.UserMenu = instance.web.Widget.extend({ return; var func = new instance.web.Model("res.users").get_func("read"); return func(self.session.uid, ["name", "company_id"]).pipe(function(res) { - // TODO: Show company if multicompany is in use - var topbar_name = _.str.sprintf("%s (%s)", res.name, instance.connection.db, res.company_id[1]); + var topbar_name = res.name; + if(instance.connection.debug) + topbar_name = _.str.sprintf("%s (%s)", topbar_name, instance.connection.db); + if(res.company_id[0] > 1) + topbar_name = _.str.sprintf("%s (%s)", topbar_name, res.company_id[1]); self.$element.find('.oe_topbar_name').text(topbar_name); var avatar_src = _.str.sprintf('%s/web/binary/image?session_id=%s&model=res.users&field=avatar&id=%s', self.session.prefix, self.session.session_id, self.session.uid); $avatar.attr('src', avatar_src); - return self.shortcut_load(); }); }; this.update_promise = this.update_promise.pipe(fct, fct); }, on_action: function() { }, - shortcut_load :function(){ - var self = this, - sc = self.session.shortcuts, - shortcuts_ds = new instance.web.DataSet(this, 'ir.ui.view_sc'); - self.$element.find('.oe_dropdown_options a[data-menu=shortcut]').each(function() { - $(this).parent().remove(); - }); - // TODO: better way to communicate between sections. - // sc.bindings, because jquery does not bind/trigger on arrays... - if (!sc.binding) { - sc.binding = {}; - $(sc.binding).bind({ - 'add': function (e, attrs) { - shortcuts_ds.create(attrs, function (out) { - var shortcut = QWeb.render('UserMenu.shortcut', { - shortcuts : [{ - name : attrs.name, - id : out.result, - res_id : attrs.res_id - }] - }); - $(shortcut).appendTo(self.$element.find('.oe_dropdown_options')); - attrs.id = out.result; - sc.push(attrs); - }); - }, - 'remove-current': function () { - var menu_id = self.session.active_id; - var $shortcut = self.$element.find('.oe_dropdown_options li a[data-id=' + menu_id + ']'); - var shortcut_id = $shortcut.data('shortcut-id'); - $shortcut.remove(); - shortcuts_ds.unlink([shortcut_id]); - var sc_new = _.reject(sc, function(shortcut){ return shortcut_id === shortcut.id}); - sc.splice(0, sc.length); - sc.push.apply(sc, sc_new); - } - }); - } - return this.rpc('/web/session/sc_list', {}, function(shortcuts) { - sc.splice(0, sc.length); - sc.push.apply(sc, shortcuts); - - $(QWeb.render('UserMenu.shortcut', {'shortcuts': shortcuts})) - .appendTo(self.$element.find('.oe_dropdown_options')); - }); - }, on_menu_logout: function() { }, on_menu_settings: function() { @@ -830,8 +794,8 @@ instance.web.UserMenu = instance.web.Widget.extend({ title: _t("Preferences"), width: '700px', buttons: [ - {text: _t("Cancel"), click: function(){ $(this).dialog('destroy'); }}, {text: _t("Change password"), click: function(){ self.change_password(); }}, + {text: _t("Cancel"), click: function(){ $(this).dialog('destroy'); }}, {text: _t("Save"), click: function(){ var inner_viewmanager = action_manager.inner_viewmanager; inner_viewmanager.views[inner_viewmanager.active_view].controller.do_save() @@ -850,7 +814,7 @@ instance.web.UserMenu = instance.web.Widget.extend({ on_menu_about: function() { var self = this; self.rpc("/web/webclient/version_info", {}).then(function(res) { - var $help = $(QWeb.render("About-Page", {version_info: res})); + var $help = $(QWeb.render("UserMenu.about", {version_info: res})); $help.find('a.oe_activate_debug_mode').click(function (e) { e.preventDefault(); window.location = $.param.querystring( @@ -860,16 +824,6 @@ instance.web.UserMenu = instance.web.Widget.extend({ modal: true, width: 960, title: _t("About")}); }); }, - on_menu_shortcut: function($link) { - var self = this, - id = $link.data('id'); - self.session.active_id = id; - self.rpc('/web/menu/action', {'menu_id': id}, function(ir_menu_data) { - if (ir_menu_data.action.length){ - self.on_action(ir_menu_data.action[0][2]); - } - }); - } }); instance.web.WebClient = instance.web.Widget.extend({ @@ -897,8 +851,6 @@ instance.web.WebClient = instance.web.Widget.extend({ this.session.on_session_valid.add(function() { self.show_application(); - self.user_menu.do_update(); - self.menu.do_reload(); if(self.action_manager) self.action_manager.destroy(); self.action_manager = new instance.web.ActionManager(self); @@ -929,11 +881,12 @@ instance.web.WebClient = instance.web.Widget.extend({ self.$element.append(self.$table); self.menu = new instance.web.Menu(self); self.menu.replace(this.$element.find('.oe_menu_placeholder')); - self.menu.on_action.add(this.proxy('on_menu_action')); + self.menu.on('menu_click', this, this.on_menu_action); self.user_menu = new instance.web.UserMenu(self); self.user_menu.replace(this.$element.find('.oe_user_menu_placeholder')); self.user_menu.on_menu_logout.add(this.proxy('on_logout')); self.user_menu.on_action.add(this.proxy('on_menu_action')); + self.user_menu.do_update(); }, show_common: function() { var self = this; @@ -994,8 +947,9 @@ instance.web.WebClient = instance.web.Widget.extend({ } else { self.menu.has_been_loaded.then(function() { var first_menu_id = self.menu.$element.find("a:first").data("menu"); - if(first_menu_id) - self.menu.on_menu_click(null,first_menu_id); + if(first_menu_id) { + self.menu.menu_click(first_menu_id); + } }); } }, @@ -1019,7 +973,7 @@ instance.web.WebClient = instance.web.Widget.extend({ // TODO replace by client action menuclick if(action.menu_id) { this.do_reload().then(function () { - self.menu.on_menu_click(null, action.menu_id); + self.menu.menu_click(action.menu_id); }); } }, diff --git a/addons/web/static/src/js/coresetup.js b/addons/web/static/src/js/coresetup.js index 8f5f150f125..8e7b5d4f75d 100644 --- a/addons/web/static/src/js/coresetup.js +++ b/addons/web/static/src/js/coresetup.js @@ -69,7 +69,6 @@ instance.web.Session = instance.web.JsonRPC.extend( /** @lends instance.web.Sess self.module_loaded[mod] = true; }); this.context = {}; - this.shortcuts = []; this.active_id = null; return this.session_init(); }, diff --git a/addons/web/static/src/js/view_editor.js b/addons/web/static/src/js/view_editor.js index 6a14c0ef7f9..f169887cc54 100644 --- a/addons/web/static/src/js/view_editor.js +++ b/addons/web/static/src/js/view_editor.js @@ -98,7 +98,7 @@ instance.web.ViewEditor = instance.web.OldWidget.extend({ var view_widget = [{'name': 'view_name', 'string':'View Name', 'type': 'char', 'required': true, 'value' : this.model + '.custom_' + Math.round(Math.random() * 1000)}, {'name': 'view_type', 'string': 'View Type', 'type': 'selection', 'required': true, 'value': 'Form', 'selection': [['',''],['tree', 'Tree'],['form', 'Form'],['graph', 'Graph'],['calendar', 'Calender']]}, {'name': 'proirity', 'string': 'Priority', 'type': 'float', 'required': true, 'value':'16'}]; - this.create_view_dialog.$element.append('