From 1cf56540ad06eab803abefbe0209e69a3d9410a5 Mon Sep 17 00:00:00 2001 From: Bhumi Patel Date: Mon, 6 Apr 2015 14:08:54 +0530 Subject: [PATCH] [IMP]website_version:remove save and publish option from dropdown menu and change text of save button when working in another version. --- .../static/src/js/edit_version.js | 34 +++---------------- .../static/src/xml/version_templates.xml | 7 ---- 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 @@ - -
  • - -
  • -
    -
  • Manage A/B tests
  • Statistics