[IMP] Menu entry dialog

bzr revid: fme@openerp.com-20131030160405-crxjr6agtmf2x89p
This commit is contained in:
Fabien Meghazi
2013-10-30 17:04:05 +01:00
parent a87196eece
commit aa2f9217c0
2 changed files with 18 additions and 6 deletions
+4 -3
View File
@@ -48,7 +48,7 @@
},
add_menu: function () {
var self = this;
var dialog = new website.menu.AddMenuDialog();
var dialog = new website.menu.MenuEntryDialog();
dialog.on('add-menu', this, function (link) {
var new_menu = {
id: _.uniqueId('new-'),
@@ -107,10 +107,11 @@
},
});
website.menu.AddMenuDialog = website.editor.LinkDialog.extend({
website.menu.MenuEntryDialog = website.editor.LinkDialog.extend({
template: 'website.menu.dialog.add',
make_link: function (url, new_window, label) {
this.trigger('add-menu', [url, new_window, label]);
var menu_label = this.$('input#link-text').val() || label;
this.trigger('add-menu', [url, new_window, menu_label]);
},
});
+14 -3
View File
@@ -23,7 +23,7 @@
</t>
<t t-name="website.menu.dialog.footer-button">
<button type="button" class="btn pull-left js_add_menu btn-success">
<i class="icon-plus-sign"/> Add Menu Item
<i class="icon-plus-sign"/> Add Menu Entry
</button>
</t>
<t t-name="website.menu.dialog.edit">
@@ -40,8 +40,19 @@
<t t-jquery="t[t-set='title']" t-operation="inner">
Add Menu Entry
</t>
<t t-jquery="label[for='link-text']" t-operation="replace">
Menu Label
<t t-jquery="form > div.form-horizontal" t-operation="replace"/>
<t t-jquery="ul.list-group" t-operation="before">
<div class="list-group">
<div class="form-group list-group-item">
<h3 class="list-group-item-heading">
<label for="link-new" class="control-label">
Menu Label
</label>
</h3>
<input type="text" class="form-control"
id="link-text" autofocus="autofocus"/>
</div>
</div>
</t>
</t>
</templates>