[IMP] move action name display to ViewManagerAction, move form's debug (display view code button) to viewmanageraction as well
bzr revid: xmo@openerp.com-20110914091319-o1941w689183wivt
This commit is contained in:
parent
c7c2b5846d
commit
a84f8fac3e
|
@ -90,12 +90,6 @@ openerp.web.FormView = openerp.web.View.extend( /** @lends openerp.web.FormView#
|
|||
this.$form_header.find('button.oe_form_button_cancel').click(this.do_cancel);
|
||||
this.$form_header.find('button.oe_form_button_new').click(this.on_button_new);
|
||||
|
||||
if (this.session.debug) {
|
||||
this.$form_header.find('button.oe_get_xml_view').click(function() {
|
||||
$('<xmp>' + openerp.web.json_node_to_xml(self.fields_view.arch, true) + '</xmp>').dialog({ width: '95%', height: 600});
|
||||
});
|
||||
}
|
||||
|
||||
if (this.options.sidebar && this.options.sidebar_id) {
|
||||
this.sidebar = new openerp.web.Sidebar(this, this.options.sidebar_id);
|
||||
this.sidebar.start();
|
||||
|
|
|
@ -158,7 +158,10 @@ openerp.web.ViewManager = openerp.web.Widget.extend(/** @lends openerp.web.View
|
|||
this.registry = openerp.web.views;
|
||||
},
|
||||
render: function() {
|
||||
return QWeb.render(this.template, {"prefix": this.element_id, views: this.views_src})
|
||||
return QWeb.render(this.template, {
|
||||
self: this,
|
||||
prefix: this.element_id,
|
||||
views: this.views_src});
|
||||
},
|
||||
/**
|
||||
* @returns {jQuery.Deferred} initial view loading promise
|
||||
|
@ -332,6 +335,14 @@ openerp.web.ViewManagerAction = openerp.web.ViewManager.extend(/** @lends oepner
|
|||
* launches an initial search after both views are done rendering.
|
||||
*/
|
||||
start: function() {
|
||||
var self = this;
|
||||
this.$element.find('.oe_get_xml_view').click(function () {
|
||||
// TODO: add search view?
|
||||
$('<pre>').text(openerp.web.json_node_to_xml(
|
||||
self.views[self.active_view].controller.fields_view.arch, true))
|
||||
.dialog({ width: '95%'});
|
||||
});
|
||||
|
||||
var searchview_loaded;
|
||||
if (this.flags.search_view !== false) {
|
||||
var search_defaults = {};
|
||||
|
@ -358,9 +369,13 @@ openerp.web.ViewManagerAction = openerp.web.ViewManager.extend(/** @lends oepner
|
|||
return manager_ready;
|
||||
},
|
||||
on_mode_switch: function (view_type) {
|
||||
var self = this;
|
||||
return $.when(
|
||||
this._super(view_type),
|
||||
this.shortcut_check(this.views[view_type]));
|
||||
this.shortcut_check(this.views[view_type])).then(function () {
|
||||
var view_id = self.views[self.active_view].controller.fields_view.view_id;
|
||||
self.$element.find('.oe_get_xml_view span').text(view_id);
|
||||
});
|
||||
},
|
||||
shortcut_check : function(view) {
|
||||
var self = this;
|
||||
|
|
|
@ -444,7 +444,13 @@
|
|||
<t t-extend="ViewManager" t-name="ViewManagerAction">
|
||||
<t t-jquery=".view-manager-main-content" t-operation="prepend">
|
||||
<a class="oe-shortcut-toggle" title="Add / Remove Shortcut..."
|
||||
href="javascript: void(0)"> </a>
|
||||
href="javascript: void(0)"> </a>
|
||||
<h2 class="oe_view_title">
|
||||
<t t-esc="self.action.name"/>
|
||||
<button t-if="self.session.debug" class="oe_get_xml_view">
|
||||
View#<span></span>
|
||||
</button>
|
||||
</h2>
|
||||
</t>
|
||||
</t>
|
||||
|
||||
|
@ -502,7 +508,6 @@
|
|||
</div>
|
||||
</t>
|
||||
<t t-name="TreeView">
|
||||
<h2 class="oe_view_title"><t t-esc="title"/></h2>
|
||||
<select t-if="toolbar" style="width: 30%">
|
||||
</select>
|
||||
<table class="oe-treeview-table">
|
||||
|
@ -632,7 +637,6 @@
|
|||
</t>
|
||||
<t t-name="FormView">
|
||||
<div class="oe_form_header" t-att-id="view.element_id + '_header'">
|
||||
<h2 class="oe_view_title"><t t-esc="view.fields_view.arch.attrs.string"/> <button t-if="view.session.debug" class="oe_get_xml_view">View#<t t-esc="view.fields_view.view_id"/></button></h2>
|
||||
<div class="oe_form_buttons" t-if="view.options.action_buttons !== false">
|
||||
<!--<button type="button" class="oe_form_button_save">
|
||||
<span class="oe_form_on_update">Save</span>
|
||||
|
@ -974,7 +978,6 @@
|
|||
</button>
|
||||
</t>
|
||||
<t t-name="SearchView">
|
||||
<h2 class="oe_view_title"><t t-esc="view.attrs['string']"/></h2>
|
||||
<form class="oe_forms">
|
||||
<t t-call="SearchView.render_lines"/>
|
||||
<div class="oe_search-view-buttons" style="text-align: right;">
|
||||
|
|
|
@ -31,8 +31,6 @@
|
|||
<t t-name="DashBoard.action">
|
||||
<div t-att-data-id="action.attrs.name" class="oe-dashboard-action">
|
||||
<h2 class="oe-dashboard-action-header oe_view_title">
|
||||
<t t-esc="action.attrs.string"/>
|
||||
<!--<a href="#" class="oe-dashboard-action-rename"><img src="/web/static/src/img/icons/gtk-edit.png" width="16" height="16"/></a>-->
|
||||
<input class="oe-dashboard-action-input" type="text" name="title" value="" style="display: none"/>
|
||||
<span class='ui-icon ui-icon-closethick'></span>
|
||||
<span class='ui-icon ui-icon-minusthick oe-dashboard-fold' t-if="!action.attrs.fold"></span>
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
<template>
|
||||
<t t-name="DiagramView">
|
||||
<div class="oe_diagram_header" t-att-id="element_id + '_header'">
|
||||
<h2 class="oe_view_title"><t t-esc="fields_view.arch.attrs.string"/></h2>
|
||||
<div class="oe_diagram_buttons">
|
||||
<button type="button" id="new_node" class="oe_diagram_button_new">New Node</button>
|
||||
<button type="button" id="new_edge" class="oe_diagram_button_new">New Edge</button>
|
||||
|
@ -19,4 +18,4 @@
|
|||
</div>
|
||||
<div id="dia-canvas" class="diagram show_grid" style="overflow: auto;"></div>
|
||||
</t>
|
||||
</template>
|
||||
</template>
|
||||
|
|
Loading…
Reference in New Issue