summaryrefslogtreecommitdiff
path: root/addons/website_version/static/src/js/edit_version.js
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2015-01-08 14:49:18 +0100
committerChristophe Simonis <chs@odoo.com>2015-01-08 14:49:18 +0100
commitd248ae06698bb8d711dfc83b823c82e5980c2cf1 (patch)
treecdadb23429b1af4f795382adb8e7dcce3bcad047 /addons/website_version/static/src/js/edit_version.js
parentabcb165d97dc90cbb878dd0f6ad3e35937816c8d (diff)
Revert "[ADD] website_version: website versioning and ab testing"
With more than 100 comments on github[1], this commit is clearly not production-ready. This reverts commit c255b5bc3461c803e38057c72c45530235de84dd, reversing changes made to e5ac65de59f45f2d15ae6f6b840b02cac78afd03. [1] https://github.com/odoo/odoo/commit/c255b5bc3461c803e38057c72c45530235de84dd
Diffstat (limited to 'addons/website_version/static/src/js/edit_version.js')
-rw-r--r--addons/website_version/static/src/js/edit_version.js82
1 files changed, 0 insertions, 82 deletions
diff --git a/addons/website_version/static/src/js/edit_version.js b/addons/website_version/static/src/js/edit_version.js
deleted file mode 100644
index 61f88816c8a..00000000000
--- a/addons/website_version/static/src/js/edit_version.js
+++ /dev/null
@@ -1,82 +0,0 @@
-(function() {
- 'use strict';
- var hash = "#advanced-view-editor";
- var _t = openerp._t;
-
- var website=openerp.website;
-
- website.action= {};
-
- website.EditorBar.include({
- start: function() {
- var self = this;
- var m_names = new Array("jan", "feb", "mar",
- "apr", "may", "jun", "jul", "aug", "sep",
- "oct", "nov", "dec");
- this.$el.on('click', '#save_as_new_version', function() {
- var d = new Date();
- var curr_date = d.getDate();
- var curr_month = d.getMonth();
- var curr_year = d.getFullYear();
-
- website.prompt({
- id: "editor_new_version",
- window_title: _t("New version"),
- input: "Version name" ,
- default :(curr_date + " " + m_names[curr_month] + " " + curr_year),
- }).then(function (name) {
- var context = website.get_context();
- openerp.jsonRpc( '/website_version/create_version', 'call', { 'name': name, 'version_id': 0 }).then(function (result) {
- $('html').data('version_id', result);
-
- var wizard = $(openerp.qweb.render("website_version.message",{message:_.str.sprintf("You are actually working on %s version.", name)}));
- wizard.appendTo($('body')).modal({"keyboard" :true});
- wizard.on('click','.o_confirm', function(){
- self.save();
- });
- wizard.on('hidden.bs.modal', function () {$(this).remove();});
- }).fail(function(){
- var wizard = $(openerp.qweb.render("website_version.message",{message:_t("This name already exists.")}));
- wizard.appendTo($('body')).modal({"keyboard" :true});
- wizard.on('hidden.bs.modal', function () {$(this).remove();});
- });
-
- });
-
- });
- this.$el.on('click', '#save_and_publish', function() {
- var version_id = $('html').data('version_id');
- if(version_id)
- {
- self.save();
- }
- else
- {
- var wizard = $(openerp.qweb.render("website_version.delete_message",{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(openerp.qweb.render("all_options", {version:'Save on '+name}));
- }
- else{
- self.$el.find(".o_first_choice").before(openerp.qweb.render("all_options", {version:'Save and Publish'}));
- }
-
- });
-
- return this._super();
- }
- });
-
-
-})(); \ No newline at end of file