summaryrefslogtreecommitdiff
path: root/addons/website_version/static/src
diff options
context:
space:
mode:
authorBhumi Patel <bpa@openerp.com>2015-04-06 14:08:54 +0530
committerChristophe Matthieu <chm@odoo.com>2015-06-16 17:52:11 +0200
commit1cf56540ad06eab803abefbe0209e69a3d9410a5 (patch)
tree74e7e6c955b958dfad36a34eb468386c3e826819 /addons/website_version/static/src
parenta2896bf28ec61de2ca8754169077a2b7aaaa7fbb (diff)
[IMP]website_version:remove save and publish option from dropdown menu and change text of save button when working in another version.
Diffstat (limited to 'addons/website_version/static/src')
-rw-r--r--addons/website_version/static/src/js/edit_version.js34
-rw-r--r--addons/website_version/static/src/xml/version_templates.xml7
2 files changed, 4 insertions, 37 deletions
diff --git a/addons/website_version/static/src/js/edit_version.js b/addons/website_version/static/src/js/edit_version.js
index cbe3846f500..e60824e65fd 100644
--- a/addons/website_version/static/src/js/edit_version.js
+++ b/addons/website_version/static/src/js/edit_version.js
@@ -42,39 +42,13 @@ editor.EditorBar.include({
wizardA.on('hidden.bs.modal', function () {$(this).remove();});
});
- this.$el.on('click', '#save_and_publish', function() {
- var version_id = parseInt($('html').data('version_id'));
- if(version_id)
- {
- self.save();
- }
- else
- {
- var wizard = $(qweb.render("website_version.publish",{message:_t("Are you sure you want to publish your modifications.")}));
- wizard.appendTo($('body')).modal({"keyboard" :true});
- wizard.on('click','.o_confirm', function(){
- self.save();
- });
- wizard.on('hidden.bs.modal', function () {$(this).remove();});
- }
-
- });
-
- $('.option_choice').click(function() {
- self.$el.find(".o_second_choice").remove();
- var name = $('#version-menu-button').data('version_name');
- if(name){
- self.$el.find(".o_first_choice").before(qweb.render("all_options", {version:'Save on '+name}));
- }
- else{
- self.$el.find(".o_first_choice").before(qweb.render("all_options", {version:'Save and Publish'}));
- }
-
- });
+ var ver_name = $('#version-menu-button').data('version_name');
+ if(ver_name){
+ this.$el.find('button[data-action="save"]').text(_.str.sprintf(_t("Save on %s"), ver_name));
+ }
return this._super();
}
});
-
});
diff --git a/addons/website_version/static/src/xml/version_templates.xml b/addons/website_version/static/src/xml/version_templates.xml
index 03728f9f191..6490516f9ef 100644
--- a/addons/website_version/static/src/xml/version_templates.xml
+++ b/addons/website_version/static/src/xml/version_templates.xml
@@ -33,13 +33,6 @@
</t>
</t>
- <t t-name="all_options">
- <li class="o_second_choice">
- <a href="#" id="save_and_publish" data-action="save_and_publish"
- class="btn btn-link btn-xs o_version"><t t-esc="version"></t></a>
- </li>
- </t>
-
<t t-name="experiment_menu">
<li class="o_experiment"><a href="#" data-action="manage_experiment">Manage A/B tests</a></li>
<li class="o_experiment"><a href="#" data-action="statistics">Statistics</a></li>