summaryrefslogtreecommitdiff
path: root/addons/web/static/src/xml
diff options
context:
space:
mode:
authorAaron Bohy <aab@odoo.com>2015-02-05 16:34:25 +0100
committerAaron Bohy <aab@odoo.com>2015-03-20 16:18:33 +0100
commit151c90743efd374e72bf1b18f5ae0c392a3811ac (patch)
tree71b2806ad952da12b12a991a44730e78f4232660 /addons/web/static/src/xml
parent53a9f6c081d0d91c99d8f035fd09d813a16172e8 (diff)
[IMP] Web et al.: unique main ControlPanel
A unique main ControlPanel is instantiated by the ActionManager and it is updated each time the state changes (i.e. when an action is performed on the ActionManager or when switch_mode() is called on the ViewManager). Introduction of State classes to facilitate the way of restoring previously rendered states in ControlPanel. The notion of widgets previously used in the ActionManager is now encapsulated in the notion of states. The search() function has been moved from ControlPanel to ViewManager as it makes more sense like this. The ViewManager doesn't have the reference to the ControlPanel but rather communicate with it through a dedicated bus. Some refactoring has been done on the ControlPanel as well so that it doesn't need to know the ActionManager and the current Action anymore (it communicates with the AM with events, and it updates itself using information passed in arguments). Improves the way the ViewManager requests the ControlPanel to instantiate a SearchView, and how it waits for this SearchView to be corretly loaded. Move back the views logic to the ViewManager which directly asks the ControlPanel to render the buttons and switch-buttons areas with the views passed in arguments. Removes option replace_breadcrumb in push_state() of ActionManager as it is not used. Side changes: * Account: account_widget.js: Adapt code to retrieve the current state of the ActionManager. Required due to the introduction of State classes that encapsulate the notions of widgets and inner_widget in the ActionManager. * Board: dashboard.js: Some refactoring to adapt the code according to the new Widgets structure. Several dependencies (e.g. searchview, action) were unnecessary. Do not append the "add to dashboard" option to the Favorite menu if there is no ViewManager available (e.g. in Messaging) instead of hidding it with a CSS rule, as a ViewManager required to retrieve the active_view. * Google_spreadsheet: search.js: Change the way to retrieve the list_view_id s.t. it does not rely on parent of the SearchView anymore. * Web: search.js: Change the way to retrieve the title in search.js for Favorites s.t. it does not rely on the parent of the SearchView anymore. Doing so, the ControlPanel does not need the title attribute anymore.
Diffstat (limited to 'addons/web/static/src/xml')
-rw-r--r--addons/web/static/src/xml/base.xml60
1 files changed, 31 insertions, 29 deletions
diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml
index 3758aec3366..d148ce2f17a 100644
--- a/addons/web/static/src/xml/base.xml
+++ b/addons/web/static/src/xml/base.xml
@@ -225,7 +225,6 @@
</td>
</tr>
<tr>
- <td><label for="backup_pwd">Master Password:</label></td>
<td><input type="password" name="backup_pwd" class="required" /></td>
</tr>
</table>
@@ -470,42 +469,45 @@
<div t-name="ActionManager" class="oe_application" />
<t t-name="ControlPanel">
- <div class="oe-control-panel container-fluid">
- <div class="row">
- <div class="col-md-6 oe-cp-title">
- <div t-if="widget.debug" class="oe_debug_view btn-group btn-group-sm"/>
- <ol class="oe-view-title breadcrumb" t-if="widget.flags.display_title !== false">
- </ol>
- </div>
- <div class="oe-cp-search-view col-md-6" />
- </div>
- <div class="row">
- <div class="col-md-6 oe-button-column">
- <div class="oe-cp-buttons">
- <t t-foreach="widget.views" t-as="view">
- <div t-attf-class="oe-#{view}-buttons"/>
- </t>
+ <div class="oe-control-panel">
+ <div class="container-fluid">
+ <div class="row">
+ <div class="col-md-6 oe-cp-title">
+ <div t-if="widget.debug" class="oe_debug_view btn-group btn-group-sm"/>
+ <ol class="oe-view-title breadcrumb">
+ </ol>
</div>
- <div class="oe-cp-sidebar"></div>
+ <div class="oe-cp-search-view col-md-6" />
</div>
- <div class="col-md-6">
- <div class="oe-search-options btn-group"/>
- <div class="oe-right-toolbar">
- <div class="oe-cp-pager"></div>
- <t t-if="widget.multiple_views">
- <div class="oe-cp-switch-buttons btn-group btn-group-sm">
- <t t-foreach="widget.view_order" t-as="view">
- <button type="button" t-attf-class="btn btn-default fa oe-cp-switch-#{view.type}" t-att-data-view-type="view.type" t-att-title="view.label">
- </button>
- </t>
- </div>
- </t>
+ <div class="row">
+ <div class="col-md-6 oe-button-column">
+ <div class="oe-cp-buttons"></div>
+ <div class="oe-cp-sidebar"></div>
+ </div>
+ <div class="col-md-6">
+ <div class="oe-search-options btn-group"/>
+ <div class="oe-right-toolbar">
+ <div class="oe-cp-pager"></div>
+ <div class="oe-cp-switch-buttons btn-group btn-group-sm"></div>
+ </div>
</div>
</div>
</div>
</div>
</t>
+<t t-name="ControlPanel.buttons">
+ <t t-foreach="views" t-as="view">
+ <div t-attf-class="oe-#{view}-buttons"/>
+ </t>
+</t>
+
+<t t-name="ControlPanel.switch-buttons">
+ <t t-foreach="views" t-as="view">
+ <button type="button" t-attf-class="btn btn-default fa oe-cp-switch-#{view.type}" t-att-data-view-type="view.type" t-att-title="view.label"/>
+ </t>
+</t>
+
<div t-name="ViewManager" class="oe-view-manager">
<div class="oe-view-manager-content">
<t t-foreach="widget.views" t-as="view">