summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorVidhin Mehta (OpenERP) <vme@tinyerp.com>2011-09-20 18:13:02 +0530
committerVidhin Mehta (OpenERP) <vme@tinyerp.com>2011-09-20 18:13:02 +0530
commite0724b4c339b1da080cea7d8dc5e3b671fd07701 (patch)
treec3dee12e0625b19f0ef3f82e4b253492389596be /addons
parente34c9b01a50c4377982986c1d0cdecb9e87121ef (diff)
[IMP]improve code for edit dialog box in manager view.
bzr revid: vme@tinyerp.com-20110920124302-0nxmhgb0u6tomi37
Diffstat (limited to 'addons')
-rw-r--r--addons/web/static/src/css/base.css10
-rw-r--r--addons/web/static/src/js/view_editor.js29
-rw-r--r--addons/web/static/src/xml/base.xml41
3 files changed, 58 insertions, 22 deletions
diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css
index a66bb20d8de..5d4da8175dd 100644
--- a/addons/web/static/src/css/base.css
+++ b/addons/web/static/src/css/base.css
@@ -1369,6 +1369,12 @@ ul.oe-arrow-list li.oe-arrow-list-selected .oe-arrow-list-after {
border-color: rgba(0,0,0,0);
border-left-color: #CFCCCC;
}
-.openerp .view_editor{
- border-bottom: 1px solid #CFCCCC;
+.openerp .view_editor{
+ font-size: 90%;
+ font-weight: normal;
+ height : 10%;
+ padding: 0;
+ border-bottom: 1px solid #CFCCCC;
}
+
+
diff --git a/addons/web/static/src/js/view_editor.js b/addons/web/static/src/js/view_editor.js
index 28b13aa1930..6f9fd059066 100644
--- a/addons/web/static/src/js/view_editor.js
+++ b/addons/web/static/src/js/view_editor.js
@@ -70,9 +70,14 @@ openerp.web.ViewEditor = openerp.web.Widget.extend({
$(xml).each(function() {
att_list = this.attributes;
att_list = _.select(att_list, function(attrs){
- if(attrs.nodeName == "string" || attrs.nodeName == "name" || attrs.nodeName == "index"){
- name1 += ' ' +attrs.nodeName+'='+'"'+attrs.nodeValue+'"';}
- });
+ if (tag != 'button'){
+ if(attrs.nodeName == "string" || attrs.nodeName == "name" || attrs.nodeName == "index"){
+ name1 += ' ' +attrs.nodeName+'='+'"'+attrs.nodeValue+'"';}
+ }else{
+ if(attrs.nodeName == "name"){
+ name1 += ' ' +attrs.nodeName+'='+'"'+attrs.nodeValue+'"';}
+ }
+ });
name1+= ">";
});
obj.name = name1;
@@ -138,7 +143,7 @@ openerp.web.ViewEditor = openerp.web.Widget.extend({
return self.edit_view(one_object);
});
},
- edit_view : function(o){
+ edit_view : function(one_object){
var self = this;
this.dialog = new openerp.web.Dialog(this,{
modal: true,
@@ -160,9 +165,23 @@ openerp.web.ViewEditor = openerp.web.Widget.extend({
this.dialog.start().open();
this.dialog.$element.html(QWeb.render('view_editor', {
- 'data': o,
+ 'data': one_object,
}));
+
+ $("tr[id^='viewedit-']").click(function() {
+ $("tr[id^='viewedit-']").removeClass('ui-selected');
+ $(this).addClass('ui-selected');
+ });
+
+ $("img[id^='parentimg-']").click(function() {
+ if ($(this).attr('src') == '/web/static/src/img/collapse.gif'){
+ $(this).attr('src', '/web/static/src/img/expand.gif');
+ }else{
+ $(this).attr('src', '/web/static/src/img/collapse.gif');
+ }
+ });
}
+
});
};
diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml
index 6251b5ba339..5f91ab46047 100644
--- a/addons/web/static/src/xml/base.xml
+++ b/addons/web/static/src/xml/base.xml
@@ -1263,28 +1263,39 @@
</t>
</t>
<t t-name="view_editor">
- <table align="left" width= "100%">
+ <table align="left" width= "100%" >
<t t-call="view_editor.row"/>
</table>
</t>
-<t t-name="view_editor.row">
-
- <t t-foreach="data" t-as="rec">
- <tr >
- <td class= "view_editor"
- t-att-style="'background-position: ' + 30*rec.level + 'px; padding-left: ' + 30*rec.level + 'px'">
- <img t-if="rec.child_id.length" src="/web/static/src/img/collapse.gif" width="16" height="16" border="0"/>
- <t t-esc="rec.name"/>
- </td>
- </tr >
+<tr t-name="view_editor.row" t-att-id="'viewedit-' + rec.id" t-foreach="data" t-as="rec">
+ <td t-att-id = "rec.id" class="view_editor">
+ <table>
+ <tr>
+ <td width="16px" t-att-style="'background-position: ' + 20*rec.level + 'px; padding-left: ' + 20*rec.level + 'px'">
+ <img t-if="rec.child_id.length" t-att-id="'parentimg-' + rec.id" src="/web/static/src/img/collapse.gif" width="16" height="16" border="0"/>
+ </td>
+ <td style="cursor: pointer;">
+ <a style="text-decoration:none" href="javascript:void(0);"> <t t-esc="rec.name"/> </a>
+ </td>
+ </tr>
+ </table>
+ </td>
+ <td align="left" class="view_editor" style="cursor: pointer;">
+ <table cellspacing="0" cellpadding ="0" width="100%">
+ <tr>
+ <td> <img src="/web/static/src/img/icons/gtk-add.png" border="0"/> </td>
+ <td> <img src="/web/static/src/img/icons/gtk-remove.png" border="0"/> </td>
+ <td> <img src="/web/static/src/img/icons/gtk-edit.png" border="0"/> </td>
+ <td> <img src="/web/static/src/img/icons/gtk-go-up.png" border="0"/> </td>
+ <td> <img src="/web/static/src/img/icons/gtk-go-down.png" border="0"/> </td>
+ </tr>
+ </table>
+ </td>
<t t-if="rec.child_id.length">
<t t-set="data" t-value="rec.child_id"/>
<t t-call="view_editor.row"/>
</t>
- </t>
-
-</t>
-
+ </tr>
<t t-name="ExportView">
<a id="exportview" href="javascript: void(0)" style="text-decoration: none;color: #3D3D3D;">Export</a>
</t>